Difference between revisions of "Activate"

583 bytes added ,  21:17, 16 April 2006
Explained the explaination of Normal Flag and it's uses
imported>Kkuhlmann
imported>Tegid
(Explained the explaination of Normal Flag and it's uses)
Line 9: Line 9:


If ActivatorID is omitted, the Activate command will use the calling reference's "current activator". This is very useful inside of OnActivate blocks where you want the activation to proceed normally except under certain circumstances.  
If ActivatorID is omitted, the Activate command will use the calling reference's "current activator". This is very useful inside of OnActivate blocks where you want the activation to proceed normally except under certain circumstances.  
'''That means that this:'''
Activate
'''Is equivalent to this:'''
ref actingref
set actingref to GetActionRef
Activate actingref
   
   
If ActivatorID is included, the calling reference will perform its default activation as if activated by ActivatorID.  
If ActivatorID is included, the calling reference will perform its default activation as if activated by ActivatorID.  
Line 35: Line 45:




If NormalActivationFlag is omitted, the calling reference performs its default activation, bypassing any OnActivate script that might be on it. This is normally how you want to use Activate, since most times you are calling Activate on the object itself from inside an OnActivate block.  
If NormalActivationFlag is omitted, the calling reference performs its default activation, bypassing any OnActivate script that might be on it. This is often how you want to use Activate, since most times you are calling Activate on the object itself from inside an OnActivate block after performing some check or other action.
 
If the NormalActivationFlag is 1, the calling reference will not bypass any OnActivate script on it.  This flag basically is an override of default activation as represented in the above chart. Use this with care -- if you call Activate on the object itself from inside an OnActivate block you will trigger an infinite loop.


If the NormalActivationFlag is 1, the calling reference will be activated normally, including triggering any OnActivate script on it. Use this with care -- if you call Activate on the object itself from inside an OnActivate block you will trigger an infinite loop.  
When used with care, this can be an extremely powerful tool to cause activates to be used as pseudo function calls between scripted objects and even spells.  The reference passed in can be used as arguments to tell the object being activated what to do. This use of Activate is not as intended and requires very careful planning and execution.


'''Example 1:'''  
'''Example 1:'''  
Anonymous user