Dooge Posted May 14, 2015 Share Posted May 14, 2015 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
Dooge Posted May 14, 2015 Author Share Posted May 14, 2015 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
Dooge Posted May 14, 2015 Author Share Posted May 14, 2015 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
nutluck Posted May 14, 2015 Share Posted May 14, 2015 Interesting, though I have not used 1.6 beta yet. Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.