khulse Posted July 1, 2015 Share Posted July 1, 2015 (edited) I'm having a devil of a time figuring out how to write a script to do what I want. It's simple in concept, but everything I try has failed. I admit I'm very new to scripting. Basicaly, I have a spell with negative effects that I want to add an item, a faction and another spell, then be dispelled - all when the player sleeps. I'm attaching the script to the magic effect itself. Here's what I've got so far: Scriptname HivePlayerFactionScript extends ActiveMagicEffect Faction Property AAHiveFaction AutoSpell Property hivespell AutoBook Property hivebook AutoActor Property hivePlayer AutoActiveMagicEffect Property paracytespell Auto Event OnEffectStart(Actor akTarget, Actor akCaster) hivePlayer.RegisterForSleep()EndEvent Event OnSleepStart(float afSleepStartTime, float afDesiredSleepEndTime) hivePlayer.AddToFaction(AAHiveFaction)hivePlayer.addspell(hivespell) hivePlayer.additem(hivebook)EndEvent Event OnSleepStop(bool abInterrupted) paracytespell.dispel()EndEvent I admit, I'm a newb at scripting. Anyone have any idea what it is I'm doing wrong? Edit: I got it to compile, but it still doesn't work. Nothing happens when I sleep. I updated the script with the one that compiled. Edited July 2, 2015 by khulse Link to comment Share on other sites More sharing options...
khulse Posted July 2, 2015 Author Share Posted July 2, 2015 bump Link to comment Share on other sites More sharing options...
jboyd4 Posted August 2, 2015 Share Posted August 2, 2015 I'm sorry, I wish I could help you. I'm having a very similar problem. It's like the addtofaction doesn't do anything in the scripts. I saw one somewhere that instead of addtofaction, it said setteammate or something like that. So, I'm going to look around for that, maybe it could help you. BTW, have you tried adding a debug notification to your script just to test if it is firing? Link to comment Share on other sites More sharing options...
Recommended Posts