zensunniwanderer Posted September 11, 2015 Posted September 11, 2015 So I decided that this might make a good learning experience and started to put together a script however I've run into a problem that I just can't find any help on. The script won't activate in-game. I've successfully compiled it and dropped it into my MO override/Scripts folder assuming that "extends Quest" was appropriate. When that didn't work I tried to create a new quest in CreationKit called aroused_drip, I went to the scripts tab and tried to add the compiled script - the result was an error: "Script "aroused_drip" had errors while loading, it will not be added to the object." I've probably made a really fundamental error, can anyone point out where I've gone wrong? Many thanks. :3 Here's my script: ScriptName aroused_drip extends QuestActor Property PlayerREF AutoArmor Property ZaZAPEF201ALeakyPussyDrops AutoSPELL Property dripping AutoBool Property SLA_available = false autoEvent OnInit() Debug.Trace("Starting aroused leak.") Debug.Notification("Starting aroused leak.") SLA_available = SLAroused_check() RegisterForUpdate(20.0)EndEventEvent OnUpdate() if SLA_available if GetActorArousal() > 20 Debug.Notification("Arousal > 20 leak applied") Debug.Trace("Arousal > 20 leak applied") PlayerREF.addItem(ZaZAPEF201ALeakyPussyDrops, 1, true) PlayerREF.equipItem(ZaZAPEF201ALeakyPussyDrops, abSilent=true) elseif PlayerREF.IsEquipped(ZaZAPEF201ALeakyPussyDrops) Debug.Notification("Stopping leaking.") Debug.Trace("Stopping leaking.") PlayerREF.unequipItem(ZaZAPEF201ALeakyPussyDrops, abSilent=true) PlayerREF.removeItem(ZaZAPEF201ALeakyPussyDrops, 99, true) else Debug.Notification("herpaderp.") Debug.Trace("herpaderp.") endif else Debug.Notification("No SLA.") Debug.Trace("No SLA.") endifEndEventbool Function SLAroused_check() Debug.Trace("aroused_drip SLAroused check") If Game.GetModbyName("SexLabAroused.esm") != 255 Debug.Trace("SexLabAroused.esm found") return true else Debug.Trace("SexLabAroused.esm not found") endif return falseEndFunctionint Function GetActorArousal() if SLA_available slaFrameWorkScr sla = Quest.GetQuest("sla_Framework") as slaFrameWorkScr if sla return sla.GetActorArousal(PlayerREF) else return 0 endif else return 0 endifEndFunction
Veladarius Posted September 11, 2015 Posted September 11, 2015 You can't just drop a script in the script folder and expect it to run, it has to be attached to something or something has to run it in game.
Jayce Dimmer Posted September 11, 2015 Posted September 11, 2015 RegisterForUpdate shouldn't really be used, unless you know what you're doing. RegisterForSingleUpdate is what you should be using. You've not defined any properties for sla.
zensunniwanderer Posted September 12, 2015 Author Posted September 12, 2015 You can't just drop a script in the script folder and expect it to run, it has to be attached to something or something has to run it in game. This is something I was confused by. I initially thought this was the case but was thrown by mods that I have in MO that are nothing more than a single script in the Scripts folder which suggested simply having a valid script that extends an already running process should work. Regardless, I did attempt to attach the script and got the error I previously described. I can't see why a script that compiles successfully can have errors in it from CreationKit's point of view. @MajinCry Thanks, I've since read a few posts elsewhere that match your advice, I'll look in to this more (assuming I can get the script to work).
Veladarius Posted September 12, 2015 Posted September 12, 2015 On the error, do you have the source script in the script/source folder? The CK uses the source files to do things not the compiled ones.
zensunniwanderer Posted September 12, 2015 Author Posted September 12, 2015 On the error, do you have the source script in the script/source folder? The CK uses the source files to do things not the compiled ones. Ah! I did not, I keep my scripts in another directory and use advanced papyrus to use that directory when I'm compiling. I'll try that later, thank you.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.