hextun Posted July 24, 2025 Author Posted July 24, 2025 11 hours ago, MannySauce said: If you were to trigger the same script through the same means a second or more times before the previous instance finishes, does that run a new separate instance or reset the existing one? And target scope vars - do they persist after creation like global scope vars, just being limited to the target? Each script request stands alone; you would get additional instances of the same script. There is not (currently) a notion of prohibiting concurrency. If you want to prevent it, you could try adding an executing flag global (or target context, whichever makes sense) so that at the beginning of the script, if it detects the flag is set, it just returns but otherwise it sets the flag and then unsets it before exiting. Rudimentary mutexes if you will. Still not guaranteed to work but it's about as close as I think you'll get under the current circumstances. Target scope vars are like global vars but tied to a specific Actor/target; they persist across script executions (i.e. are always available) and are shared by any script running on that Actor/target (i.e. the same variable has potentially different values depending on which Actor the script targeted). I use StorageUtil for target scoped variables. Globals, Locals, and Thread scoped variables are all just stored directly on game objects.
Anunya Posted July 24, 2025 Posted July 24, 2025 @hextun - thank you for the in depth and informative answer. Everything you say there makes sense and is reasonable. I'd love to really engage with SLTR and write proper mods with it, but I'm pretty sure my ambition exceeds my skills by an order of magnitude at least (and not just with SLTR) 😆😢 In the meantime I'm trying to ascertain what's actually within reach for me with what you're providing (which is amazing and appreciated). Please don't take any of my questions as a backhanded way to ask you to do any work - you have your own plans and roadmap (or not) and that's how it should be. I'm happy to use SLTR within my capabilities (and within the capabilities of other people who use it for their own projects and share them). That's already a great and appreciated contribution to Skyrim modding.
hextun Posted July 24, 2025 Author Posted July 24, 2025 1 hour ago, Anunya said: @hextun - thank you for the in depth and informative answer. Everything you say there makes sense and is reasonable. I'd love to really engage with SLTR and write proper mods with it, but I'm pretty sure my ambition exceeds my skills by an order of magnitude at least (and not just with SLTR) 😆😢 In the meantime I'm trying to ascertain what's actually within reach for me with what you're providing (which is amazing and appreciated). Please don't take any of my questions as a backhanded way to ask you to do any work - you have your own plans and roadmap (or not) and that's how it should be. I'm happy to use SLTR within my capabilities (and within the capabilities of other people who use it for their own projects and share them). That's already a great and appreciated contribution to Skyrim modding. No worries and as far as I'm concerned you've been a total gentleperson from the get-go; I don't feel pressured nor do I feel that you've inappropriately requested or insisted upon anything. Safe to say, I have some ego invested in this and I appreciate that folks express interest and suggest new features. It shows investiture beyond my own, which is always encouraging. Suffice to say I want to make something that people want to use, so by all means, keep the ideas coming. They are very much welcome. 1
MannySauce Posted July 25, 2025 Posted July 25, 2025 sl-triggers.log says "[5]: 'endif' encountered outside of if-block; ignoring" when doing: if $var1 if $var2 function endif endif It does still work, but I'm just wondering if I'm doing something wrong, like line 5 being superfluous?
hextun Posted July 25, 2025 Author Posted July 25, 2025 8 hours ago, MannySauce said: sl-triggers.log says "[5]: 'endif' encountered outside of if-block; ignoring" when doing: if $var1 if $var2 function endif endif It does still work, but I'm just wondering if I'm doing something wrong, like line 5 being superfluous? No, that message shouldn't come up for that syntax; I'll have a look. Thanks.
alain31 Posted July 25, 2025 Posted July 25, 2025 Hi, I've noticed a performance issue in populated areas in sl_triggers126. I'm not 100 percent sure it's due to this mod, but when i remove it from the load order, the problem disappears. It's the same problem as with version 125, which caused a lot of stuttering during combat (it took me one day to figure out it was due to this mod ). I'm now on version 126 and have no problems during combat, but as mentioned above, i have this problem when there are a lot of NPCs. Is there a way to make the script work only for PC? The only feature i'm interested in is a Player script. Is there a log i can send you to understand the performance issue? Thanks.
Nevropath Posted July 25, 2025 Posted July 25, 2025 Hi @hextun Here is the files : - the .psc source with some NiOverride commands (RaceMenu is a prerequisite) - an ini as example which add a progressive blush to a female during a SL scene (config trigger to use it on a female humanoid at start) - the textures set to go with the ini example sl_triggersCmdLibSLT with NiOverride.zip Apply Blush.zip Alpia Makeup.zip 1
hextun Posted July 25, 2025 Author Posted July 25, 2025 3 hours ago, alain31 said: Hi, I've noticed a performance issue in populated areas in sl_triggers126. I'm not 100 percent sure it's due to this mod, but when i remove it from the load order, the problem disappears. It's the same problem as with version 125, which caused a lot of stuttering during combat (it took me one day to figure out it was due to this mod ). I'm now on version 126 and have no problems during combat, but as mentioned above, i have this problem when there are a lot of NPCs. Is there a way to make the script work only for PC? The only feature i'm interested in is a Player script. Is there a log i can send you to understand the performance issue? Thanks. I need to remove the download for 126. 127 removed the code and esp object that are causing the performance issue. please update, preferably to 128
Guest Posted July 26, 2025 Posted July 26, 2025 Has anyone been able to convert the creature vials script for this new version of Sl Triggers?
MannySauce Posted July 26, 2025 Posted July 26, 2025 "Not Player" option for trigger actor broke in v128. 🥺
myhouseatl Posted July 26, 2025 Posted July 26, 2025 Can this be set up to start an OStim scene? If not, can you adopt OStim Standalone please?
hextun Posted July 26, 2025 Author Posted July 26, 2025 1 hour ago, MannySauce said: "Not Player" option for trigger actor broke in v128. 🥺 Checking into it now.
hextun Posted July 26, 2025 Author Posted July 26, 2025 35 minutes ago, myhouseatl said: Can this be set up to start an OStim scene? If not, can you adopt OStim Standalone please? I haven't created an OStim extension similar to SexLab but it is on my todo list.
hextun Posted July 26, 2025 Author Posted July 26, 2025 4 hours ago, Padawanda21 said: Has anyone been able to convert the creature vials script for this new version of Sl Triggers? What is the "creature vials" script? Can you link to it? Conversion is typically pretty simple. (another page I should create)
hextun Posted July 26, 2025 Author Posted July 26, 2025 5 hours ago, MannySauce said: "Not Player" option for trigger actor broke in v128. 🥺 Found the problem; I was attempting to optimize the loop that occurs inside the SL event handler and removed a single line of code that reset a truth checker variable to true. Having done so, subsequent loops fail because it's still flagged false (assuming it failed on the first pass). Fix ASAP.
hextun Posted July 26, 2025 Author Posted July 26, 2025 v129 out. I pulled all older versions (but release zips are still available on github; although I pulled them because of bugs, so.. y'know) Here's the changelog: Savegame compatibility: CLEAN SAVE REQUIRED (New game or (not supported) Uninstalling SLTR, Cleaning your save (e.g. Load, click through the warning, Save; use a cleaner), Reinstall SLTR and reapply your customizations, Load) Note: Reminder that logging output is all sent to <My Documents>\My Games\Skyrim Special Edition\SKSE\sl-triggers.log (or whichever folder you have your SKSE logs directed to) bugfix: Timer: timer progress now persists across saves (i.e. if you save 59 minutes into a 60 minute timer and reload that save, you only have 1 minute remaining before it runs) - or as I like to call it, the "Why Didn't You Do This In The First Place" patch bugfix: CumControl.sltscript was still partially built for running during a scene bugfix: nested if/if/endif/endif constructs were erroneously reporting imbalanced endif bugfix: 'Contamination - MME_Lactacid.sltscript' was not using editorid correctly bugfix: SexLab event handler not resetting doRun flag back to true during each actor loop iteration, causing some triggers to fail to run enhancement: Added NiOverride/Racemenu functions: - getoverlay_slot - param_overlay - changeoverlay_transparency - remove_overlay - apply_overlay @MannySauce: your reported bugs (if/if/endif/endif ; "Not Player") should be fixed 1
hextun Posted July 26, 2025 Author Posted July 26, 2025 Also, big thanks to @Nevropath for donating the NiOverride code for the functions: - getoverlay_slot - param_overlay - changeoverlay_transparency - remove_overlay - apply_overlay I've merged the update into the Core library, and will assume responsibility for issues and problems of course. Thanks again! 1
Guest Posted July 27, 2025 Posted July 27, 2025 There's a humanvials and creaturevials script included in this mod (for se version), it adds a specific type of vial per npc based on a sizeable set of conditions in the scripts so unlike the simpler scripts i didn't really figure out how to start converting the conditions. If it would be too much of a hassle converting every condition it would already be a big help if i had an example a part of the condition sets being converted into working version so i could copy paster the other npc races in
hextun Posted July 27, 2025 Author Posted July 27, 2025 (edited) On 7/26/2025 at 10:12 PM, Padawanda21 said: There's a humanvials and creaturevials script included in this mod (for se version), it adds a specific type of vial per npc based on a sizeable set of conditions in the scripts so unlike the simpler scripts i didn't really figure out how to start converting the conditions. If it would be too much of a hassle converting every condition it would already be a big help if i had an example a part of the condition sets being converted into working version so i could copy paster the other npc races in I've made a quick conversion. Let me know if you run into any problems. I took the time to try converting the Give Vial 1.66 script as well. Edited February 5 by hextun fixed links
hextun Posted July 28, 2025 Author Posted July 28, 2025 v130 is posted. Save game compatible. One caveat: I renamed the SexLab version of 'util_waitforkbd' to 'sl_waitforkbd'. Scripts currently using 'util_waitforkbd' will no longer wake up at the end of a SexLab scene. No shipped scripts are affected, but you may want to check your own. You probably won't notice in many cases, such as when you are likely to have pressed one of the keys (and therefore not have the problem of running into the scene end before hitting a key). That said... *ahem*... you now have OStim support, along with a fresh batch of ostim_* functions. Lang support files (Notepad++, VSCode) have been updated with the new keywords. I also updated a lot of the function library examples to use correct special variable names i.e. $system.self instead of $self.
hextun Posted July 28, 2025 Author Posted July 28, 2025 Regarding OStim, I should point out that while the triggers are setup, all shipped scripts using sex themed functions are currently written against SexLab. Until I provide new versions that work for OStim, you will have to stick with scripts not using SexLab or write your own.
Nevropath Posted July 29, 2025 Posted July 29, 2025 @hextun Hello, Here is 2 files requested used to test the NiOverride function on player (and all male). Right I could not get it fired normally but the script works when I fire it by console commands Maybe I did something wrong in the trigger conf. Apply Blush Male.zip trigger002.zip
hextun Posted July 29, 2025 Author Posted July 29, 2025 Btw, to be clear, in v130 I explicitly changed the MCM to not display an extension if it's required mod is not installed (different from being installed but the extension disabled). So, pre-v130: - I have mod, extension is disabled; MCM displays the extension and lets you edit triggers - I do not have mod; MCM still displays the extension and lets you edit triggers which will never fire Post-v130: - I have mod, extension is disabled; MCM displays the extension and lets you edit triggers - I do not have mod; MCM will not display the extension If that's confusing, I can add a "Show Hidden Extensions" option on the main settings page.
hextun Posted July 29, 2025 Author Posted July 29, 2025 1 hour ago, Nevropath said: @hextun Hello, Here is 2 files requested used to test the NiOverride function on player (and all male). Right I could not get it fired normally but the script works when I fire it by console commands Maybe I did something wrong in the trigger conf. Apply Blush Male.zip 466 B · 1 download trigger002.zip 322 B · 1 download First, I was, unfortunately, not able to reproduce your problem. I used an existing modlist and save from v129, updated to v130 without attempting a new/clean save, added your script and trigger, and was able to see the changes applied during the scene (subtle, but there) as well as see log output when I had debug flags enabled. My suspicion: If you are using ModOrganizer2 for your modlist, you may have multiple copies of trigger002.json somewhere such that the copy you created for 'Apply Blush Male' is being hidden by another copy. If you are using MO2, check the 'Data' tab and look for 'trigger002.json'. If it appears like this, in red, indicating there are multiple copies and one is hiding another, that may be your culprit. That said, there's a minor issue with the trigger, but nothing that should have prevented it from working for you. If I understand correctly: - trigger: On SexLab Start - chance: 100% - Race: Humanoid - Gender: Male - Apply Blush Male.sltscript - apply the "blush_cheeks" overlay to the player with increasing strength during the scene, with various waits, then wait for the scene to end and start undoing the strength until you remove it and exit the script. So basically, any time, any where, that any male humanoid starts a SexLab scene, with or without the player (this is the issue), the script will run. If anything it appears to be too permissive; i.e. if NCPMale engages NPCFemale the script runs. Moreover, if you have a scene like MMF, you'll get two copies running simultaneously. I should add a "Partner Gender" filter. In the meantime, I recommend you change the trigger to: - trigger: On SexLab Start - chance: 100% - Player: Player Then use this slightly modified copy of your script. It adds a check for $system.partner1 being humanoid and male. If not, the script exits. This makes it so only one instance will ever be run. Spoiler ; this version of the script is meant to be run on the player: ; event: On SexLab Start ; chance: 100% ; player: Player msg_console "start male blushing" ; this checks the partner in the scene for being male (value 0) and humanoid (value 2) ; if none are found, exit the script set $partnerRace resultfrom actor_race $system.partner1 "SL" set $partnerGender resultfrom actor_getgender $system.partner1 if $partnerRace == 0 if $partnerGender == 2 goto [malePartnerFound] endif endif msg_console "Male humanoid partner not found, exiting" return [malePartnerFound] getoverlay_slot $system.player False Face set $1 $$ msg_console "1st available slot " $1 param_overlay $system.player False $1 "actors\\character\\slavetats\\DoMBlush\\blush_cheeks_1.dds" 0.2 apply_overlay $system.player actor_qnnu $system.player util_wait 20 param_overlay $system.player False $1 "actors\\character\\slavetats\\DoMBlush\\blush_cheeks_1.dds" 0.6 apply_overlay $system.player actor_qnnu $system.player util_wait 20 param_overlay $system.player False $1 "actors\\character\\slavetats\\DoMBlush\\blush_cheeks_1.dds" 1.0 apply_overlay $system.player actor_qnnu $system.player msg_console "blushing applied" util_waitforend $system.player param_overlay $system.player False $1 "actors\\character\\slavetats\\DoMBlush\\blush_cheeks_1.dds" 0.6 apply_overlay $system.player actor_qnnu $system.player util_wait 15 param_overlay $system.player False $1 "actors\\character\\slavetats\\DoMBlush\\blush_cheeks_1.dds" 0.2 apply_overlay $system.player actor_qnnu $system.player util_wait 15 remove_overlay $system.player False $1 apply_overlay $system.player actor_qnnu $system.player
MannySauce Posted July 30, 2025 Posted July 30, 2025 Some questions I've been sitting on: - How girthy can a script be? Is there a line count limit or recommended max? - Does subroutines have a limit on how many you can have in a single script? - If you use "return" inside a subroutine, does that exit the subroutine or the script?
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now