InternationalStandardDuck Posted August 1, 2023 Posted August 1, 2023 I'm trying to make a simple lesser spell that makes the player masturbate when triggered above an arousal threshold. I bypassed the arousal check for now because for some reason, the script couldn't get the player's arousal. There was also a debug statement on my code that returned the arousal value, that's where I found out it was returning 0. Is there something I'm not understanding about SLA? Also note I'm trying out the new SexLab Aroused NG. Spoiler Scriptname TED_Masturbate_LesserPower_Script extends ActiveMagicEffect slaframeworkscr Property sla Auto Event OnEffectStart(Actor akTarget, Actor akCaster) SexLabFramework SexLab = SexLabUtil.GetAPI() Int arousal = sla.GetActorArousal(Game.GetPlayer()) // I also tried using akTarget instead of Game.GetPlayer(), no dice... String Tags If (arousal < 25) Debug.Notification(akTarget.GetActorBase().GetName() + " doesn't feel like masturbating now.") // This returned arousal before // TODO: return bypassed for now EndIf If (Sexlab.GetGender(akTarget) == 1) Tags = "F,Masturbation" Else Tags = "M,Masturbation" EndIf SexLab.QuickStart(Actor1 = akCaster, AnimationTags = Tags) endEvent
traison Posted August 1, 2023 Posted August 1, 2023 I don't know about the NG variant of SLA, but the original SLA had lots of quirks related to this. I recently posted them in another thread. ie. is your actor arousal locked? If so, then: Quote When arousal is locked, GetActorArousal reads the sla_arousal faction rank and always returns 0.
InternationalStandardDuck Posted August 1, 2023 Author Posted August 1, 2023 Player shouldn't be locked since I'm testing on a new save. Also the default "debug" hotkey ('N' in my case) still outputs like normal. I recall trying to copy that debug code for mine but for some reason It still outputs 0. Maybe I'll try reverting SLAX or SLAM if push comes to shove.
traison Posted August 1, 2023 Posted August 1, 2023 Again, the NG variant may be different, but another potential situation here may have been that your script was the first to call GetActorArousal on the player (returning 0 or -2). Then when you pressed N, that was the 2nd call (and now the player actor had an arousal value) and it returned (for example) 47. Your script thus appears broken. One way to probe the arousal value without SLA interfering is to check the sla_aroused faction rank of an actor. As long as arousal is not locked, that faction rank should reflect the last arousal value that passed through SLA. The actual arousal value can be whatever at any given moment, it's always the result of an algorithm - it is not a single value stored somewhere.
InternationalStandardDuck Posted August 2, 2023 Author Posted August 2, 2023 I managed to find a solution, but I had to use SexLab NG's slaInternalModules, specifically slaInternalModules.GetArousal(Actor who) function. Somehow, slaFramework loses the value somewhere, so I checked the logs for the dll and saw that the value is being retrieved. Since it's being retrieved, I directly grabbed the value using internal modules script. I think it directly grabs the Arousal value via dll. Right now I'm asking the mod author if there are downsides to using this. Thanks for the support! As reference here's my current code: Spoiler Scriptname TED_Masturbate_LesserPower_Script extends ActiveMagicEffect slaframeworkscr Property sla Auto Event OnEffectStart(Actor akTarget, Actor akCaster) SexLabFramework SexLab = SexLabUtil.GetAPI() Float arousal = slaInternalModules.GetArousal(akTarget) String Tags Debug.Notification(akTarget.GetActorBase().GetName() + ": " + arousal) ; This one returns value now ? although in Float. I can work with that. If (arousal < 25.0) ;Debug.Notification(akTarget.GetActorBase().GetName() + " doesn't feel like masturbating now.") EndIf ;/ If (SexLab.GetGender(akTarget) == 1) Tags = "F,Masturbation" Else Tags = "M,Masturbation" EndIf SexLab.QuickStart(Actor1 = akCaster, AnimationTags = Tags) /; endEvent
InternationalStandardDuck Posted August 2, 2023 Author Posted August 2, 2023 I'm a total ding-dong. The solution was to select the property of slaframeworksrc in the papyrus section of the spell tab. I'm new to papyrus and ck so I didn't know the workflow yet. Well anyway, I rewrote the whole thing with this in mind.
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