Home - lynnpye/sl_triggers GitHub Wiki
Welcome to the SLT wiki!
Some of what you will find here will still be of use on older versions, like many of the commands available.
SLT
SLT is "SL Triggers Redux", a renewal of development on the original SL Triggers by Fotogen.
SLT is, at its heart, a dispatcher, executing scripts against targeted actors on request. By itself it doesn't do much. When, however, you connect a script up to a trigger, like a mod event, you have the ability to automatically react to potentially anything in the game if there is a way to capture it as an event and alert SLT to run a script. Additionally, out of the box, SLT offers the ability to manually run scripts via the console if keymapping isn't sufficient.
These scripts are simple .ini files with an easy to understand syntax and a number of examples available to work from. Scripts are comprised of commands. Commands can be functions like "av_set" (to set an Actor Value) or built-in commands like "goto" (to script execution to a different line).
SLT comes with a base library of functions available for scripting that is growing. That said, it features an extension architecture through which mod authors can implement additional functions that would be available to other users of SLT that also install the extension. This allows the ability to expand the function library without needing it to be added to the core library.
You don't have to program the scripts to use them. A selection is available for you to work with from the get-go and you can also share scripts with other SLT users.
Requirements
- SLT itself (available here on github under Releases; also available as loverslab downloads in the support forum; look for the latest beta release)
- SKSE
- PapyrusUtil
- (optional) SkyUI for MCM settings. You can do it without it, but you really don't want to.
- (optional) SexLab Framework (if you want SexLab events and commands)
- (optional) SexLab P+ Framework (works with this version too)
- (optional) Devious Followers
- (optional) OSLAroused
- (optional) Devious Devices
- (optional) A ConsoleUtil variant (I recommend Console Util Extended) (if you want to execute Skyrim console commands in your scripts)
- (optional) MfgFix https://www.nexusmods.com/skyrimspecialedition/mods/11669 (if you want facial expression related commands in your scripts)
About Performance:
Effort has been made to avoid scripts from stressing the system more than necessary, but there are still limitations. Each script will be run on an Actor in game (the Player or an NPC). Any one Actor can have no more than 30 scripts running on them at one time. Scripts can be long-running if you make them so, so be careful not to let things run away.
Running Scripts Manually:
You can use the console to list available scripts and run them. From the console, use:
slt list
To list the available scripts. To run a given script, use:
slt run "scriptname"
The quotes are only necessary if the script name has spaces. So, to give yourself a free 10 septims, try:
slt run "Give Gold(10)"
Automating Things With Triggers:
The MCM lists "extensions" on the left and their associated triggers and settings on the right. Each "extension" represents a set of triggers/events that you can add to and configure to run SLT scripts in response.
When you add a trigger, it will show up with it's configurable options. Each option represents a check that will be made when the selected event fires. If all the checks pass, the Actor being verified will have the script run on them.
You can also "soft delete" a trigger, marking it inactive until either you restore it or go in and fully delete the trigger. Until restored it will remain inactive.
So take a SexLab event like an SLSO Orgasm (i.e. two actors having sex but only one of them orgasms). Here is how the condition checks would run. Note that this is specific to a SexLab event, which in context may have 1 or more actors involved. Other events (like hotkeys) do not logically have more than 1 actor involved.
- SexLab "On Separate Orgasm" event fires
- SexLab Extension (and any other listender) receives the event
- SLT then checks each of its triggers that match the "On Separate Orgasm" event
- For each trigger that matches
* For each actor in the scene
- Does the actor meet all of the conditions? If so, run the script
So even though actor 1 orgasmed, because of the nature of the event, all actors were checked for conditions and, based on those conditions, any of the actors might have had the script run on them. Or all of the actors. It depends on how you configure your trigger. For example if you set it for "Location = Outdoors" for a "On Separate Orgasm" event, both actors would be affected because both are outdoors at the time that either one of them had the separate orgasm.
The SexLab events, involving multiple actors, are a little more involved to setup, but all of the triggers should be easy to grasp after a bit.
What Is Different From the Original?
Fotogen's original sl_triggers effort is great and still works well. Plus I had already added some of these features (like the Keymapping and Top of the Hour event handling) to it.
- Extensible - It is very easy to expand functionality to add more operations to be available in your scripts with the new command libraries; Papyrus script developers can create their own .psc file with global functions to add new operations that will be available to any script run on the system
- New script format - The original format used JSON which is conveniently supported in the Skyrim environment but not convenient for development; the new .ini format is easier to read and works conveniently with syntax highlighting for some of the features
- More than SexLab - I know, SexLab is the SL in SLT; but the framework supports any event to fire a script
- ModEvent support for Script Execution - Mod authors can send mod events with a script name and SLT will run the script on the targeted Actor (or the Player if no target is available)
- API support - You can also access the same features through an API if you prefer
- Console command support - Some features available from the console
- Additional SLTScript language features: subroutines, script-to-script execution with call arguments, named variables