Editing
OnTrapHit - ObjectReference
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
[[Category:Scripting]] [[Category:Papyrus]] [[Category:Events]] '''Member of:''' [[ObjectReference Script]] Event called when the object reference is a trap and has hit a live target. This event is sent every so often as long as a trap object is in contact with a live target. == Syntax == <syntaxhighlight lang="papyrus"> Event OnTrapHit(ObjectReference akTarget, float afXVel, float afYVel, float afZVel, float afXPos, float afYPos, \ float afZPos, int aeMaterial, bool abInitialHit, int aeMotionType) </syntaxhighlight> == Parameters == *akTarget: The [[ObjectReference Script (Papyrus)|ObjectReference]] that this reference just hit. *afXVel: The X velocity for our reference when it hit. *afYVel: The Y velocity for our reference when it hit. *afZVel: The Z velocity for our reference when it hit. *afXPos: The X position of our reference when it hit. *afYPos: The Y position of our reference when it hit. *afZPos: The Z position of our reference when it hit. *aeMaterial: 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. *abInitialHit: True if this is the first time the trap has hit the target. *aeMotionType: 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 == <syntaxhighlight lang="papyrus"> Event OnTrapHit(ObjectReference akTarget, float afXVel, float afYVel, float afZVel, float afXPos, float afYPos, \ float afZPos, int aeMaterial, bool abInitialHit, int aeMotionType) ; Pass it on to the game trap system with a bit of damage akTarget.ProcessTrapHit(self, 10.0, 0.0, afXVel, afYVel, afZVel, afXPos, afYPos, afZPos, aeMaterial, 0.0) EndEvent </syntaxhighlight> == Notes == This event can be sent quite rapidly, so be careful how you use it so you don't overstress the script system. == See Also == *[[ObjectReference Script]] *[[OnTrapHitStart - ObjectReference]] *[[OnTrapHitStop - ObjectReference]] *[[ProcessTrapHit - ObjectReference]]
Summary:
Please note that all contributions to the CreationKit Wiki are considered to be released under the Creative Commons Attribution-ShareAlike (see
CreationKit:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
Edit source
View history
More
Search
Navigation
Landing page
Tutorials
Game Systems
Editor Reference
Scripting Reference
Recent changes
Help
Tools
What links here
Related changes
Special pages
Page information
Page values