Jump to content

SL Triggers(v12) [2022-06-05]


Recommended Posts

Posted

is there anthing out there that does this but on start and end of dialogue. that allow commands based on the actors role, such as a trainer or shop.

 

also, for the "actor_wornhaskeyword" function. what parameter do i use to check everyone in the scene. and how does it work for tags handled by other mods. im trying to make a file that removes hobble dresses at animation start, but all those keywords are handled by DD and DCL.

  • 2 weeks later...
Posted

New stuff.

 

v08:
    Functions:
        - snd_play, snd_setvolume, snd_stop: for playing sound
        - console: (optional). If you have ConsoleUtilSSE installed (https://www.nexusmods.com/skyrimspecialedition/mods/24858), it executes console commands
        - mfg_*, facial expressions: (optional) If you have MfgFix (https://www.nexusmods.com/skyrimspecialedition/mods/11669), you can play with facial expressions
        
    Commands:
        - Heart beat(A).json: play "heart beat" sound
        - Sound - levelup.json: play "levelup" sound
        - Time Slow.json: slows global time by 50%. Resets time to normal at the end. Uses console command (must have ConsoleUtilSSE plugin)
        - MFG Reset.json: When sex ends, reset facial expression (must have MfgFix plugin installed)

Posted
On 8/15/2019 at 2:20 PM, Halstrom said:

Cool mod, very handy, it would be good if it tacked into Arousal events from SexLab Arousal Idles and other similar mods.

 

On 8/12/2019 at 9:06 AM, EJX said:

is there anthing out there that does this but on start and end of dialogue. that allow commands based on the actors role, such as a trainer or shop.

 

also, for the "actor_wornhaskeyword" function. what parameter do i use to check everyone in the scene. and how does it work for tags handled by other mods. im trying to make a file that removes hobble dresses at animation start, but all those keywords are handled by DD and DCL.

 

No go. An "event" must happen and it has to come from Sexlab framework. Its technical. Mod needs, i mean really needs, event from SL. Everything from start to finish is based on that.

 

Posted

New:

 

v09:
    Functions:
        - sl_animname: returns current SL animation name
        - util_waitforkbd: wait for user to press a specific key or SL animation ends
        - json_getvalue: read data from external json file
        - json_setvalue: write data to external file
        - json_save: while "save" is done automaticly when user makes skyrim save, this forces .json to be saved now
        
    Commands:
        - Time Control.json: You can control the game speed, and so animation speed with keyboard. (must have ConsoleUtilSSE plugin)
       

 

Posted

Good day!
I don’t know English, it’s Google translation.

 

1) Firstly, thanks for the wonderful mod. :) This is a discovery for me.
2) Can someone help if it is at all possible to implement?
3) Any ideas are welcome

 

How to make your sound play for each SLAL animation?
How to make different stages of animation play different sounds?

 

Well, or maybe where on the forum there is a solution. I could not find him.

Posted
On 8/27/2019 at 11:13 AM, Fotogen said:

        - console: (optional). If you have ConsoleUtilSSE installed (https://www.nexusmods.com/skyrimspecialedition/mods/24858), it executes console commands
        - util_waitforkbd: wait for user to press a specific key or SL animation ends

        - json_getvalue: read data from external json file
        - json_setvalue: write data to external file
        - json_save: while "save" is done automaticly when user makes skyrim save, this forces .json to be saved now

 

Are you saying we can make our own sex mini-games now?

Posted

Can we get a command for av_set?

 

Currently there's only av_mod, but that causes the increases to show up as modifiers (visible if you use a mod like Extended UI). Would be nice to have an av_set command so it's not a modifier.

Posted
On 9/5/2019 at 8:52 PM, nanashi50 said:

Can we get a command for av_set?

 

Currently there's only av_mod, but that causes the increases to show up as modifiers (visible if you use a mod like Extended UI). Would be nice to have an av_set command so it's not a modifier.

I went ahead and added it myself. I realized I needed av_getbase as well to increment. And then I also added av_incrementbase to save on code in the trigger command files.

 

I added these three commands and tested them. Hoping you can incorporate into v10.

  • av_set: SetActorValue
  • av_getbase: GetBaseActorValue
  • av_incrementbase: Modify using SetActorValue. Essentially does SetActorValue(GetBaseActorValue + parameter)

 

Added code for sl_triggersCmd.psc below:

State cmd_av_set ;av_set "$self", "actor_value", "value"
function oper(string[] param)
    Actor mate
    
    mate = resolveActor(param[1])
    mate.SetActorValue(resolve(param[2]), resolve(param[3]) as float)
endFunction
EndState 

State cmd_av_getbase ;av_getbase "$self", "actor_value"
function oper(string[] param)
    Actor mate
    float val
    
    mate = resolveActor(param[1])
    val = mate.GetBaseActorValue(resolve(param[2]))
    
    stack[0] = val as string
    ;MiscUtil.PrintConsole("Return: " + stack[0])
endFunction
EndState 

State cmd_av_incrementbase ;av_incrementbase "$self", "actor_value"
function oper(string[] param)
    Actor mate
    float newValue
    
    mate = resolveActor(param[1])
    newValue = mate.GetBaseActorValue(resolve(param[2])) + (resolve(param[3]) as float)
    mate.SetActorValue(resolve(param[2]), newValue as float)
endFunction
EndState 

 

Also here are two example trigger commands using av_set and av_getbase vs. just av_incrementbase. Second way has half the code.

 

Trigger command using: av_set + av_getbase

{
    "cmd" : 
    [
        ["rnd_int", "0", "1"],
		["set", "$1", "$$"],
		["av_getbase", "$self", "Health"],
		["set", "$4", "$1", "+", "$$"],
        ["av_set", "$self", "Health", "$4"],
		["rnd_int", "0", "1"],
		["set", "$2", "$$"],
		["av_getbase", "$self", "Stamina"],
		["set", "$5", "$2", "+", "$$"],
        ["av_set", "$self", "Stamina", "$5"],
		["rnd_int", "0", "1"],
		["set", "$3", "$$"],
		["av_getbase", "$self", "Magicka"],
		["set", "$6", "$3", "+", "$$"],
        ["av_set", "$self", "Magicka", "$6"],
		["msg_notify", "Attributes increased by ", "$1", " Health, ", "$2", " Stamina, ", "$3", " Magicka."]
    ]
}

 

Trigger command using: av_incrementbase

{
    "cmd" : 
    [
        ["rnd_int", "0", "1"],
		["set", "$1", "$$"],
        ["av_incrementbase", "$self", "Health", "$1"],
        ["rnd_int", "0", "1"],
		["set", "$2", "$$"],
        ["av_incrementbase", "$self", "Stamina", "$2"],
        ["rnd_int", "0", "3"],
		["set", "$3", "$$"],
        ["av_incrementbase", "$self", "Magicka", "$3"],
		["msg_notify", "Attributes increased by ", "$1", " Health, ", "$2", " Stamina, ", "$3", " Magicka."]
    ]
}

 

Posted

I also added a command for AdvanceSkill.

State cmd_player_advskill ;player_advskill "$self", "skill name", "count"
function oper(string[] param)
    Actor mate
    string skillName
    string ss
    int    p1
    
    mate = resolveActor(param[1])
    skillName = resolve(param[2])
    ss = resolve(param[3])
    p1 = ss as int

    Game.AdvanceSkill(skillName, p1)

endFunction
EndState 

 

I attached the psc file for reference. I added 4 commands:

  • av_set ($self, AV, value): SetActorValue
  • av_getbase ($self, AV): GetBaseActorValue
  • av_incrementbase ($self, AV, value): Modify using SetActorValue. Essentially does SetActorValue(GetBaseActorValue + value)
  • player_advskill ($player, skillname, points): Same as console command player.advskill

sl_triggersCmd.psc

Posted

@Fotogen I added new commands myself in my last post above, but next one is a request.

 

Can you add in additional conditions for sextype? Such as "vaginal +anal" and "vaginal + anal + oral". That one is necessary for handling more than 2 actor scenes.

 

I'm trying to set triggers for each non-player actor in a scene with intercourse. I tried setting three triggers (one for each sextype condition), but I noticed a problem where each actor was setting off multiple triggers in some large actor count animations.

 

I'm guessing this happens because those animations have multiple sextype tags causing each actor ended up triggering the separate conditions. I think a combined condition is necessary to address this issue.

 

Edit: I realized using a trigger for non-player actor race wasn't smart since that would cause it to trigger on animations the player character wasn't part of either...

 

Is there a way to get the other actors in a scene?

 

---------------------

 

Edit: Also a question on the commands 1, 2, 3.

 

If multiple commands are set for a trigger, are they all supposed to trigger or is it randomized? I have two commands set but I noticed they don't both consistently trigger.

Posted
12 hours ago, nanashi50 said:

Can you add in additional conditions for sextype? Such as "vaginal +anal"

Well, you can just set the menu option to "any" and add conditions in the script itself.

 

        ["sl_hastag", "vaginal"],
        ["if", "$$", "=", "0", "end"],
        ["sl_hastag", "anal"],
        ["if", "$$", "=", "0", "end"],

*Do something here*

        [":", "end"]

 

12 hours ago, nanashi50 said:

I have two commands set but I noticed they don't both consistently trigger.

I think they're all supposed to trigger. Always happened consistently for me, unless there was some error in one of the commands.

Posted
4 minutes ago, Warlock3000 said:

I think they're all supposed to trigger. Always happened consistently for me, unless there was some error in one of the commands.

The commands don't have errors. If I run them on two separate triggers or combine them into the same command file, they both run consistently. But when it's set as command1 and command2, it's not consistent.

Posted
8 hours ago, Warlock3000 said:

Well, you can just set the menu option to "any" and add conditions in the script itself.

 

        ["sl_hastag", "vaginal"],
        ["if", "$$", "=", "0", "end"],
        ["sl_hastag", "anal"],
        ["if", "$$", "=", "0", "end"],

*Do something here*

        [":", "end"]

 

I think they're all supposed to trigger. Always happened consistently for me, unless there was some error in one of the commands.

Any suggestions for detecting if the PC is in a SL scene?

 

I'm trying to make a stat absorption like function. I've done this by running the command on other non-player actors in the scene I base the stat increase on the other actor's stats. Then I apply the stat increase using $player. Problem is this procs when there are other SL scenes not involving the player. Having a condition to check for the player as part of the scene would be one way to fix it.

 

Or if there is a way to access other actors in a scene, I could just run the command on the player. Do you have ideas for either method?

Posted
1 hour ago, nanashi50 said:

Any suggestions for detecting if the PC is in a SL scene?

Usually, just setting the trigger actor to "Player" or "Player Partner" in the menu is enough.

But there's also "is_in" command if you want to do it in script.

 

1 hour ago, nanashi50 said:

I'm trying to make a stat absorption like function.

Check out my scripts on pages 4 and 5, particularly "Learn Skill Highest" and "Succubus Drain", you may find them useful.

 

Keep in mind that all actors in a scene can be accessed by a single script, so select the the trigger options in the menu accordingly, so that only 1 actor will trigger a script for a single sex scene.

The "$self" handle is the actor that triggered the script (as chosen in the "Actor" menu entry), "$partner" is that actor's partner (not sure how it works in threesomes), and "$player" is always the player, regardless who triggered the script.

Posted
2 hours ago, Warlock3000 said:

Check out my scripts on pages 4 and 5, particularly "Learn Skill Highest" and "Succubus Drain", you may find them useful.

 

Keep in mind that all actors in a scene can be accessed by a single script, so select the the trigger options in the menu accordingly, so that only 1 actor will trigger a script for a single sex scene.

The "$self" handle is the actor that triggered the script (as chosen in the "Actor" menu entry), "$partner" is that actor's partner (not sure how it works in threesomes), and "$player" is always the player, regardless who triggered the script.

Thanks, I checked your Succubus Drain one. I'm trying to do something different, which is to do permanent stat increases (and also make them done through SetAV rather than ModAV) and to also do it based on calculating the baseAV of the partner actors. To enable that, I had to add new functions to the mod (see post #135 and #136).

 

My command script looks like this (and set to be triggered on non-Player actors to handle 3+ actors):

But as mentioned before, the problem is I didn't consider scenes between NPCs.

{
    "cmd" : 
    [
        ["av_getbase", "$self", "Health"],
	["set", "$8", "$$"],
	["av_getbase", "$self", "Magicka"],
	["set", "$9", "$8", "+", "$$"],
	
	["set", "$4", "$8", "/", "200"],
	["set", "$5", "$8", "/", "150"],
	["inc", "$5", "1"],
	["set", "$6", "$9", "/", "175"],
	["set", "$7", "$9", "/", "100"],
	["inc", "$7", "1"],
		
	["rnd_int", "$4", "$5"],
	["set", "$1", "$$"],
        ["av_incrementbase", "$player", "Health", "$1"],
        ["rnd_int", "$4", "$5"],
	["set", "$2", "$$"],
        ["av_incrementbase", "$player", "Stamina", "$2"],
        ["rnd_int", "$6", "$7"],
	["set", "$3", "$$"],
        ["av_incrementbase", "$player", "Magicka", "$3"],

	["msg_notify", "Attributes increased by ", "$1", " Health, ", "$2", " Stamina, ", "$3", " Magicka."]
    ]
}

Not sure if it's possible to comment in the command scripts, but I did realize line breaks are fine. But some comments here on what it's doing.

  • First block is getting the base AV of the partner actor (it's triggered on the NPC so they are considered $self).
    • Note: av_getbase is a new function I added to the mod.
  • Second block is a calculation. I did some stuff in a spreadsheet to optimize how I wanted the stat increases to come out. Here is a definition of the variables:
    • $1 = Health increment
      $2 = Stamina increment
      $3 = Magicka increment


      $4 = rdn_min for HP/MP
      $5 = rnd_max for HP
      $6 = rnd_min for MP
      $7 = rnd_max for MP

      $8 = actor.baseHP
      $9 = actor.baseHP+baseMP

  • Third block is incrementing the baseAV of $player.
    • av_incrementbase is a new function I added to the mod. Post #135 explains what it does.

 

2 hours ago, Warlock3000 said:

Usually, just setting the trigger actor to "Player" or "Player Partner" in the menu is enough.

But there's also "is_in" command if you want to do it in script.

 

I guess I can try using "is_in" in my above command script, or try using $partner. But I do need it to handle multiple $partners, and I need it to trigger on each partner (i.e. do calculation based on each $partner stats).

 

The most challenging point is I need it to handle an arbitrary amount of partner actors (and access each ones stats for calculation), so unless there's a way to do that via the command script, having the command script trigger multiple times per actor is the only way I can think.

 

Edit: I didn't see any is_in function in the mod documentation, so I guess you meant adding it to the mod?

 

Posted
31 minutes ago, nanashi50 said:

I didn't see any is_in function in the mod documentation, so I guess you meant adding it to the mod?

Sorry, made a mistake with the name. It's "sl_isin".

["sl_isin", "$player"]

 

I think setting "Player Partner" in the menu should trigger the script on all player's partners just fine.

Posted
2 hours ago, Warlock3000 said:

Sorry, made a mistake with the name. It's "sl_isin".

["sl_isin", "$player"]

 

I think setting "Player Partner" in the menu should trigger the script on all player's partners just fine.

Thanks, didn't see the additional actor races. Maybe it's "Partner Not Player"? There's so many Partner variants and it's not clear what they mean.

 

Does "Partner Player" mean when the player is the partner? But in practice I'm not sure how that would be any different than just Player.

 

 

Edit: Nevermind, it's "Partner Player" afterall. Could be clarified by calling it "Partner of Player" and "Partner of Non-Player". Guessing it's the same for the other Partner variants.

Posted
3 hours ago, SomeDragonbornGuy said:

This the warmth idea not possible? 

I don't use CC Survival and am not that familiar with it, but taking a quick look at the ESL, you could probably do it if you also make a new spell in an ESP.

 

The hot foods give warmth, so you could make a new spell with a similar effect. Then you create a command script to get SL Triggers to cast that spell.

Posted
2 minutes ago, nanashi50 said:

I don't use CC Survival and am not that familiar with it, but taking a quick look at the ESL, you could probably do it if you also make a new spell in an ESP.

 

The hot foods give warmth, so you could make a new spell with a similar effect. Then you create a command script to get SL Triggers to cast that spell.

I can do all that but not sure how to make a script. Any advice would be nice or a point to a page I can read up on it. Maybe one of the codes here?

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   0 members

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