Difference between revisions of "Talk:Activate"
→Scripting Issues
imported>Mrflippy |
imported>Kkuhlmann |
||
Line 7: | Line 7: | ||
--[[User:Tegid|Tegid]] 13:37, 12 April 2006 (EDT) I too am having this problem. Is there some kind of time constraint on activation? What causes them to just not activate? If they are already inside their OnActivate block and someone calls Activate on them, what happens then? | --[[User:Tegid|Tegid]] 13:37, 12 April 2006 (EDT) I too am having this problem. Is there some kind of time constraint on activation? What causes them to just not activate? If they are already inside their OnActivate block and someone calls Activate on them, what happens then? | ||
--[[User:Kkuhlmann|Kkuhlmann]] 14:01, 12 April 2006 (EDT): Some things to keep in mind which could be causing your issues: | |||
* All "action" block types (OnActivate, OnEquip, OnAdd, etc.) work by setting a flag on the script when the action occurs. The next time the script runs, if the appropriate block flag is set, that block is executed, and the flag is reset (so it doesn't run it more than once for a single action). | |||
* Object scripts only run if the object is in the currently loaded area -- where the player is. So calling Activate on something that isn't loaded will set the flag for that action, but won't actually trigger the script (it will trigger the next time the object's script is run). NPC scripts (on persistent NPCs) do run when they're not loaded, but only when their AI is updated, which can happen as infrequently as every 15 game minutes. |