The6thMessenger Posted June 24, 2016 Share Posted June 24, 2016 Scriptname MinigunSpinupDispel extends ActiveMagicEffect ActorValue Property HasChaingun Auto Event OnEffectStart(Actor akTarget, Actor akCaster)- StartTimer(0.1,1)EndEvent Event OnTimer(int aiTimerId)- if aiTimerId == 1- - Float Chaingun = Game.GetPlayer().GetValue(HasChaingun) - - If Chaingun <= 0- - - self.dispel()- - elseif Chaingun > 0- - - StartTimer(0.1,1)- - endif- endifEndEvent Event OnEffectFinish(Actor akTarget, Actor akCaster)- CancelTimer(1)Endevent That's a custom script for a persistent-checking MGEF, it checks if actor has x every 0.1s, and would dispel if not true. Now supposed that like 90 of these are running at the same time, is it safe or unsafe? Link to comment Share on other sites More sharing options...
Engager Posted June 24, 2016 Share Posted June 24, 2016 (edited) A bit strange thing to script, but having too many active timers is not good, since almost any register based event is locket into frame rate and each event will require 1 frame, so if you have i lot you can end up with 1 fps.... You are violating important performance rule here: do not use timers to check your stuff, use events! Edited June 24, 2016 by Engager Link to comment Share on other sites More sharing options...
Reneer Posted June 24, 2016 Share Posted June 24, 2016 (edited) A bit strange thing to script, but having too many active timers is not good, since almost any register based event is locket into frame rate and each event will require 1 frame, so if you have i lot you can end up with 1 fps.... You are violating important performance rule here: do not use timers to check your stuff, use events!This is not quite right. Scripts will not impact FPS performance - they will impact the performance of other scripts. That being said, it would be a good idea, The6thMessenger, to look over this Creation Kit Wiki article (written by the guy who designed and implemented Papyrus in Skyrim). What Engager is saying about events versus timers is definitely true from a performance standpoint, though. Edited June 24, 2016 by Reneer Link to comment Share on other sites More sharing options...
The6thMessenger Posted June 24, 2016 Author Share Posted June 24, 2016 Well, the thing is that i can't think of a way to make a MGEF disappear when one factor disappear. The MGEF already has that feature of being dispelled with the Keyword, but i need a feature that's without it. Link to comment Share on other sites More sharing options...
Recommended Posts