Jump to content

[Scripting] Sexlab Script Problems


Nymra

Recommended Posts

Posted

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

Posted

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. 

Posted

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.

Posted
while i && (Follower || NeedARaper) && (AggressorCount < j)
Posted
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.

 

Posted

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. 

 

Posted

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

Archived

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

  • Recently Browsing   0 members

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