Difference between revisions of "OnHit"

From the Oblivion ConstructionSet Wiki
Jump to navigation Jump to search
imported>Haama
m (Reverted edits by Povuholo (Talk); changed back to last version by Entim)
imported>Haama
m (Verb phrase)
Line 4: Line 4:
   begin OnHit BaurusRef  
   begin OnHit BaurusRef  


This block will be run once when the scripted actor is hit by the specified ActorID, either by a weapon or a spell. If no parameter is used, the block will be run when the scripted actor is hit by anyone.
This block will be run once when the scripted actor is hit by the specified ActorID, either by a weapon or a spell. If no parameter is used, the block will run when the scripted actor is hit by anyone.


Note:  Using [[GetDetected]] in an OnHit block doesn't really work.  The OnHit block happens just AFTER the hit occurs, and the way Actor detection works, the hit causes an immediate awareness spike and so GetDetected will always come up as true.  It will NOT return whether the Actor was detected previous to the hit.
Note:  Using [[GetDetected]] in an OnHit block doesn't really work.  The OnHit block happens just AFTER the hit occurs, and the way Actor detection works, the hit causes an immediate awareness spike and so GetDetected will always come up as true.  It will NOT return whether the Actor was detected previous to the hit.


[[Category: Blocktypes]]
[[Category: Blocktypes]]

Revision as of 12:34, 15 February 2008

Syntax:

 begin OnHit ActorID (optional)

Example:

 begin OnHit BaurusRef 

This block will be run once when the scripted actor is hit by the specified ActorID, either by a weapon or a spell. If no parameter is used, the block will run when the scripted actor is hit by anyone.

Note: Using GetDetected in an OnHit block doesn't really work. The OnHit block happens just AFTER the hit occurs, and the way Actor detection works, the hit causes an immediate awareness spike and so GetDetected will always come up as true. It will NOT return whether the Actor was detected previous to the hit.