xcafe Posted December 15, 2016 Share Posted December 15, 2016 So I have this script, meant to activate an event when it's added to the player, but no dice. Any advice? Scriptname grimoire24script extends MagicEffectForm Property GrimoireSpellList AutoCentralListScript Property CentralQuest AutoActor Property PlayerRef AutoEvent OnEffectStart()Debug.Notification("Effect Started")RegisterForSingleUpdateGameTime(24.0)Debug.Notification("Effect Started, Registered")EndEventEvent OnUpdateGameTime()Debug.Notification("Removespells Called")Int ListSize = CentralQuest.GrimoireSpellList.GetSize()Int Index = 0While Index < ListSizeForm Entry = CentralQuest.GrimoireSpellList.GetAt(Index)If (Entry as Spell)PlayerRef.RemoveSpell(Entry as Spell)EndIfIndex += 1EndWhileDebug.Notification("Spells Removed")EndEvent P.S. The debugs aren't going off or anything either. Link to comment Share on other sites More sharing options...
IsharaMeradin Posted December 15, 2016 Share Posted December 15, 2016 What is the duration of the magic effect? If the magic effect is removed before the update event is called, the registration for the single update is automatically cleared (as far as I understand the wiki). Try making sure that the magic effect lasts longer than the time period you wish to wait. Alternatively, put that central quest script to work for you and call a function on it which registers for the update and performs all the necessary work there. Link to comment Share on other sites More sharing options...
xcafe Posted December 15, 2016 Author Share Posted December 15, 2016 Well the spell is an ability, (of the constant, on self variety) so I think the duration is infinite? And I'll try that quest script idea out! :D Link to comment Share on other sites More sharing options...
xcafe Posted December 15, 2016 Author Share Posted December 15, 2016 (edited) So I'm trying the quest thing, but what event do I use to trigger the register? I can't think of a way to do it short of checking for a variable with OnUpdate, but leaving that on like that would cause major save bloating. EDIT: I tried doing the thing with variable and OnUpdate for now, and it works, but I'm still concerned it'll cause save bloating. Edited December 16, 2016 by xcafe Link to comment Share on other sites More sharing options...
IsharaMeradin Posted December 16, 2016 Share Posted December 16, 2016 I was simply thinking that you would put a function similar to this on your quest script: Function RegisterForMyStuff() RegisterForSingleUpdateGameTime(24.0) EndFunctionThen the OnUpdateGameTime event with all the stuff you want to do. On the magic effect script where you already have the quest script linked, you'd simply do: Event OnEffectStart() Debug.Notification("Effect Started") CentralQuest.RegisterForMyStuff() Debug.Notification("Effect Started, Registered") EndEventI don't see where you'd get save bloating from that... Link to comment Share on other sites More sharing options...
Recommended Posts