IsPlayerActionActive

From the Fallout3 GECK Wiki
Jump to navigation Jump to search
< [[::Category:Functions|Category:Functions]]

A function included in the GECK version 1.1.0.36.

Description

Tests to see if the player is currently performing a specific action. If the player is performing the specified action, IsPlayerActionActive returns 1, whereas if the player is not performing the specified action IsPlayerActionActive returns 0.

Syntax

[help]
(0, 1:int) IsPlayerActionActive ActionIndex:int{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}

Example

IsPlayerActionActive 8

Returns 1 if the player is standing on a table or chair, and returns 0 if the player is not standing on a table or chair.

Action Indices

  • 1 = PLAYER_ACTION_SWING_MELEE_WEAPON
  • 2 = PLAYER_ACTION_THROW_GRANADE
  • 3 = PLAYER_ACTION_FIRE_WEAPON
  • 4 = PLAYER_ACTION_LAY_MINE
  • 5 = PLAYER_ACTION_Z_KEY_OBJECT
  • 6 = PLAYER_ACTION_JUMPING
  • 7 = PLAYER_ACTION_KNOCKING_OVER_OBJECTS
  • 8 = PLAYER_ACTION_STAND_ON_TABLE_CHAIR
  • 9 = PLAYER_ACTION_IRON_SIGHTS
  • 10 = PLAYER_ACTION_DESTROY_OBJECT

Notes

  • Multiple actions being performed at the same time will return true for each of the actions.
  • Actions stay "active" based on either a timer or “stopping” the action. For example, "firing a weapon" remains active for about 2 minutes of game time after the weapon is fired, but Z keying and standing on furniture return false as soon as the activity is stopped.
  • PLAYER_ACTION_IRON_SIGHTS (9), and possibly others, will not return true if the player is in combat. This is most likely because the IsPlayerActionActive function was intended for NPC dialogue commenting on the player's actions (e.g., when the player takes a test shot in the middle of town), which would be out of place in the middle of combat. An alternative is to use FOSE to check IsControlPressed for the Block/Aim control.

See Also