OnDestructionStageChanged - ObjectReference

From the Fallout4 CreationKit Wiki
Jump to navigation Jump to search

Member of: ObjectReference Script

Event called when the object's destruction stage changes.

Syntax[edit | edit source]

Event OnDestructionStageChanged(int aiOldStage, int aiCurrentStage)

Parameters[edit | edit source]

  • aiOldStage - The object's destruction stage before this event fired. Attached here because massive damage could cause an object to skip several destruction stages at once.
  • aiCurrentStage - The object's current destruction stage.

Examples[edit | edit source]

Event OnDestructionStageChanged(int aiOldStage, int aiCurrentStage)
  Debug.Trace("Out destruction stage changed from " + aiOldStage + " to " + aiCurrentStage)
EndEvent


Event OnDestructionStageChanged(int aiOldStage, int aiCurrentStage)
  ; ClearDestruction will set aiCurrentStage back to 0.
  if aiCurrentStage == 0 && aiOldStage > 0
    Debug.Trace("The item has been repaired" )
  endif
EndEvent

See Also[edit | edit source]