Difference between revisions of "Talk:Activate"

From the Oblivion ConstructionSet Wiki
Jump to navigation Jump to search
imported>Tegid
(Follow on Activate Questions)
imported>Tegid
m
Line 12: Line 12:
* 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.
* 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.


 
--[[User:Tegid|Tegid]] 15:13, 12 April 2006 (EDT) So three questions.   
:--[[User:Tegid|Tegid]] 15:13, 12 April 2006 (EDT) So three questions.   
* That reset happens when the OnActivate block starts or stops?  (So if I send another activate before it is finished with its block, will it be cleared when its block ends and therefore never happen?)
* That reset happens when the OnActivate block starts or stops?  (So if I send another activate before it is finished with its block, will it be cleared when its block ends and therefore never happen?)
* As long as I've used PlaceAtMe to create this object, the second section shouldn't apply correct?
* As long as I've used PlaceAtMe to create this object, the second section shouldn't apply correct?
* Are script blocks atomic?
* Are script blocks atomic?

Revision as of 15:37, 13 April 2006

This page is unclear, does player.Activate doorID mean the player activates the door, or the door activates the player?

--Kkuhlmann 12:04, 6 April 2006 (EDT): What you wrote means the door is activating the player. If you want to simulate the player activating a door: DoorID.Activate player

Scripting Issues

--Mrflippy 12:59, 12 April 2006 (EDT) I've been having some issues with this command in scripts. Sometimes, "object.activate me, 1" just doesn't work. The OnActivate block in the script attached to object isn't run at all. Most of the activators I work with are dynamically created using PlaceAtMe. Is this the source of the problem?

--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?

--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.

--Tegid 15:13, 12 April 2006 (EDT) So three questions.

  • That reset happens when the OnActivate block starts or stops? (So if I send another activate before it is finished with its block, will it be cleared when its block ends and therefore never happen?)
  • As long as I've used PlaceAtMe to create this object, the second section shouldn't apply correct?
  • Are script blocks atomic?