DarkBlade13 Posted December 31, 2022 Posted December 31, 2022 Hi, I am currently making a mod. I already know how to start an animation with script. However I do not know how to register an orgasm event, get the specific actors involved and run a script on them. Does anyone know the code for this? The plan is to make a script that allows semen to be swallowed by a female on blowjob. actor[] sexActors = new actor[2] sexActors[0] = akSpeaker sexActors[1] = Game.GetPlayer() sslBaseAnimation[] anims anims = SexLab.GetAnimationsByTag(2, "AnimationTag", tagSuppress="AnimationTag") SexLab.StartSex(sexActors, anims) SexLabFramework Property SexLab auto
GGx88A6HHnsL2 Posted December 31, 2022 Posted December 31, 2022 (edited) use this to register for the event: RegisterForModEvent("OrgasmStart", "OnSexLabOrgasm") Then your function to handle the event (which must be a function in the script from which you register): Event OnSexLabOrgasm(string hookName, string argString, float argNum, form sender) sslThreadController ssl_controller = SexLab.HookController(argString) if (ssl_controller == None) return endif <you can check the contents of ssl_controller.Positions here to see which actors are in the animation> EndEvent If/when you want to stop listening for the event: UnregisterForModEvent("OrgasmStart") Note that the above will run for any SexLab scene. If you want to only get the event for specific scenes, set the hook name on the scene's SexLabController and then register for "OrgasmStart_<whatever you called the hook>" instead of just "OrgasmStart". (The underscore is part of the name, but, of course, the braces are not.) In this case, though, you'll of course need to register/unregister for each scene. If you're starting the scene yourself, this is easy enough to do when you start the scene, then unregister in the OrgasmStart handler. Of course, you can always just get the event for every scene and have checks in your handler to just return for ones you don't care about. It shouldn't be firing often enough to affect performance. Edited December 31, 2022 by GGx88A6HHnsL2 moved code into code blocks 2
traison Posted December 31, 2022 Posted December 31, 2022 A note if you run into issues with the OrgasmStart event: There's a bug in sslThreadController in SexLabFrameworkSE_v163_BETA9 where it will somtimes send that event twice. Its easy to fix yourself with a simple boolean value and the proper checks.
DarkBlade13 Posted January 1, 2023 Author Posted January 1, 2023 (edited) Happy new year everyone! Regarding the previous question. I looked at the argstring inside the sexlab framworks script. The autor himself said not to use argstring functions. Could you perhaps fill in the values. Like a script to register a blowjob event. Get the two actors and add a gold coin to the female actor when orgasm is reached? One that could be pasted into the creation kit script and works without editing. It is easier to reverse engineer for me than to fill the values in myself. I know some basic scripting from vanilla skyrim but the functions ssl uses are different. If you don't want to write a working script for me I would understand. If you do, thanks a lot ? Edited January 1, 2023 by DarkBlade13
traison Posted January 1, 2023 Posted January 1, 2023 (edited) Well I personally never do scripting with the CK unless I'm setting up some very simple one-liners for a dialogue or stuff like that, so that entire part is on you. This should however for the most part cover what you requested (not tested): ; Properties SexLabFramework Property SexLab Auto ObjectReference Property Gold Auto ; Type may be wrong ; RegisterForModEvent("HookOrgasmStart", "SexLabOrgasmStart") ; This goes wherever you initialize your stuff. ; Events Event SexLabOrgasmStart(int threadId, bool hasPlayer) sslThreadController thread = SexLab.GetController(threadId) sslBaseAnimation anim = thread.Animation If (!anim.HasTag("oral")) Return EndIf Actor[] actors = thread.Positions int i = 0 While (i < actors.Length) If (SexLab.GetGender(actors[i]) == 1) actors[i].AddItem(Gold, 1) EndIf i += 1 EndWhile EndEvent Edited January 1, 2023 by traison
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