Difference between revisions of "OnHit"

From the Oblivion ConstructionSet Wiki
Jump to navigation Jump to search
imported>Haama
(Revised)
imported>Skyranger-1
Line 9: Line 9:
*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.
*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.
*Only works on NPCs and Creatures, and will not work on items.
*Only works on NPCs and Creatures, and will not work on items.
*Using [[GetActionRef]] in an OnHit block can return the ActorID of the hitter. 


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

Revision as of 06:43, 2 May 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. If no parameter is used, the block will run when the scripted actor is hit by anyone.

Notes

  • 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.
  • Only works on NPCs and Creatures, and will not work on items.
  • Using GetActionRef in an OnHit block can return the ActorID of the hitter.