Difference between revisions of "OnCombatStateChanged - Actor"
Jump to navigation
Jump to search
imported>Egocarib m (made this clearer after testing it more myself.) |
imported>Arthmoor (→Notes: Added note about combat state detection only happening on the ground.) |
||
Line 39: | Line 39: | ||
*This event will not work to detect when the player changes combat states. It can only detect combat state changes for other actors. | *This event will not work to detect when the player changes combat states. It can only detect combat state changes for other actors. | ||
*Bleeding out fires this event with CombatState = 0 | *Bleeding out fires this event with CombatState = 0 | ||
*Combat state changes can only be detected by an Actor that is on the ground in contact with a navmesh. State changes cannot be detected on dragons while still in flight. | |||
== See Also == | == See Also == | ||
*[[Actor Script]] | *[[Actor Script]] |
Latest revision as of 04:41, 4 May 2014
Member of: Actor Script
Event called when this actor's combat state changes.
Syntax[edit | edit source]
Event OnCombatStateChanged(Actor akTarget, int aeCombatState)
Parameters[edit | edit source]
- akTarget: The Actor that this actor is targeting. May be None if this actor is leaving combat.
- aeCombatState: The combat state we just entered, which will be one of the following:
- 0: Not in combat
- 1: In combat
- 2: Searching
Examples[edit | edit source]
Event OnCombatStateChanged(Actor akTarget, int aeCombatState)
if (akTarget == Game.GetPlayer())
if (aeCombatState == 0)
Debug.Trace("We have left combat with the player!")
elseif (aeCombatState == 1)
Debug.Trace("We have entered combat with the player!")
elseif (aeCombatState == 2)
Debug.Trace("We are searching for the player...")
endIf
endIf
endEvent
Notes[edit | edit source]
- This event will not work to detect when the player changes combat states. It can only detect combat state changes for other actors.
- Bleeding out fires this event with CombatState = 0
- Combat state changes can only be detected by an Actor that is on the ground in contact with a navmesh. State changes cannot be detected on dragons while still in flight.