Nymra Posted Thursday at 02:15 AM Share Posted Thursday at 02:15 AM NEW Problem: See last post of me [04/09/2021 - 01:13:37AM] SEXLAB - PickByActors(Positions=[[WIDeadBodyCleanupScript < (000E1BA9)>], [masterambushscript < (00080B20)>]], Limit=64, Aggressive=TRUE) ;-------------------------------------------------------------- Ok,... I dunno where to look anymore. I just wanted to make some lines of code that sort from an array of 15 scanned NPC into: - sexpartners for player (aggressors) - sexpartners for Folloers (rapers), max 1 atm - follower (Victim) max 1 atm. bUt somehow the whole thing just produces gigabytes of stackdumps sayint stuff like this. [nade_CalmQuest (A60B7967)].nade_calmquest_qf_scr.SelectAggressor() - "nade_calmquest_qf_scr.psc" Line 453 [nade_CalmQuest (A60B7967)].nade_calmquest_qf_scr.Fragment_3() - "nade_calmquest_qf_scr.psc" Line 233 [04/08/2021 - 04:00:29AM] WARNING: Assigning None to a non-object variable named "::temp61" stack: [nade_CalmQuest (A60B7967)].nade_calmquest_qf_scr.SelectAggressor() - "nade_calmquest_qf_scr.psc" Line 453 [nade_CalmQuest (A60B7967)].nade_calmquest_qf_scr.Fragment_3() - "nade_calmquest_qf_scr.psc" Line 233 [04/08/2021 - 04:00:29AM] ERROR: Cannot call IsPlayerTeammate() on a None object, aborting function call Full script sourcefile attached below... I dunno what I m doing wrong. THis function also already worked in a different organisation (while not yielding the desired results...) Now I think I built some kind of deadly loop somewhere but I cannot see it while i && (Follower || NeedARaper) || (AggressorCount < j) ;while i not 0 and count 0,1,2,3,4 continue i -= 1 a = NPC[i].GetReference() as Actor ;first enemy is Aggressor[0] NO FOLLEWR ALLOWED FEMALE ALLOWED CHECK if AggressorCount > 0 && NeedARaper && !a.IsPlayerTeammate() && (!SexLab.GetGender(a) == 1) || cfgqst.FemalesAllowed Rapers[RaperCount] = a RaperCount += 1 ;NO FOLLOWER ALLOWED FEMALE ALLOWED CHECK elseif !a.IsPlayerTeammate() && (!SexLab.GetGender(a) == 1) || cfgqst.FemalesAllowed Aggressors[AggressorCount] = a AggressorCount += 1 ;only Followers return TRUE elseif a.IsPlayerTeammate() Victims[VictimCount] = a VictimCount += 1 Follower = false ;only Females return TRUE elseif (SexLab.GetGender(a) == 1) Victims[VictimCount] = a VictimCount += 1 endif endwhile nade_calmquest_qf_scr.psc Link to post
Nymra Posted Thursday at 02:56 AM Author Share Posted Thursday at 02:56 AM edit: I found the reason for the stackdumps (here: " while i && (Follower || NeedARaper) || (AggressorCount < j) , but I think the whole logic I try to apply here is not working out somehow... so still the function does not really do what I want, it can only seem to adjust the follower as victim and thats about it. maybe i m dump or just too tired. Link to post
Tyrant99 Posted Thursday at 03:09 AM Share Posted Thursday at 03:09 AM Been awhile since I coded papyrus, but does while i return false once it hits 0 or negative int? Could try while i > 0 just to be explicit so it isn't trying to logic 'if this int exists', which would make your while loop go forever. Link to post
CPU Posted Thursday at 05:14 AM Share Posted Thursday at 05:14 AM while i && (Follower || NeedARaper) && (AggressorCount < j) Link to post
Andy14 Posted Thursday at 05:26 AM Share Posted Thursday at 05:26 AM while (i > 0) && (Follower || NeedARaper) && (AggressorCount < j) Link to post
Fotogen Posted Thursday at 07:12 AM Share Posted Thursday at 07:12 AM 4 hours ago, Nymra said: [04/08/2021 - 04:00:29AM] WARNING: Assigning None to a non-object variable named "::temp61" Tipicaly this is because you call a function that should return a value, but function didn't. For example: ... your code is int ii ii = getCount() ;.... we asume that getCount() returns an Int ... ; this func returns "count" ... sometimes int Function getCount() if condition return 10 endIf EndFunction ;... notice how we don't allways return an Int ; in that case, papyrus will return "none" 4 hours ago, Nymra said: [04/08/2021 - 04:00:29AM] ERROR: Cannot call IsPlayerTeammate() on a None object, aborting function call a = NPC.GetReference() as Actor a is "none" ??? Whats in array NPC? Is it big enough? Does it have "Actor"? I see no error checking. Link to post
Nymra Posted Thursday at 01:10 PM Author Share Posted Thursday at 01:10 PM ooooh boy, thx a lot my dear friends. Alot to learn I have ^^ Damn conditions make my head spin. Got it to work now went a step back complexity wise and added better checks. Link to post
Nymra Posted Thursday at 11:27 PM Author Share Posted Thursday at 11:27 PM Got another... I would post a code bit to show what I m doing, but I have NO idea where to look for the bug that is causing this o_O I think in the ESP the conditions check for "DeadActors -> no" and also something with ambush, but how does that end up in this sexlab log?! (btw the thread in question is not starting of course... [04/09/2021 - 01:13:10AM] SEXLAB - NOTICE: ValidateActor(Jenassa) -- TRUE -- MISS [04/09/2021 - 01:13:10AM] SEXLAB - NOTICE: Jenassa Init Empty Stats [04/09/2021 - 01:13:10AM] SEXLAB - ActorAlias[Jenassa] SetActor([WIDeadBodyCleanupScript < (000E1BA9)>]) - [sslActorAlias <alias ActorAlias004 on quest SexLabThread00 (07061EEF)>] [04/09/2021 - 01:13:11AM] SEXLAB - NOTICE: ValidateActor(Bandit Chief) -- TRUE -- HIT [04/09/2021 - 01:13:11AM] SEXLAB - ActorAlias[Bandit Chief] SetActor([masterambushscript < (00080B20)>]) - [sslActorAlias <alias ActorAlias003 on quest SexLabThread00 (07061EEF)>] [04/09/2021 - 01:13:37AM] SEXLAB - PickByActors(Positions=[[WIDeadBodyCleanupScript < (000E1BA9)>], [masterambushscript < (00080B20)>]], Limit=64, Aggressive=TRUE) nade_calmquest_qf_scr.psc Papyrus.0.log Link to post