Coding_Onion Posted November 11, 2025 Posted November 11, 2025 What dependencies do you need in general if you want to use the hook-function of Sexlab in your own mod to track events? I am not sure if i am just too messy with my modding folders and have accidentally deleted something important or if i miss something. (i'm getting an error that the mathematic operators of sexlab don't work if i try to compile, also it says that FNIS is undefined).
traison Posted November 11, 2025 Posted November 11, 2025 (edited) 59 minutes ago, Coding_Onion said: What dependencies do you need in general if you want to use the hook-function of Sexlab in your own mod to track events? Not sure what hook function you're talking about, but to add an event handler for a mod event you need SKSE. 59 minutes ago, Coding_Onion said: ...i'm getting an error that the mathematic operators of sexlab don't work... Don't take Papyrus errors literally. Half the time it's completely wrong, like complaining about loops in scripts that have no loops. 59 minutes ago, Coding_Onion said: ...it says that FNIS is undefined... That's because FNIS.psc is missing. When you compile a script, you need the sources of all scripts mentioned in this script. Edited November 11, 2025 by traison
Coding_Onion Posted November 11, 2025 Author Posted November 11, 2025 10 minutes ago, traison said: Not sure what hook function you're talking about, but to add an event handler for a mod event you need SKSE. Don't take Papyrus errors literally. Half the time it's completely wrong, like complaining about loops in scripts that have no loops. That's because FNIS.psc is missing. When you compile a script, you need the sources of all scripts mentioned in this script. okay, thanks, will see if its simply fnis causing the error. i just realized that 'HookActors' is deprecated anyways. uhm. So you use 'TrackActor' in combination with a mod event to check if someone is in an animation?
traison Posted November 11, 2025 Posted November 11, 2025 4 minutes ago, Coding_Onion said: So you use 'TrackActor' in combination with a mod event to check if someone is in an animation? No. Here's a function from my own mods: bool Function IsHavingSex(Actor who) {Gets whether or not the specified actor is having sex.} ;Return E_SexLab.IsActorActive(who) ; Returns true before sex starts int id = E_SexLab.FindActorController(who) If (id < 0) Return false EndIf sslThreadController thread = E_SexLab.GetController(id) string s = thread.GetState() Return s == "Animating" || s == "Advancing" EndFunction Where E_SexLab is a refrence to SexLabFramework.
MadMansGun Posted November 11, 2025 Posted November 11, 2025 i never quite got the hang o f hooks but this spell script is working in my SLDragons mod: aaaSLD_Spell_Sex_SmallDrag.psc note: the spell used has a long runtime to keep it active till the animation has ended. also this is the dialogue script used to cast the spell: aaaSLD_Dialogue_Sex_9SmallDrag.psc
Coding_Onion Posted November 11, 2025 Author Posted November 11, 2025 Yeah, seems my problem now is 'variable FNISCreatureVersion is undefined' when i call SexLabFramework SexLab = Game.GetFormFromFile(0x00000D62, "SexLab.esm") as SexLabFramework after i actually loaded the fnis.psc in the creationkit (my bad). Sorry for giving a headache and thank you for the advice 😅
traison Posted November 11, 2025 Posted November 11, 2025 (edited) 49 minutes ago, Coding_Onion said: when i call SexLabFramework SexLab = Game.GetFormFromFile(0x00000D62, "SexLab.esm") as SexLabFramework Use SexLabUtil.GetAPI() instead; or better yet, add it as a property instead of dynamically linking it. I'd use dynamic linking only if SexLab was an optional dependency, which it doesn't seem to be in this case. SexLabFramework sl = SexLabUtil.GetAPI() Edit: Also consider using something else as the variable name: "SexLab" could be confused with a script name quite easily. I used "sl" in my example. 49 minutes ago, Coding_Onion said: variable FNISCreatureVersion is undefined Which trainslates to: FNISCreatureVersion.psc is missing. Edited November 11, 2025 by traison 1
Coding_Onion Posted November 11, 2025 Author Posted November 11, 2025 45 minutes ago, traison said: No. Here's a function from my own mods: bool Function IsHavingSex(Actor who) {Gets whether or not the specified actor is having sex.} ;Return E_SexLab.IsActorActive(who) ; Returns true before sex starts int id = E_SexLab.FindActorController(who) If (id < 0) Return false EndIf sslThreadController thread = E_SexLab.GetController(id) string s = thread.GetState() Return s == "Animating" || s == "Advancing" EndFunction Where E_SexLab is a refrence to SexLabFramework. For some reason the compiler insists that 'time' isn't a variable in three instances even though it is defined in the source-file. ''...sslBaseExpression.psc(216,16): Time is not a variable" yeah, i am quite sure i messed something up when setting up sexlab for modding. also, i found the setup-guide for sexlab for modders which states how to set stuff up. Hope its up to date.
traison Posted November 11, 2025 Posted November 11, 2025 (edited) 10 minutes ago, Coding_Onion said: Time is not a variable Sounds like leftovers from P+. Edit: Could also be you have a script named Time.psc, which makes Time (the variable) a type. Same reason why I said don't use "SexLab" as a variable name in my previous post. Edited November 11, 2025 by traison
Coding_Onion Posted January 7 Author Posted January 7 On 11/11/2025 at 9:40 PM, traison said: Sounds like leftovers from P+. Edit: Could also be you have a script named Time.psc, which makes Time (the variable) a type. Same reason why I said don't use "SexLab" as a variable name in my previous post. A fair bit of time has passed, but to tell the end of the story- yes, it seems when starting out with modding i coincidentally named a script 'time', left it in the data folder and promptly forgot about it, causing the error. Thanks for helping out. I guess the lesson learned is to always clean up the data after messing around^^'
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