Jump to content

Doge's Sexlab questions


Recommended Posts

Modding with SL 1.6 a3, clean environment&save, everything works fine.

 

With

Actor[] SexActors
SexActors = sslUtility.PushActor(SexActor1, SexActors)
SexActors = SexLab.FindAvailablePartners(SexActors, 14)
Debug.Notification(SexActors.Length as string)

Lot of errors:

[05/14/2015 - 02:55:52PM] ERROR: Array index 29 is out of range (0-24)
stack:
    [sexLabQuestFramework (06000D62)].sslthreadlibrary.FindAvailableActor() - "sslThreadLibrary.psc" Line 34
    [sexLabQuestFramework (06000D62)].sslthreadlibrary.FindAvailablePartners() - "sslThreadLibrary.psc" Line 74
    [sexLabQuestFramework (06000D62)].sexlabframework.FindAvailablePartners() - "SexLabFramework.psc" Line 116
    [adcSexlifeMain (16004338)].adcSexlifeMain.OnUpdate() - "adcSexlifeMain.psc" Line 99
[05/14/2015 - 02:55:52PM] [DLC2PillarBuilderActorScript < (040177DB)>]OnPackageStart()
[05/14/2015 - 02:55:53PM] ERROR: Array index 29 is out of range (0-24)
stack:
    [sexLabQuestFramework (06000D62)].sslthreadlibrary.FindAvailableActor() - "sslThreadLibrary.psc" Line 34
    [sexLabQuestFramework (06000D62)].sslthreadlibrary.FindAvailablePartners() - "sslThreadLibrary.psc" Line 72
    [sexLabQuestFramework (06000D62)].sexlabframework.FindAvailablePartners() - "SexLabFramework.psc" Line 116
    [adcSexlifeMain (16004338)].adcSexlifeMain.OnUpdate() - "adcSexlifeMain.psc" Line 99
[05/14/2015 - 02:55:53PM] ERROR: Array index 28 is out of range (0-24)
stack:
    [sexLabQuestFramework (06000D62)].sslthreadlibrary.FindAvailableActor() - "sslThreadLibrary.psc" Line 34
    [sexLabQuestFramework (06000D62)].sslthreadlibrary.FindAvailablePartners() - "sslThreadLibrary.psc" Line 72
    [sexLabQuestFramework (06000D62)].sexlabframework.FindAvailablePartners() - "SexLabFramework.psc" Line 116
    [adcSexlifeMain (16004338)].adcSexlifeMain.OnUpdate() - "adcSexlifeMain.psc" Line 99
[05/14/2015 - 02:55:54PM] ERROR: Array index 27 is out of range (0-24)
stack:
    [sexLabQuestFramework (06000D62)].sslthreadlibrary.FindAvailableActor() - "sslThreadLibrary.psc" Line 34
    [sexLabQuestFramework (06000D62)].sslthreadlibrary.FindAvailablePartners() - "sslThreadLibrary.psc" Line 72
    [sexLabQuestFramework (06000D62)].sexlabframework.FindAvailablePartners() - "SexLabFramework.psc" Line 116
    [adcSexlifeMain (16004338)].adcSexlifeMain.OnUpdate() - "adcSexlifeMain.psc" Line 99
[05/14/2015 - 02:55:54PM] ERROR: Array index 26 is out of range (0-24)
stack:
    [sexLabQuestFramework (06000D62)].sslthreadlibrary.FindAvailableActor() - "sslThreadLibrary.psc" Line 34
    [sexLabQuestFramework (06000D62)].sslthreadlibrary.FindAvailablePartners() - "sslThreadLibrary.psc" Line 72
    [sexLabQuestFramework (06000D62)].sexlabframework.FindAvailablePartners() - "SexLabFramework.psc" Line 116
    [adcSexlifeMain (16004338)].adcSexlifeMain.OnUpdate() - "adcSexlifeMain.psc" Line 99

 


After that the array gets filled with who is available with no more errors. Not sure if I am doing the arrays right or what is going on. What is this 0-24 limit? Where does it come from?

Link to comment
Actor function FindAvailableActor(ObjectReference CenterRef, float Radius = 5000.0, int FindGender = -1, Actor IgnoreRef1 = none, Actor IgnoreRef2 = none, Actor IgnoreRef3 = none, Actor IgnoreRef4 = none)
	if !CenterRef || FindGender > 2 || FindGender < -1 || Radius < 0.1
		return none ; Invalid args
	endIf
	; Create supression list
	form[] Suppressed = new form[25]
	Suppressed[24] = CenterRef
	Suppressed[23] = IgnoreRef1
	Suppressed[22] = IgnoreRef2
	Suppressed[21] = IgnoreRef3
	Suppressed[20] = IgnoreRef4
	; Attempt 30 times before giving up.
	int i = 30
	while i
		i -= 1
		Actor FoundRef = Game.FindRandomActorFromRef(CenterRef, Radius)
		if !FoundRef || (Suppressed.Find(FoundRef) == -1 && CheckActor(FoundRef, FindGender))
			return FoundRef ; None means no actor in radius, give up now
		endIf
		Suppressed[i] = FoundRef
	endWhile
	; No actor found in attempts
	return none
endFunction

In sslThreadLibrary, FindAvailableActor supressed is size 25 array, yet we loop it with 30

Link to comment

I dont claim to understand what it does but I changed it to this and it gives no errors now

Actor function FindAvailableActor(ObjectReference CenterRef, float Radius = 5000.0, int FindGender = -1, Actor IgnoreRef1 = none, Actor IgnoreRef2 = none, Actor IgnoreRef3 = none, Actor IgnoreRef4 = none)
	if !CenterRef || FindGender > 2 || FindGender < -1 || Radius < 0.1
		return none ; Invalid args
	endIf
	; Create supression list
	form[] Suppressed = new form[25]
	Suppressed[24] = CenterRef
	Suppressed[23] = IgnoreRef1
	Suppressed[22] = IgnoreRef2
	Suppressed[21] = IgnoreRef3
	Suppressed[20] = IgnoreRef4
	; Attempt 25 times before giving up. ;changed  30 to 25
	int i = 25                           ;changed  30 to 25
	while i
		i -= 1
		Actor FoundRef = Game.FindRandomActorFromRef(CenterRef, Radius)
		if !FoundRef || (Suppressed.Find(FoundRef) == -1 && CheckActor(FoundRef, FindGender))
			return FoundRef ; None means no actor in radius, give up now
		endIf
		Suppressed[i] = FoundRef
	endWhile
	; No actor found in attempts
	return none
endFunction
Link to comment

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...