Background for Fallout 4
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


Caveats


Parameters

ObjectReferenceakTrap

CK Wiki Description

Which trap reference just hit this reference.

floatafDamage

CK Wiki Description

How much damage to deal to this reference.

floatafPushback

CK Wiki Description

How far back to push this reference.

floatafXVel

CK Wiki Description

The impact vector's X coordinate.

floatafYVel

CK Wiki Description

The impact vector's Y coordinate.

floatafZVel

CK Wiki Description

The impact vector's Z coordinate.

floatafXPos

CK Wiki Description

The impact point's X coordinate.

floatafYPos

CK Wiki Description

The impact point's Y coordinate.

floatafZPos

CK Wiki Description

The impact point's Z coordinate.

intaeMaterial

CK Wiki Description

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

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.