Background for Starfield
Member of the ObjectReference script
voidfunctionProcessTrapHit(ObjectReferenceakTrap, floatafDamage, floatafPushback, floatafXVel, floatafYVel, floatafZVel, floatafXPos, floatafYPos, floatafZPos, intaeMaterial, floatafStagger)Native

Description

Wiki Description

Tells this reference to handle getting hit by a trap, dealing the specified amount of damage and possibly applying a pushback force.

Documentation Comment

Tells this object to process a trap hitting it


Parameters

  1. ObjectReferenceakTrap

    CK Wiki Description

    Which trap reference just hit this reference.

  2. floatafDamage

    CK Wiki Description

    How much damage to deal to this reference.

  3. floatafPushback

    CK Wiki Description

    How far back to push this reference.

  4. floatafXVel

    CK Wiki Description

    The impact vector's X coordinate.

  5. floatafYVel

    CK Wiki Description

    The impact vector's Y coordinate.

  6. floatafZVel

    CK Wiki Description

    The impact vector's Z coordinate.

  7. floatafXPos

    CK Wiki Description

    The impact point's X coordinate.

  8. floatafYPos

    CK Wiki Description

    The impact point's Y coordinate.

  9. floatafZPos

    CK Wiki Description

    The impact point's Z coordinate.

  10. intaeMaterial

    CK Wiki Description

    Opaque integer value denoting what material the trap is. (Usually received via an ObjectReference.OnTrapHitStart(...) event)

  11. floatafStagger

    CK Wiki Description

    How much to stagger the target, 0.0-1.0.


Examples

; Process a trap hit on the player with just a little bit of damage, and no pushback or stagger, with a position
; velocity, and material from somewhere else (probably OnTrapHit)
Game.GetPlayer().ProcessTrapHit(SpikeTrap, 1.0, 0.0, xvel, yvel, zvel, xpos, ypos, zpos, material, 0.0)

Auto-Generated Example

ObjectReference myObjectReference__akTrap
float myFloat__afDamage
float myFloat__afPushback
float myFloat__afXVel
float myFloat__afYVel
float myFloat__afZVel
float myFloat__afXPos
float myFloat__afYPos
float myFloat__afZPos
int myInt__aeMaterial
float myFloat__afStagger

myObjectReference__toCallFunctionOn.ProcessTrapHit(myObjectReference__akTrap, myFloat__afDamage, myFloat__afPushback, myFloat__afXVel, myFloat__afYVel, myFloat__afZVel, myFloat__afXPos, myFloat__afYPos, myFloat__afZPos, myInt__aeMaterial, myFloat__afStagger)

Related Pages


Additional References

View this function’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.