Background for Fallout 4
Member of the ObjectReference script
eventOnTrapHitStart(ObjectReferenceakTarget, floatafXVel, floatafYVel, floatafZVel, floatafXPos, floatafYPos, floatafZPos, intaeMaterial, boolabInitialHit, intaeMotionType)

Description

Wiki Description

Event called when the object reference is a trap and has started hitting a live target.

Documentation Comment

Event recieved when this starts hitting a target


Parameters

  1. ObjectReferenceakTarget

    CK Wiki Description

    The ObjectReference that this reference just hit.

  2. floatafXVel

    CK Wiki Description

    The X velocity for our reference when it hit.

  3. floatafYVel

    CK Wiki Description

    The Y velocity for our reference when it hit.

  4. floatafZVel

    CK Wiki Description

    The Z velocity for our reference when it hit.

  5. floatafXPos

    CK Wiki Description

    The X position of our reference when it hit.

  6. floatafYPos

    CK Wiki Description

    The Y position of our reference when it hit.

  7. floatafZPos

    CK Wiki Description

    The Z position of our reference when it hit.

  8. intaeMaterial

    CK Wiki Description

    Opaque integer value denoting what material the trap is. Not intended to be meaningful to script, just to be passed to other native functions that may use it.

  9. boolabInitialHit

    CK Wiki Description

    True if this is the first time the trap has hit the target.

  10. intaeMotionType

    CK Wiki Description

    The motion type for the trap.

    • Note: Currently there are several read-only properties in the ObjectReference source file that match this, but it will later be changed to an enum and the possible list of values reduced to something more meaningful.

Examples

Event OnTrapHitStart(ObjectReference akTarget, float afXVel, float afYVel, float afZVel, float afXPos, float afYPos, \
    float afZPos, int aeMaterial, bool abInitialHit, int aeMotionType)
  Debug.Trace("Ouch! We just started hitting " + akTarget)
endEvent

Auto-Generated Example

Scriptname MyCoolScript extends ObjectReference

event OnTrapHitStart(ObjectReference akTarget, float afXVel, float afYVel, float afZVel, float afXPos, float afYPos, float afZPos, int aeMaterial, bool abInitialHit, int aeMotionType)
    Debug.trace("Event received - OnTrapHitStart: akTarget = " + akTarget + " afXVel = " + afXVel + " afYVel = " + afYVel + " afZVel = " + afZVel + " afXPos = " + afXPos + " afYPos = " + afYPos + " afZPos = " + afZPos + " aeMaterial = " + aeMaterial + " abInitialHit = " + abInitialHit + " aeMotionType = " + aeMotionType)
endEvent

Related Pages


Additional References

View this event’s page on the Fallout 4 Creation Kit Wiki

Some data provided by the Fallout 4 Creation Kit Wiki. Licensed under the Creative Commons Attribution-Share Alike 4.0 license.