EternalDamned Posted April 9, 2014 Posted April 9, 2014 I need to add an If statement to have caster check if target is already in a sexlab animation, and if so to masturbate. I've checked every script I can find and I dont see an example I can get a clue from anywhere. Here is the script I am using, and as you can see it's quite simple since I am using an AI package to do the arousal check and travel etc. But need an if to keep them from continually casting the spell at me while in an animation with another NPC. Any help would be greatly appreciated! function OnEffectStart(actor target, actor caster) Utility.Wait(1.0) actor[] sexActors = new actor[2] sexActors[0] = caster sexActors[1] = target sslBaseAnimation[] anims SexLab.StartSex(sexActors, anims)endfunction
shane4244 Posted April 9, 2014 Posted April 9, 2014 I need to add an If statement to have caster check if target is already in a sexlab animation, and if so to masturbate. I've checked every script I can find and I dont see an example I can get a clue from anywhere. Here is the script I am using, and as you can see it's quite simple since I am using an AI package to do the arousal check and travel etc. But need an if to keep them from continually casting the spell at me while in an animation with another NPC. Any help would be greatly appreciated! function OnEffectStart(actor target, actor caster) Utility.Wait(1.0) actor[] sexActors = new actor[2] sexActors[0] = caster sexActors[1] = target sslBaseAnimation[] anims SexLab.StartSex(sexActors, anims) endfunction If target.IsInFaction(SexLabAnimatingFaction) == 0 ;Your original spell elseif target .IsInFaction(SexLabAnimatingFaction) == 1 ;your masterbation spell endif endfunction That may not be the exact faction name but there is a Sexlab animation faction you'll just have to dig through and see the exact name. There may also be a better way but this is how I would do it.
Ashal Posted April 9, 2014 Posted April 9, 2014 if SexLab.IsActorActive(target) ; // masturbate SexLab.QuickStart(caster) else ; // sex SexLab.QuickStart(caster, target) endIf would be the most straightforward and reliable way to do it. Faction checking is fine to, but I wouldn't rely on it, SexLab doesn't really use the faction for anything important anymore, it's more or less just there for backwards compatibility support these days.
EternalDamned Posted April 9, 2014 Author Posted April 9, 2014 Worked perfectly Ashal, I can't thank you enough!
Recommended Posts
Archived
This topic is now archived and is closed to further replies.