Jump to content

Recommended Posts

Posted (edited)

Encountered another possible bug?

I got a script going and was looking at ways to perhaps optimise it and started playing with the call script function. I can not for the life of me get the callarg to work even if i copy and paste the examples from the wiki.

current test code: (yes there is some code that is not being used, it was just left as i was dumbing it down to the wiki example)

Spoiler
;test2a.sltscript

set $FoundActors resultfrom util_scan_cell_npcs

set $loop 0
set $TotalActors resultfrom listcount $FoundActors
while $loop <= $TotalActors
	set $Actor $FoundActors[$loop]
	call "test2b" "some argument"
	inc $loop 1
endwhile

;test2b.sltscript
callarg 0 $receivedArg
msg_notify $"{$receivedArg}"
return

 


The loop in the first script works as before i was having it try to say "(Actor name) found" and i would get " found" for the amount of times as there were actors but could not get any information over to the called script so i dumbed it down to what i posted here and still can not get it to work.

from this testing tho it doesn't seem like the call script function will help me as speed wise calling a different script seems to just be the same as having the code in the main script itself.

Edited by thorax339
Posted
55 minutes ago, thorax339 said:

Encountered another possible bug?

I got a script going and was looking at ways to perhaps optimise it and started playing with the call script function. I can not for the life of me get the callarg to work even if i copy and paste the examples from the wiki.

current test code: (yes there is some code that is not being used, it was just left as i was dumbing it down to the wiki example)

  Reveal hidden contents
;test2a.sltscript

set $FoundActors resultfrom util_scan_cell_npcs

set $loop 0
set $TotalActors resultfrom listcount $FoundActors
while $loop <= $TotalActors
	set $Actor $FoundActors[$loop]
	call "test2b" "some argument"
	inc $loop 1
endwhile

;test2b.sltscript
callarg 0 $receivedArg
msg_notify $"{$receivedArg}"
return

 


The loop in the first script works as before i was having it try to say "(Actor name) found" and i would get " found" for the amount of times as there were actors but could not get any information over to the called script so i dumbed it down to what i posted here and still can not get it to work.

from this testing tho it doesn't seem like the call script function will help me as speed wise calling a different script seems to just be the same as having the code in the main script itself.

 

I'll check into the possible bug, but yeah, the call functionality is more for code reuse/organization than for speed. You can place a piece of functionality there that multiple different scripts may need to tap into without having to copy the same code into multiple files (lots of fun when you find a bug).

Posted

(semi rambling ahead)
[rambling]
I might be understanding it wrong but i remember reading somewhere that you can kind of multithread scripts by running them on multiple npcs? or it was just to increase the limit of currently running scripts by spreading them out among actors.

I know its possible to spread them out via the in game triggers and initially when looking into the call script i was thinking if it was possible to do so via script. aka when using call script you could then have it act as if it was triggered by the npc and then run that script alongside the main one.

Reason i think ive got this wrong is that this all still uses papyrus and that can only run 1 thread?

basically the original thought was. run script to find actors > have them all check themselves > if conditions met, add themselves to a global list > then call that global list later.
the Loops are definitely the slowest part of my current script.
 

Current script im working on: using nffFollowers method currently as mentioned previously
Premise: matchmaker for followers using player, has weighting options based on things like devious devices / lack of clothing and arousal.
There are a couple redundant lines of code in here i am aware of.

Spoiler
	set $nffFollowers resultfrom nff_getfollowers  
	set $nffcount resultfrom listcount $nffFollowers

	set $loop 0
	while $loop < $nffcount
		sla_get_arousal $nffFollowers[$loop]
		if $$ >= 75
			set $followerName resultfrom actor_name $nffFollowers[$loop]
			listadd $ThirstyFollower $nffFollowers[$loop]
			msg_notify $"{$followerName} is eyeing you down"
		endif
		inc $loop 1
	endwhile

	set $TotalActors resultfrom listcount $ThirstyFollower
	if $TotalActors > 0 StartCheck

[StartCheck]

	set $playerchance 0
	actor_worninslot $system.player 32
		if $$ = false
			inc $playerchance 2
		endif
	actor_wornhaskeyword $system.player "zad_Lockable"
		if $$ = true
			inc $playerchance 1
		endif
	actor_wornhaskeyword $system.player "zad_DeviousHeavyBondage"
		if $$ = true
			inc $playerchance 2
		endif
	actor_wornhaskeyword $system.player "zad_DeviousCollar"
		if $$ = true
			inc $playerchance 1
		endif
	msg_notify $"Player chance: {$playerchance}"
	set $loop 0
	set $chance 10
	while $loop < $TotalActors
		set $currentchance $playerchance
		sla_get_arousal $ThirstyFollower[$loop]
		if $$ < 80
			inc $currentchance 1
		elseif < 90
			inc $currentchance 3
		elseif < 100
			inc $currentchance 6
		elseif > 99
			inc $currentchance 10
		endif

		if $currentchance >= $chance
			listadd $PotentialActors $ThirstyFollower[$loop]
		else
			rnd $currentchance $chance
			if $$ = $chance
				listadd $PotentialActors $ThirstyFollower[$loop]
			endif
		endif
		msg_notify $"loop {$loop} finished"
		inc $loop 1
	endwhile
	set $PotentialActorsCount resultfrom listcount $PotentialActors
	if $PotentialActorsCount > 1 StartSex
	else
		goto end
	endif

[StartSex]
	set $SexActors[0] $system.player
	set $sl_is_ready resultfrom sl_isready
	if $sl_is_ready = true
		set $loop 0
		while $loop < $PotentialActorsCount
			sl_is_valid_actor $PotentialActors[$loop]
			if $$ = true
				listadd $SexActors $PotentialActors[$loop]
			endif
			inc $loop 1
		endwhile
	set $SexActorsCount resultfrom listcount $SexActors
	if $SexActorsCount > 1
		sl_startsex $SexActors $SexActors[0] "" 0
	endif
	
[end]
	listclear $ThirstyFollower
	listclear $SexActors

 

 

Ill probably end up having this split into 2 or 3 separate scripts to be ran at different times instead of 1 big one running each time. going through the whole thing probably takes about half a minute just with 2 nff followers from the start of the script to initiating the sex scene.

 

for example the earlier thing i mentioned about having actors test themselves would be the first loop using the util scan npc function and then basically have the other script then check the follower faction rank of $system.self (aka the npc actor) then check arousal. if Follower and arousal > whatever i set, add to list.

from making this script i did miss having a "switch" like function for having multiple if statements checking the same thing instead of spamming elseifs one after the other.

 

[/rambling]

Posted
8 hours ago, hextun said:

 

I just checked into this as well. I pulled the latest SLP from pixeldrain via the Discord link. This would be SLP+ 2.17.0, announced by Scrab on 2026-March-06. Looking at the SexLabStatistics.psc file, I see the same signature and the same ID values, including 17 for Arousal.

 

I'm not sure why you would always get 0, although I have some thoughts. While I was investigating (i.e. searching the Discord history for references to arousal), I saw indications that SexLab "arousal" is an in-scene thing, representing the level of arousal/enjoyment that would lead to an orgasm. This would be separate from the "arousal" from arousal mods like OSLA. Those "arousal" values represent the actor's general level of arousal, i.e. desire for sex. As opposed to the in-scene arousal, i.e. closeness to orgasm. This is further indicated when you look at the SexLabP+ API docs at https://slp-community.github.io/SexLab-Wiki/slp/api-reference/ (search for arousal) where the API calls actually reference "enjoyment", which I'm very sure references in-scene behavior.

 

What does this mean? If you are trying to determine how much an actor wants to have sex outside of a scene, you need to use whatever arousal mod's API can fetch you that info (as you did with sla_get_arousal). If you are trying to determine how close an actor in scene is to having an orgasm, you need to use the appropriate SexLab API.

 

I am, let's say, 87% certain of this, with the variability due to not having actually seen code or gotten a statement from a dev that corroborates my stance. Otherwise, I think there is sufficient evidence to make the statement.

 

Okay, I was wrong. :)

 

I went ahead and asked on the Discord channel.

 

Hextun: I should have asked this here, sorry for the repeat: 
Does the SexLabStatistics.GetStatistic(Actor, int) with value 17 (Arousal) refer to an in-scene-only statistic? i.e. how close the player is to orgasm? Should it return 0 (zero) out-of-scene?

BabyImpala: not necessarily unless the scene ended right after actor orgasm (in which case its zero)
if scene ended abruptly, this applies (where _arousalBase is the one cached at start of scene)
    Papyrus code snippet:
    Function UpdateArousalStat()
        _arousalStat = _arousalBase + (_FullEnjoyment as float / 2)
        SexlabStatistics.SetStatistic(_ActorRef, 17, _arousalStat)
    EndFunction

BabyImpala: SLO Aroused NG is supposed to feed its arousal value to the stat continously outside scene iirc so there's that too

 

So I read this as: SLO Aroused NG should feed its arousal value continuously outside of the scene. When a scene starts, the current arousal is cached and, if the scene ends abruptly, half current enjoyment is applied and this new value is stored as the new arousal statistic. Otherwise (I guess) the current arousal is left as is (so if you orgasm, setting it to 0, then go a little longer, it might not be zero at scene's end).

 

Honestly, I'm not sure what would be going wrong in my call; both the actor and statisticID are required parameters and the code checks out for accessing the parameters correctly. There *is* a bug where the warning message if the actor does not resolve says it is from 'sl_is_forbidden', so I will be fixing that, but that doesn't appear to be the problem you are experiencing.

 

Are you using SLO Aroused NG for your arousal tracking?

Posted (edited)
10 hours ago, hextun said:

Are you using SLO Aroused NG for your arousal tracking?

 

I didn't even realise there was a new one. was using just SL Aroused SSE.
 

I believe i was using this one but the baka modified version:

 

Updated to SLO Aroused NG and started a new save as required and the command works perfectly. i guess sexlab P+ just wasn't designed with the older ones in mind.

 

Good thing my current save only got through about 2 dungeons before i started messing with all this stuff xD. no harm in restarting

Edited by thorax339
Posted

Very basic thing that I'm probably just not understanding (I'm bad at scripting), but I was looking to make a simple SLT script that essentially plays music from a custom music type, which I have created an .esp for, when a Sexlab scene starts, and another to remove the music when the scene ends. I assume this could be achieved by having the SLT script call for "addmusic FORMID" and "removemusic FORMID". I've set the script up in the MCM but I can't seem to get it to work, which is likely on the scripting side. Anybody know how I could get this working? I thought it would just be as simple as "console addmusic", or "console $system.self addmusic", but neither worked.

Posted
3 hours ago, boyo_wonder said:

Very basic thing that I'm probably just not understanding (I'm bad at scripting), but I was looking to make a simple SLT script that essentially plays music from a custom music type, which I have created an .esp for, when a Sexlab scene starts, and another to remove the music when the scene ends. I assume this could be achieved by having the SLT script call for "addmusic FORMID" and "removemusic FORMID". I've set the script up in the MCM but I can't seem to get it to work, which is likely on the scripting side. Anybody know how I could get this working? I thought it would just be as simple as "console addmusic", or "console $system.self addmusic", but neither worked.

 

I wasn't aware of the addmusic console command, so thank you for that enlightenment. :)

 

Okay, so, SLTScript is its own thing; the SLTScript commands aren't console commands, they are their own scripting language. You can read more about it on the wiki: https://github.com/sltriggersredux/sltriggersredux/wiki

- language basics (setting variables, scopes, that sort of thing): https://github.com/sltriggersredux/sltriggersredux/wiki/Scripts

- function library (all the extra functionality): https://github.com/sltriggersredux/sltriggersredux/wiki/Function-Libraries

 

Next, when I went digging for info about the 'addmusic' console command, I found the following links:

 

https://en.uesp.net/wiki/Skyrim:Music

In particular it seems like it is expecting some fairly specific parameters. 

 

For my part, I tested with the following SLTScript:

 

console $system.self "addmusic MUSCombat"

 

I put that into a test script named 'Zb01.sltscript' and ran it via the following console commands (note: 'prid player' is just to ensure your player is the focus of the script):

prid player

slt run Zb01

 

Doing so successfully set the music to combat.

 

That said, I'm not familiar at all with the embedding and access of music within .esp files, so I'm not sure how to help you much further. :(

 

Posted
4 hours ago, hextun said:

 

I wasn't aware of the addmusic console command, so thank you for that enlightenment. :)

 

Okay, so, SLTScript is its own thing; the SLTScript commands aren't console commands, they are their own scripting language. You can read more about it on the wiki: https://github.com/sltriggersredux/sltriggersredux/wiki

- language basics (setting variables, scopes, that sort of thing): https://github.com/sltriggersredux/sltriggersredux/wiki/Scripts

- function library (all the extra functionality): https://github.com/sltriggersredux/sltriggersredux/wiki/Function-Libraries

 

Next, when I went digging for info about the 'addmusic' console command, I found the following links:

 

https://en.uesp.net/wiki/Skyrim:Music

In particular it seems like it is expecting some fairly specific parameters. 

 

For my part, I tested with the following SLTScript:

 

console $system.self "addmusic MUSCombat"

 

I put that into a test script named 'Zb01.sltscript' and ran it via the following console commands (note: 'prid player' is just to ensure your player is the focus of the script):

prid player

slt run Zb01

 

Doing so successfully set the music to combat.

 

That said, I'm not familiar at all with the embedding and access of music within .esp files, so I'm not sure how to help you much further. :(

 

Seems like my main mistake there was just trying to use the numerical form ID rather than just the name of the music type. I was able to get vanilla music playing that way.

 

However, when I call for a custom music type added by my testing esp, I get a "script not found" error in the console. This suggests the console does not recognise the custom music type so I cannot play it through the console. I would need to define it somehow so the console can recognise it, but I'm not familiar with how to do such a thing.

Posted
On 3/30/2026 at 1:28 PM, thorax339 said:

(semi rambling ahead)
[rambling]
I might be understanding it wrong but i remember reading somewhere that you can kind of multithread scripts by running them on multiple npcs? or it was just to increase the limit of currently running scripts by spreading them out among actors.

I know its possible to spread them out via the in game triggers and initially when looking into the call script i was thinking if it was possible to do so via script. aka when using call script you could then have it act as if it was triggered by the npc and then run that script alongside the main one.

Reason i think ive got this wrong is that this all still uses papyrus and that can only run 1 thread?

basically the original thought was. run script to find actors > have them all check themselves > if conditions met, add themselves to a global list > then call that global list later.
the Loops are definitely the slowest part of my current script.
 

Current script im working on: using nffFollowers method currently as mentioned previously
Premise: matchmaker for followers using player, has weighting options based on things like devious devices / lack of clothing and arousal.
There are a couple redundant lines of code in here i am aware of.

  Hide contents
	set $nffFollowers resultfrom nff_getfollowers  
	set $nffcount resultfrom listcount $nffFollowers

	set $loop 0
	while $loop < $nffcount
		sla_get_arousal $nffFollowers[$loop]
		if $$ >= 75
			set $followerName resultfrom actor_name $nffFollowers[$loop]
			listadd $ThirstyFollower $nffFollowers[$loop]
			msg_notify $"{$followerName} is eyeing you down"
		endif
		inc $loop 1
	endwhile

	set $TotalActors resultfrom listcount $ThirstyFollower
	if $TotalActors > 0 StartCheck

[StartCheck]

	set $playerchance 0
	actor_worninslot $system.player 32
		if $$ = false
			inc $playerchance 2
		endif
	actor_wornhaskeyword $system.player "zad_Lockable"
		if $$ = true
			inc $playerchance 1
		endif
	actor_wornhaskeyword $system.player "zad_DeviousHeavyBondage"
		if $$ = true
			inc $playerchance 2
		endif
	actor_wornhaskeyword $system.player "zad_DeviousCollar"
		if $$ = true
			inc $playerchance 1
		endif
	msg_notify $"Player chance: {$playerchance}"
	set $loop 0
	set $chance 10
	while $loop < $TotalActors
		set $currentchance $playerchance
		sla_get_arousal $ThirstyFollower[$loop]
		if $$ < 80
			inc $currentchance 1
		elseif < 90
			inc $currentchance 3
		elseif < 100
			inc $currentchance 6
		elseif > 99
			inc $currentchance 10
		endif

		if $currentchance >= $chance
			listadd $PotentialActors $ThirstyFollower[$loop]
		else
			rnd $currentchance $chance
			if $$ = $chance
				listadd $PotentialActors $ThirstyFollower[$loop]
			endif
		endif
		msg_notify $"loop {$loop} finished"
		inc $loop 1
	endwhile
	set $PotentialActorsCount resultfrom listcount $PotentialActors
	if $PotentialActorsCount > 1 StartSex
	else
		goto end
	endif

[StartSex]
	set $SexActors[0] $system.player
	set $sl_is_ready resultfrom sl_isready
	if $sl_is_ready = true
		set $loop 0
		while $loop < $PotentialActorsCount
			sl_is_valid_actor $PotentialActors[$loop]
			if $$ = true
				listadd $SexActors $PotentialActors[$loop]
			endif
			inc $loop 1
		endwhile
	set $SexActorsCount resultfrom listcount $SexActors
	if $SexActorsCount > 1
		sl_startsex $SexActors $SexActors[0] "" 0
	endif
	
[end]
	listclear $ThirstyFollower
	listclear $SexActors

 

 

Ill probably end up having this split into 2 or 3 separate scripts to be ran at different times instead of 1 big one running each time. going through the whole thing probably takes about half a minute just with 2 nff followers from the start of the script to initiating the sex scene.

 

for example the earlier thing i mentioned about having actors test themselves would be the first loop using the util scan npc function and then basically have the other script then check the follower faction rank of $system.self (aka the npc actor) then check arousal. if Follower and arousal > whatever i set, add to list.

from making this script i did miss having a "switch" like function for having multiple if statements checking the same thing instead of spamming elseifs one after the other.

 

[/rambling]

 

I had started writing a response to this, and then realized I was missing some things and not addressing what I felt needed to be addressed.

So, first things first:

  •   util_scan_cell_npcs is almost always going to be slower than nff_getfollowers.
  •   if you use the afRadius parameter on util_scan_cell_npcs and limit it to npcs within a fairly limited range, you'll get consistently improved results
  •   looping is slow, I'm sorry
  •   goto is pretty fast
  •   if/else is actually not too bad
  •   if you are willing to compromise on a few things, there are some kinda neat things you can do with goto

That said, let's touch on a few points before circling back around to your script.


Threading and Papyrus

The Papyrus engine uses a form of "cooperative multitasking". Unlike "preemptive" where the underlying system (an OS or, in this case, the Skyrim Papyrus engine) chooses when execution switches between tasks, with "cooperative" much, if not all, of that control remains with a given task. In this case, as you say, a Papyrus script. As I understand it (yay weasel words), so long as a Papyrus script doesn't call a function outside its own script object, execution remains with it; if it calls a function in another script, the engine basically queues up that call and pauses the calling script.

 

Say you have foo.psc and bar.psc and a function, foo.FooFunc() is called. If it does nothing but interact with functions within foo.psc, it will presumably execute until completion without interruption. But if somewhere in foo.FooFunc() it calls bar.BarFunc(), the engine will stop the foo.FooFunc() call, queue up bar.BarFunc() and then give control over to whichever script thread it thinks should be next. Note that this may not be bar.BarFunc().

 

As a result, you can effectively "thread" multiple Papyrus script calls, but there are caveats. If you control all of the source code and are making cross-script calls, you are effectively giving the engine opportunities to suspend your thread so others can run. Of course, that's a somewhat nuanced dance you're doing at that point. If you don't control all the code (say you are calling an API function on someone else's library, there may be a good chance it will also allow itself to be interrupted (because it too calls another script's function) but you have no guarantee of that.

 

Another way to effect a sort of "multi-threaded" experience is by sending an event. This necessarily causes the engine to queue up another function call. Similarly, of course, if the event handler (or any event handler for that event if multiple are hooking it) is written such that it does not give the engine a chance to take over control, then you can still end up with one script hogging all of the execution time.

 

So, yes, the engine is effectively single-threaded, but in practice longer functions tend to give up control at some point anyway, letting the engine handle other pending calls.


The 'call' SLTScript command

What 'call' does is push the context of the currently running SLTScript onto a stack, load the requested script, creating a new context, and then running that SLTScript. Once it finishes, either by reaching the end of the script or calling 'return' explicitly, any pushed context is popped and the previously running SLTScript continues where it left off. If none are pending, the original calling SLTScript context wraps up and the MGEF it is anchored to is removed.

 

This does not make any attempt at spinning off a new call; it is fully synchronous, and the calling script will wait for the called script to finish before moving on.

 

If the same SLTScript is being run on multiple NPCs (for example, an OnStart trigger targeting any player partners, with a 3+ member scene involving the player), separate MGEF objects will be applied to each actor, each running their own instance of the same script.


The 'actor_sendmodevent' command and spawning multiple scripts

If you have a list of actors and want to run a script on each of them, you can use the 'actor_sendmodevent' to send an "OnSLTRequestCommand" event, which SLTR will pick up and run for you.

 

Note, however, that you can't send arguments for the script. But you *can* use target-scoped variables to set an SLTR variable value directly on a target actor, and rely on the script you are setting up to access that value.

 

You would still have to loop through your actor list, though.

 

Something like:

set $nffFollowers resultfrom nff_getfollowers
set $nffcount resultfrom listcount $nffFollowers

set $loop 0
while $loop < $nffcount
    set $target.<nffFollowers[$loop]>.arg_value 42
    actor_sendmodevent $nffFollowers[$loop] "OnSLTRequestCommand" "your_script.sltscript"
endwhile

 

Then each actor will have a copy of "your_script.sltscript" run on it, and you will have set the target scoped variable 'arg_value' to 42 before calling.

 

At that point you are (sort of) multithreading. Which means if, for example, you are having them all possibly add themselves to a global list, and later that list is accessed, you would have to manage the possibility the list gets used before it is fully populated, and SLTScript doesn't have any notion of mutexes.



*whew* That was a lot. Go take a break; we're going to touch on your script.

 

.. back? Okay, good.

 

You aren't the first one to want to create a matchmaker style script and so far I haven't been able to help folks much mostly because I hadn't thought of a reasonably fast method to approach it. But let's take a crack at it. (pinging @Fraying9981 because, IIRC, they also wanted to set up a matchmaker).

 

To begin with, I'm going to try to do this in a single script, using a timer based trigger, meaning it will run once every X minutes of real time.

 

The objective will be to use util_scan_cell_npcs, centered on the player, using a radius of 1000 units, which appears to be roughly 10 meters. Adjust to taste. If we have any candidates, then grab the player's worn state to create a base chance. Next, loop over the candidates and, for each, check their arousal using your criteria to create a participant chance. If that chance is >= 10, or if the rnd_int result is 10, add them to the list. Since SexLab scenes have (afaik) a cap of 5 total, and the player will be 1, once we have added 4 to the list we can stop looping. If we found anyone (besides the player), start the show!

 

Here's my version. I did a test inside an inn using the Nefaram modlist by putting it into a script and running it manually via console command, but the result should be the same even if using a timer trigger.

 

Spoiler
; I would recommend removing the msg_console calls once you are happy with how things work
; using afRadius 1000.0 which seems to be maybe 10 meters equivalent?
set $candidates resultfrom util_scan_cell_npcs $system.player 1000.0
set $num_candidates resultfrom listcount $candidates
if $num_candidates < 1
	msg_console ">>>>>> not enough candidates"
	return
endif

set $base_chance 0
actor_worninslot $system.player 32
if $$ == false
	msg_console ">>>>>> no body slot worn"
	inc $base_chance 2
endif
actor_wornhaskeyword $system.player "zad_Lockable"
if $$ == true
	msg_console ">>>>>> zad_Lockable worn"
	inc $base_chance 1
endif
actor_wornhaskeyword $system.player "zad_DeviousHeavyBondage"
if $$ == true
	msg_console ">>>>>> zad_DeviousHeavyBondage worn"
	inc $base_chance 2
endif
actor_wornhaskeyword $system.player "zad_DeviousCollar"
if $$ == true
	msg_console ">>>>>> zad_DeviousCollar worn"
	inc $base_chance 1
endif

set $num_participants 0 ; tracks the number of participants excluding the player
set $index 0
; pre-emptively add the player in the first slot
listadd $participants $system.player
while $index < $num_candidates
	; do not check the player
	if $system.player != $candidates[$index]
		; only process them if they are valid SL actors
		set $name resultfrom actor_name $candidates[$index]
		msg_console $">>>>>> checking candidate {$name}"
		sl_is_valid_actor $candidates[$index]
		if $$ == true
			msg_console $">>>>>> candidate {$name} is sl valid"
			; do your calculations now for each candidate
			set $participant_chance $base_chance
			set $arousal resultfrom $sla_get_arousal $candidates[$index]
			msg_console $">>>>>> candidate {$name} has arousal {$arousal}"
			; has to be aroused enough to consider
			if $arousal >= 75
				; but higher arousal increases the chance of being added
				if $arousal < 80
					inc $participant_chance 1
				elseif $arousal < 90
					inc $participant_chance 3
				elseif $arousal < 100
					inc $participant_chance 6
				elseif $arousal > 99
					inc $participant_chance 10
				endif
			endif
			msg_console $">>>>>> candidate {$name} has participant chance {$participant_chance}"
			if $participant_chance >= 10
				msg_console $">>>>>> candidate {$name} added to participant list"
				inc $num_participants
				listadd $participants $candidates[$index]
			else
				rnd_int $participant_chance 10
				if $$ == 10
					msg_console $">>>>>> candidate {$name} added to list due to chance"
					inc $num_participants
					listadd $participants $candidates[$index]
				else
					msg_console $">>>>>> candidate {$name} NOT added to list due to chance"
				endif
			endif
		else
			msg_console $">>>>>> candidate {$name} is NOT sl valid"
		endif
	else
		msg_console $">>>>>> candidate {$name} is the player; skipping"
	endif
	if $num_participants >= 4
		msg_console $">>>>>> found 4 participants, starting the party early"
		; AFAIK, you can have no more than 5 in a SL scene, so num_participants + 1 for the player and we're all filled up
		goto [found_4_participants]
	endif
	inc $index
endwhile
[found_4_participants]
if $num_participants > 0
	msg_console $">>>>>> found {$num_participants} participants excluding player, starting scene"
	sl_startsex $participants $system.player "" 0
else
	msg_console $">>>>>> not enough participants: {$num_participants}"
endif

 

 

Some notes:

- The thing most likely to be modified from one person to the next will be the logic involving the arousal checks. Depending on what criteria you want to use, you'll have to change that up.

- Also, if you just want to limit this to NFF followers, obviously you would swap the 'nff_getfollowers' call in place of 'util_scan_cell_npcs'

- If you make afRadius larger, it will necessarily slow down the call because you will possibly be looping over more actors

- I would love to know if/how this works for you (or anyone who tries it)

- If it works well enough, I think it would be a nice post to add to the club/files/templates

Posted
2 hours ago, hextun said:

You aren't the first one to want to create a matchmaker style script and so far I haven't been able to help folks much mostly because I hadn't thought of a reasonably fast method to approach it. But let's take a crack at it. (pinging @Fraying9981 because, IIRC, they also wanted to set up a matchmaker).

 

 

thanks for the ping!

 

2 hours ago, hextun said:

Here's my version. I did a test inside an inn using the Nefaram modlist by putting it into a script and running it manually via console command, but the result should be the same even if using a timer trigger.

 

 

very interesting. lots of stuff here.

do you think you can do the matching based on factions? or having a certain item in the inventory?

 

I really enjoy your mod. I've been trying so many things that failed but I'm finally getting a decent idea of what is realistic and what isn't.
So wondering if I can create a simple case for example for DOM slaves triggering scenes, a bit like SL nights, but any time.

Posted (edited)
3 hours ago, hextun said:

(snip)

Wow. Amazing reply.

So you can spread it out but the end result is probably the same as its still in total a single thread.

 

For my script i was thinking i would split it into 3 parts each being managed by sltriggers as to when to trigger them. And yes i was aware that they might run with incomplete lists.

 

If not using NFF followers, the first script would be a "setup" script that would be manually ran via hotkey or something to build your follower list.

 

Second script would occasionally run to check your followers for arrousal to add them to a possible participation list (if you have only a couple followers this isn't really needed but if you have a lot you might want to creat ethe list ahead of time

Third script would run when in certain locations (i intended this to be ran in safe areas like inns, cities, player homes, etc) using the prepared list form the second script. Find eligable actors and then clear the prepared list. Originally i was thinking of just removing actors who participated but i didn't see a (quick and easy) way to "fix" the list once removing one, aka, if i remove $Potentialactor[2] and there is a [3] and [4] they wont just shuffle down a place wtihout a loop basically rebuilding the list.

 

In the end it was more. if you have only a couple followers and using NFF, 1 script isn't too long and everything can be done in basically 1 loop without too much speed loss.

more followers with NFF and i was thinking you might want to pre check as sexlab has the 5 actor limit and you can have upto 10 nff followers to search through potentially.

 

without NFF is where the slow down happens due to scanning an area around the player for any actor. As mentioned previously you could easily add a keyword to all potential followers since they all share the same factions using SPID or something similar and then scan just for those keywords which should drastically reduce the amount of npcs than the scan will pick up.

 

Will definitely try your version of the script to see how it runs.

 

3 hours ago, hextun said:

 

I had started writing a response to this, and then realized I was missing some things and not addressing what I felt needed to be addressed.

So, first things first:

  •   util_scan_cell_npcs is almost always going to be slower than nff_getfollowers.
  •   if you use the afRadius parameter on util_scan_cell_npcs and limit it to npcs within a fairly limited range, you'll get consistently improved results
  •   looping is slow, I'm sorry
  •   goto is pretty fast
  •   if/else is actually not too bad
  •   if you are willing to compromise on a few things, there are some kinda neat things you can do with goto

 

 

 

for the goto stuff. I assume it would be like using it as a loop? for example.

(stuff to make actor list "$Actorlist")
set $Actorcount resultfrom listcount $Actorlist

set $loop 0
goto loop

[loop]
if $loop > $Actorlist stoploop
(loop stuff)
inc $loop 1
goto loop

[stoploop]

 

Thanks again for the reply. Every time you do a larger reply like this it is very helpful.

 

Also because i stumbled on this mod it helped me build up some experience to try and modify other mods scripts and i was able to successfully modify one the way i wanted. Being able to do that has also made me think of at some point making my own mod once ive tinkered with the sltriggers some more. so thanks a bunch for reviving sltriggers with this redux mod. Ive always been able to logically put together something i want to do in code but it was always the specific details i would have issues with, mostly finding the right tool (functions) for the job. Stumbling my way through until it works xD

 

Edited by thorax339
Posted (edited)

On testing your script i noticed the scan npcs also looks at currently deactivated npcs. (noticed because of the console messages) considering theres an option for "dead" actors, not sure if its something you can modify but perhaps an option for only enabled npcs to be checked as well?

 

also ye. scanning every npc even with the 1000 units range is definitely way too slow to be viable. I think pre building the list "manually" via a hotkey activated script in a small cell just with all your followers is probably the best way to speed up the actual condition checking and matchmaking part of the scripts.

 

 

in terms of this part:

; pre-emptively add the player in the first slot
listadd $participants $system.player

 

not sure if it ends up quicker. but to save on checking if its the player every loop, In my script i instead start a new list with the player in [0] and then basically merge the 2 lists.

 

My way does add another small loop before the sex scenes start tho but that is more because of Sexlab P+ saying the best practice is to check if actors are valid first so i thought i would do that here. Basically narrow down the list as the script goes through instead of front loading it with too many checks on every actor from the npc scan when 1 or 2 checks already filters out most npcs

Edited by thorax339
Posted

I'm considering dropping the water/swimming related trigger. It's fairly intensive for what it does, and although I've only seen one (maybe two) mentions of crashes where folks believed it was at fault, I haven't gotten the impression folks are using it much.

 

Any comments?

Posted (edited)

For the water triggers. Personally i dont use them (and dont plan to) but options are options especially if it doesn't cause any issue if they are not being used. Off the top of my head i thought of 2 possible uses for it, One where the player can automatically swap into a swimsuit when going in the water and reverting back to normal outfit when leaving. Another where its a type of swimming skill that slows the player down while swimming unless you spend a lot of time swimming to build up the skill and then you can swim faster. Maybe in the Wiki you could mention potential intensive / volatile events where you have the events explained.

 

Speaking of triggers tho. i was trying to find an event to try my matchmaker style script on. I wanted it to fire while in safe locations so i chose Timer Based with Location set to "safe"

While inside the Falkreath Inn, Dead Mans Drink, It was not going off even on a 1 minute timer. Tried setting the location to be "inn" and that didn't work either. Trying just "Top of the Hour" did work so i know it wasn't to do with the script itself. Script ofc works when using the Slt run console commands.

Also just double checked using SSEEdit, the location is still an Inn/Dwelling and nothing has overwritten it.
Setting location to "Any" also allowed the script to run so something might be going wrong with specifying locations

To test further i added a location tester in my script itself and was able to get it working that way so i have a workaround atleast. Technically the workaround works better as i can specify more potential locations than the trigger lets me choose.

Edited by thorax339
Posted

Hi. I read the function library on GitHub, specifically the NiOverride section, and I am wondering if I could use that to make a toggle script for SLTriggers for high heels height? Something similar to what SexLab does when you enable 'clear high heels height' but on hotkey. This could be used for screenarchery too, to disable HH when using pose mods. Any guidance would be appreciated as I'm a total stranger to how other mods work.

Posted
21 hours ago, LlenneiasWard said:

Hi. I read the function library on GitHub, specifically the NiOverride section, and I am wondering if I could use that to make a toggle script for SLTriggers for high heels height? Something similar to what SexLab does when you enable 'clear high heels height' but on hotkey. This could be used for screenarchery too, to disable HH when using pose mods. Any guidance would be appreciated as I'm a total stranger to how other mods work.

 

First of all, welcome! Always good to see new users!

 

Now, to the point... the short answer to your question is "I'm not sure but I don't think so". More specifically..

 

"I'm not sure...":

I am not knowledgeable about how exactly heel height gets adjusted based on what you wear. Looking at the code for the HeelsFix mod, I do see it using NIO but I also see mention of MuJointsFix. When I created the NIO bindings (i.e. the nio_* functions), I simply grabbed some that I thought seemed relevant and set up bindings, but being the lazy .. er, efficient sort, I didn't bind everything because I wasn't really sure what folks wanted. I *was* aware of how basic node changes affected things you could affect in Racemenu, which is why I selected the bindings I did.

 

Still, judging by the HeelsFix code, if I had to hazard a guess at what's going on, it (high heel adjustment code somewhere *not* in HeelsFix) is obtaining the root transform node and adjusting the position up or down to account for your heel height. Further hazarding of guesses leads me to believe the MuJointsFix is related in how the foot would then be adjusted (i.e. tilting it down when in heels so the ball of your foot is still touching ground).

 

"...but I don't think so.":

As I said, I did not bind everything. In particular, I added bindings for various node overrides but not for node transforms. Note that in HeelsFixRefreshEffect.psc (again, in the HeelsFix mod) that it is calling things like NiOverride.GetNodeTransformPosition() and then looking into the third element of the returned float array. I'm guessing that the X and Y coordinates (positions 0 and 1 of the array) are lateral directions (i.e. forward/backward and left/right) while the Z coordinate (position 2 of the array) references elevation. Thus, HeelsFix (and presumably any heel height adjustment related code) would be interested in NIO node transforms, and adjusting the third element of that list.

 

I have not created bindings for those functions. As a result, right now there is no way in an SLTScript to read or modify those values and thus no way to adjust heel height as you are looking to do. Of course if someone sees how to do so using SLTScript I would be more than happy to be proven wrong. :)

 

What now?

Well, now that I'm aware of a use case it greatly increases the odds that at some point I will get around to adding the bindings. However, I'm not sure of a timeline at this point. I have a release candidate (that I am still looking for help with translation for) but haven't got a timeline, especially not beyond that.

 

And unless you have other reasons to use SLTR, I can't offer you much beyond "keep checking back". When I upload new releases I tend to add a new post in this thread outlining what's included and would no doubt do so for this.

Posted
On 4/2/2026 at 2:03 PM, thorax339 said:

For the water triggers. Personally i dont use them (and dont plan to) but options are options especially if it doesn't cause any issue if they are not being used. Off the top of my head i thought of 2 possible uses for it, One where the player can automatically swap into a swimsuit when going in the water and reverting back to normal outfit when leaving. Another where its a type of swimming skill that slows the player down while swimming unless you spend a lot of time swimming to build up the skill and then you can swim faster. Maybe in the Wiki you could mention potential intensive / volatile events where you have the events explained.

 

Speaking of triggers tho. i was trying to find an event to try my matchmaker style script on. I wanted it to fire while in safe locations so i chose Timer Based with Location set to "safe"

While inside the Falkreath Inn, Dead Mans Drink, It was not going off even on a 1 minute timer. Tried setting the location to be "inn" and that didn't work either. Trying just "Top of the Hour" did work so i know it wasn't to do with the script itself. Script ofc works when using the Slt run console commands.

Also just double checked using SSEEdit, the location is still an Inn/Dwelling and nothing has overwritten it.
Setting location to "Any" also allowed the script to run so something might be going wrong with specifying locations

To test further i added a location tester in my script itself and was able to get it working that way so i have a workaround atleast. Technically the workaround works better as i can specify more potential locations than the trigger lets me choose.

 

Hmm... I'll have to check the location logic. If that's off, it would impact a number of triggers.

Posted
1 hour ago, Fraying9981 said:

hey @hextun how do you detect whether a scene is consensual or non consensual?

do you simply check tags?

 

For SexLab:

- sslThreadController has .IsAggressive(Actor) and .isVictim(Actor)

- when checking if the Actor's role (i.e. "Role") is aggressive or the victim, I call the function directly on the actor being considered (e.g. the actor who climaxed for the "Separate Orgasm" trigger)

- when checking the "Partner Role", I loop through the other actors and count how many aggressive or victim responses are true; then, based on which relationship you are checking for (e.g. "Partner Role: Aggressive"), if that count is non-zero there were one or more partners with that role and the test passes

 

For OStim:

- OMetadata has .HasActorTag() which can be checked for the "dominant" tag

- I loop and count how many have the "dominant" tag; if no one does, the scene has no dominance, so tests for either "Aggressive" as well as "Victim" result in failures (no one is either)

- then for the "Partner Role" I do more or less the same as with SexLab, albeit with the dominance check as well

Posted
3 hours ago, hextun said:

 

For SexLab:

- sslThreadController has .IsAggressive(Actor) and .isVictim(Actor)

- when checking if the Actor's role (i.e. "Role") is aggressive or the victim, I call the function directly on the actor being considered (e.g. the actor who climaxed for the "Separate Orgasm" trigger)

- when checking the "Partner Role", I loop through the other actors and count how many aggressive or victim responses are true; then, based on which relationship you are checking for (e.g. "Partner Role: Aggressive"), if that count is non-zero there were one or more partners with that role and the test passes

 

For OStim:

- OMetadata has .HasActorTag() which can be checked for the "dominant" tag

- I loop and count how many have the "dominant" tag; if no one does, the scene has no dominance, so tests for either "Aggressive" as well as "Victim" result in failures (no one is either)

- then for the "Partner Role" I do more or less the same as with SexLab, albeit with the dominance check as well

 

thanks! also whats the cleanest way of implementing a while loop?

 

fro example while stamina >0

Posted
1 hour ago, Fraying9981 said:

 

thanks! also whats the cleanest way of implementing a while loop?

 

fro example while stamina >0

 

I'm not sure I follow, but:

; 1) optional: code that sets an initial value for $stamina
while $stamina > 0
	; 2) presumably code that you want performed while $stamina is > 0
    
	; 3) presumably code that modifies $stamina toward fulfilling being <= 0
endwhile

 

Using specifically the example of "while $stamina > 0":

1) I say this is optional but if you don't have $stamina set at this point, it will evaluate to 0 and the loop will never run. The reason I say it is optional is because if you are using non local-scoped variables, the value may have been set outside the scope of the current script execution, in which case the while condition might still evaluate to true and allow at least one loop pass. Otherwise, if using a locally scoped variable, you would presumably be sure to initialize it.

 

2) I say this is "presumable" because without it, you're just looping, which is just using the SLTscript to sit in the loop until the while condition fails. You would be better off using a util_wait or something at that point. I don't want to say "there must be code in the loop" but I'm hard pressed to imagine many (any?) useful scenarios where you wouldn't.

 

3) I say this is "presumable" because, in most cases, you again are not counting on another script modifying the variable. If you do not do something at this point to move the while condition to failure, you will have an endless loop. Again, if using non local-scoped variables, you might be counting on that loop going on permanently until an external script updates it, but again, that is probably rare. 

 

So yeah, generally it will go "initialize while condition variable -> start while loop -> do while loop things -> push condition variable toward failure -> endwhile".

 

Now... you say "cleanest"... so I feel like my explanation is not targeting the right question, but hey, I got to type stuff. So, am I answering the question you were asking? :)

 

Posted
1 hour ago, hextun said:

 

I'm not sure I follow, but:

; 1) optional: code that sets an initial value for $stamina
while $stamina > 0
	; 2) presumably code that you want performed while $stamina is > 0
    
	; 3) presumably code that modifies $stamina toward fulfilling being <= 0
endwhile

 

Using specifically the example of "while $stamina > 0":

1) I say this is optional but if you don't have $stamina set at this point, it will evaluate to 0 and the loop will never run. The reason I say it is optional is because if you are using non local-scoped variables, the value may have been set outside the scope of the current script execution, in which case the while condition might still evaluate to true and allow at least one loop pass. Otherwise, if using a locally scoped variable, you would presumably be sure to initialize it.

 

2) I say this is "presumable" because without it, you're just looping, which is just using the SLTscript to sit in the loop until the while condition fails. You would be better off using a util_wait or something at that point. I don't want to say "there must be code in the loop" but I'm hard pressed to imagine many (any?) useful scenarios where you wouldn't.

 

3) I say this is "presumable" because, in most cases, you again are not counting on another script modifying the variable. If you do not do something at this point to move the while condition to failure, you will have an endless loop. Again, if using non local-scoped variables, you might be counting on that loop going on permanently until an external script updates it, but again, that is probably rare. 

 

So yeah, generally it will go "initialize while condition variable -> start while loop -> do while loop things -> push condition variable toward failure -> endwhile".

 

Now... you say "cleanest"... so I feel like my explanation is not targeting the right question, but hey, I got to type stuff. So, am I answering the question you were asking? :)

 

 

yes it does! thanks

Posted (edited)

Edit: Disregard the below, please see my post after this.

 

Hello, I have been trying to make a script that increases the player's arousal by an amount if the player does not have OCum Ascended's Cum Spell active (basically if the player doesn't have cum applied). While it seems to work when the player does not have cum applied, it also applies if the player *does* have it applied. Also, the script seemed to work when the increase was set to a flat value but not when set to half of current arousal. Can you (@Hextun) please see the errors in my script? Thanks!

 

Note: I added both sla_send_exposure_event and osla_modify_arousal because just having osla_modify_arousal seems to give a boost that quickly drops back to baseline. I haven't studied exactly what I need to do here, but right now I am just focusing on getting the conditional "is cum applied? yes/no" working correctly. The full formID with mod index included is FE18DF15. I'm not familiar with getting the correct formID so it may or may not be correctly entered here.

 

Edit: The key issue seems that I am unable to detect if the player has the Cum Spell. It's always false for some reason.

 

set $sltrModIndex resultfrom game_dofunction GetModByName "OCum.esp"
if $sltrModIndex != 255
	set $cumSpellForm resultfrom game_dofunction GetFormFromFile 0x00000F15 "OCum.esp" 
	set $isCummedOn resultfrom actor_dofunction $system.player HasSpell $cumSpellForm
	if !$isCummedOn ; This always seems to be true
		set $actorArousal osla_get_arousal $system.player
		set $arousalIncrease $actorArousal * 0.5 ; Arousal is never increased if I attempt to use multiplication. Arousal seems to only work if the value is a flat number, not something multiplied
		set $newArousal $actorArousal + $arousalIncrease
		if $newArousal > 100.0
			set $newArousal 100.0
		endif
		sla_send_exposure_event $system.player $arousalIncrease 
		osla_modify_arousal $system.player $newArousal "SLTrigger Arousal Increase"		
		msg_notify $"Your need for cum grows..."  

	endif
endif

 

Edited by just let me download
Posted (edited)

Edit: I think I solved my issue. I'm leaving this here to someone else can learn from my learning. Solution at bottom.

I made some progress, I was able to get the script to correctly detect the spell, but now it still executes the conditional statement's contents even if it is true:

 

set $sltrModIndex resultfrom game_dofunction GetModByName "OCum.esp"
if $sltrModIndex != 255
	set $isCummedOn resultfrom actor_isaffectedby $system.player "OCum.esp:0xF15"
	msg_notify $isCummedOn
	if !$isCummedOn ;It doesn't seem to matter if !$isCummedOn or $isCummedOn, both still evaluate to true for some reason.
		set $actorArousal osla_get_arousal $system.player
		set $arousalIncrease -1
		set $newArousal $actorArousal + $arousalIncrease
		if $newArousal > 100.0
			set $newArousal 100.0
		endif
		sla_send_exposure_event $system.player $arousalIncrease 
		osla_modify_arousal $system.player $newArousal "SLTrigger Arousal Increase"		
		msg_notify $"Your need for cum grows..."  
	endif
endif


Another edit:

Seems like I have to do this instead of !$isCummedOn:

if $isCummedOn != true

 

However, the previous problem still stands, the increase can only be a flat number, it can't be a result of a multiplication (ie: 50% of current arousal) or division:

 

set $sltrModIndex resultfrom game_dofunction GetModByName "OCum.esp"
if $sltrModIndex != 255
	set $isCummedOn resultfrom actor_isaffectedby $system.player "OCum.esp:0xF15"
	msg_notify $isCummedOn
	if $isCummedOn != true
		set $actorArousal osla_get_arousal $system.player
		set $arousalIncrease $actorArousal * 0.5 ; This will not increase arousal
		set $newArousal $actorArousal + $arousalIncrease
		if $newArousal > 100.0
			set $newArousal 100.0
		endif
		sla_send_exposure_event $system.player $arousalIncrease 
		osla_modify_arousal $system.player $newArousal "SLTrigger Arousal Increase"		
		msg_notify $"Your need for cum grows..."  
	endif
endif

 

But wait, there's more! It seems that running the script through console works but not as a hotkey, but now the increase seems unpredictibly large. For example, arousal went from 8 -> 32, 33 --> 88. Even if I set $arousalIncrease to a flat 15, executing the script once went from 55 arousal to 98 arousal.

 

set $sltrModIndex resultfrom game_dofunction GetModByName "OCum.esp"
if $sltrModIndex != 255
	set $isCummedOn resultfrom actor_isaffectedby $system.player "OCum.esp:0xF15"
	msg_notify $isCummedOn
	if $isCummedOn != true
		set $actorArousal resultfrom osla_get_arousal $system.player
		set $arousalIncrease $actorArousal * 0.5 ;The current arousal is to be increased by 50% of the current arousal
		;msg_notify $actorArousal
		msg_notify $arousalIncrease
		set $newArousal $actorArousal + $arousalIncrease
		osla_modify_arousal $system.player $newArousal "SLTrigger Arousal Increase"		
		msg_notify $"Your need for cum grows..."  
	endif
endif


Edit: It seems my issue was that I was using osla_modify_arousal when I thought I was using osla_set_arousal. Setting $arousalIncrease to just the amount I want it to increase it by was sufficient, the problem was adding that to the current arousal.

Edited by just let me download
Posted
6 hours ago, just let me download said:

Edit: I think I solved my issue. I'm leaving this here to someone else can learn from my learning. Solution at bottom.

I made some progress, I was able to get the script to correctly detect the spell, but now it still executes the conditional statement's contents even if it is true:

 

set $sltrModIndex resultfrom game_dofunction GetModByName "OCum.esp"
if $sltrModIndex != 255
	set $isCummedOn resultfrom actor_isaffectedby $system.player "OCum.esp:0xF15"
	msg_notify $isCummedOn
	if !$isCummedOn ;It doesn't seem to matter if !$isCummedOn or $isCummedOn, both still evaluate to true for some reason.
		set $actorArousal osla_get_arousal $system.player
		set $arousalIncrease -1
		set $newArousal $actorArousal + $arousalIncrease
		if $newArousal > 100.0
			set $newArousal 100.0
		endif
		sla_send_exposure_event $system.player $arousalIncrease 
		osla_modify_arousal $system.player $newArousal "SLTrigger Arousal Increase"		
		msg_notify $"Your need for cum grows..."  
	endif
endif


Another edit:

Seems like I have to do this instead of !$isCummedOn:

if $isCummedOn != true

 

However, the previous problem still stands, the increase can only be a flat number, it can't be a result of a multiplication (ie: 50% of current arousal) or division:

 

set $sltrModIndex resultfrom game_dofunction GetModByName "OCum.esp"
if $sltrModIndex != 255
	set $isCummedOn resultfrom actor_isaffectedby $system.player "OCum.esp:0xF15"
	msg_notify $isCummedOn
	if $isCummedOn != true
		set $actorArousal osla_get_arousal $system.player
		set $arousalIncrease $actorArousal * 0.5 ; This will not increase arousal
		set $newArousal $actorArousal + $arousalIncrease
		if $newArousal > 100.0
			set $newArousal 100.0
		endif
		sla_send_exposure_event $system.player $arousalIncrease 
		osla_modify_arousal $system.player $newArousal "SLTrigger Arousal Increase"		
		msg_notify $"Your need for cum grows..."  
	endif
endif

 

But wait, there's more! It seems that running the script through console works but not as a hotkey, but now the increase seems unpredictibly large. For example, arousal went from 8 -> 32, 33 --> 88. Even if I set $arousalIncrease to a flat 15, executing the script once went from 55 arousal to 98 arousal.

 

set $sltrModIndex resultfrom game_dofunction GetModByName "OCum.esp"
if $sltrModIndex != 255
	set $isCummedOn resultfrom actor_isaffectedby $system.player "OCum.esp:0xF15"
	msg_notify $isCummedOn
	if $isCummedOn != true
		set $actorArousal resultfrom osla_get_arousal $system.player
		set $arousalIncrease $actorArousal * 0.5 ;The current arousal is to be increased by 50% of the current arousal
		;msg_notify $actorArousal
		msg_notify $arousalIncrease
		set $newArousal $actorArousal + $arousalIncrease
		osla_modify_arousal $system.player $newArousal "SLTrigger Arousal Increase"		
		msg_notify $"Your need for cum grows..."  
	endif
endif


Edit: It seems my issue was that I was using osla_modify_arousal when I thought I was using osla_set_arousal. Setting $arousalIncrease to just the amount I want it to increase it by was sufficient, the problem was adding that to the current arousal.

 

I just want to say thank you for following up and posting your debug journey. I think that's incredibly helpful for others as it lets them have a peek into what can go wrong and how to make it right. :)

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   1 member

×
×
  • Create New...