Difference between revisions of "Action"

From NWN Lexicon
Jump to: navigation, search
(Constants)
Line 1: Line 1:
 
{{DISPLAYTITLE:ACTION_* Constant Group}}
 
{{DISPLAYTITLE:ACTION_* Constant Group}}
{{stub|the table needs a link to the Action* functions that result in the constants listed here.}}
 
 
Constants representing standard actions that objects can perform.
 
Constants representing standard actions that objects can perform.
 +
 +
Note there are several things that would be considered "actions" that cannot be detected by this, especially since ACTION_INVALID can be returned in a lot of cases.
 +
 +
For some stances (Parry, Defensive Casting, etc.) see relevant stance functions.
  
 
==Constants==
 
==Constants==
Line 9: Line 12:
 
! style="text-align: left;" | Constant
 
! style="text-align: left;" | Constant
 
! style="text-align: left;" width="60" | Value
 
! style="text-align: left;" width="60" | Value
 +
! style="text-align: left;" | Function
 
! style="text-align: left;" class="unsortable" | Description
 
! style="text-align: left;" class="unsortable" | Description
 
|-
 
|-
 
| ACTION_ANIMALEMPATHY
 
| ACTION_ANIMALEMPATHY
 
| 16
 
| 16
| UNKNOWN
+
| [[ActionUseSkill]]([[Skill|SKILL_ANIMAL_EMPATHY]], oAnimal)
 +
| When using the Animal Empathy skill
 
|-
 
|-
 
| ACTION_ATTACKOBJECT
 
| ACTION_ATTACKOBJECT
 
| 3
 
| 3
| UNKNOWN
+
| [[ActionAttack]]
 +
| Attacking an object. Could be ranged, melee, or even potentially a special attack since hardly any are listed here (only Ki Damage and Smite Evil for some reason).
 
|-
 
|-
 
| ACTION_CASTSPELL
 
| ACTION_CASTSPELL
 
| 4
 
| 4
| UNKNOWN
+
| [[ActionCastSpellAtObject]] or [[ActionCastSpellAtLocation]] or appropriate talent found.
 +
| Given feat usage isn't categorised here it could also return for ActionUseFeat(). Needs further testing.
 
|-
 
|-
 
| ACTION_CLOSEDOOR
 
| ACTION_CLOSEDOOR
 
| 6
 
| 6
| UNKNOWN
+
| [[ActionCloseDoor]]
 +
| Closing a door
 
|-
 
|-
 
| ACTION_COUNTERSPELL
 
| ACTION_COUNTERSPELL
 
| 31
 
| 31
| UNKNOWN
+
| [[ActionCounterSpell]]
 +
| Counter spelling a target creature
 
|-
 
|-
 
| ACTION_DIALOGOBJECT
 
| ACTION_DIALOGOBJECT
 
| 7
 
| 7
| UNKNOWN
+
| [[ActionStartConversation]]
 +
| This is when in a conversation. Note PC's can functionally move during these so unknown what they return if also moving to a point (in fact NPCs can do some actions during conversation too...).
 
|-
 
|-
 
| ACTION_DISABLETRAP
 
| ACTION_DISABLETRAP
 
| 8
 
| 8
| UNKNOWN
+
| [[ActionUseSkill]]([[Skill|SKILL_DISABLE_TRAP]], oTrap)
 +
| Disabling a trap
 
|-
 
|-
 
| ACTION_DROPITEM
 
| ACTION_DROPITEM
 
| 2
 
| 2
| UNKNOWN
+
| [[ActionPutDownItem]]
 +
| Putting down an item
 
|-
 
|-
 
| ACTION_EXAMINETRAP
 
| ACTION_EXAMINETRAP
 
| 11
 
| 11
| UNKNOWN
+
| [[ActionUseSkill]]([[Skill|SKILL_DISABLE_TRAP]], oTrap, [[SUBSKILL|SUBSKILL_EXAMINETRAP]])
 +
| Examining a trap.
 
|-
 
|-
 
| ACTION_FLAGTRAP
 
| ACTION_FLAGTRAP
 
| 10
 
| 10
| UNKNOWN
+
| [[ActionUseSkill]]([[Skill|SKILL_DISABLE_TRAP]], oTrap, [[SUBSKILL|SUBSKILL_FLAGTRAP]])
 +
| Flagging a trap.
 
|-
 
|-
 
| ACTION_FOLLOW
 
| ACTION_FOLLOW
 
| 35
 
| 35
| UNKNOWN
+
| [[ActionForceFollowObject]]
 +
| This is usually present until cleared or interrupted.
 
|-
 
|-
 
| ACTION_HEAL
 
| ACTION_HEAL
 
| 33
 
| 33
| UNKNOWN
+
| [[ActionUseSkill]]([[Skill|SKILL_HEAL]], oToHeal, 0, oHealingKit)
 +
| Healing using a healing kit
 
|-
 
|-
 
| ACTION_INVALID
 
| ACTION_INVALID
 
| 65535
 
| 65535
| This fires for a lot of things, such as a player using WASD movement.
+
| Many! Most other actions.
 +
| This fires for a lot of things, such as a player using WASD movement and possibly other actions not listed on this page.
 
|-
 
|-
 
| ACTION_ITEMCASTSPELL
 
| ACTION_ITEMCASTSPELL
 
| 19
 
| 19
| UNKNOWN
+
| Appropriate talent that returns an item to use.
 +
| Scrolls, wands, magical items which can cast spells.
 
|-
 
|-
 
| ACTION_KIDAMAGE
 
| ACTION_KIDAMAGE
 
| 41
 
| 41
| UNKNOWN
+
| [[ActionUseFeat]]([[Feat|FEAT_KI_DAMAGE]], oTarget)
 +
| Ki Damage feat
 
|-
 
|-
 
| ACTION_LOCK
 
| ACTION_LOCK
 
| 14
 
| 14
| UNKNOWN
+
| [[ActionLockObject]] or [[ActionUseSkill]]([[Skill|SKILL_OPEN_LOCK]], oDoorOrPlaceable)
 +
| The second one may not work, depending on the circumstance (while the skill is called Open Lock, it is also used for locking).
 
|-
 
|-
 
| ACTION_MOVETOPOINT
 
| ACTION_MOVETOPOINT
 
| 0
 
| 0
| This is specifically moving to a clicked point it seems, since it uses ACTION_INVALID if the player is using WASD movement.
+
| [[ActionMoveToObject]] [[ActionMoveToLocation]]
 +
| This is specifically moving to a clicked point it seems, since it uses ACTION_INVALID if the player is using WASD movement. No idea if [[ActionMoveAwayFromLocation]] or [[ActionMoveAwayFromObject]] trigger it.
 
|-
 
|-
 
| ACTION_OPENDOOR
 
| ACTION_OPENDOOR
 
| 5
 
| 5
| UNKNOWN
+
| [[ActionOpenDoor]]
 +
| Opening a door.
 
|-
 
|-
 
| ACTION_OPENLOCK
 
| ACTION_OPENLOCK
 
| 13
 
| 13
| UNKNOWN
+
| [[ActionUseSkill]]([[Skill|SKILL_OPEN_LOCK]], oLockedObject)
 +
| Opening a lock on a door or placeable.
 
|-
 
|-
 
| ACTION_PICKPOCKET
 
| ACTION_PICKPOCKET
 
| 34
 
| 34
| UNKNOWN
+
| [[ActionUseSkill]]([[Skill|SKILL_PICK_POCKET]], oPickPocketTarget)
 +
| Picking someones pocket. Nice gems you have, shame if someone snatched them from you...
 
|-
 
|-
 
| ACTION_PICKUPITEM
 
| ACTION_PICKUPITEM
 
| 1
 
| 1
| UNKNOWN
+
| [[ActionPickUpItem]]
 +
| Picking up an item (may include walking to it first)
 
|-
 
|-
 
| ACTION_RANDOMWALK
 
| ACTION_RANDOMWALK
 
| 43
 
| 43
 +
| [[ActionRandomWalk]]
 
| This was added in the Hordes sets of patches. It is the value associated with [[ActionRandomWalk]](). Note: In pre-1.64 patches, it referenced the wrong line in the actions.2da file, but it has now been corrected.
 
| This was added in the Hordes sets of patches. It is the value associated with [[ActionRandomWalk]](). Note: In pre-1.64 patches, it referenced the wrong line in the actions.2da file, but it has now been corrected.
 
|-
 
|-
 
| ACTION_RECOVERTRAP
 
| ACTION_RECOVERTRAP
 
| 9
 
| 9
| UNKNOWN
+
| [[ActionUseSkill]]([[Skill|SKILL_DISABLE_TRAP]], oTrap, [[SUBSKILL|SUBSKILL_RECOVERTRAP]])
 +
| Recovering a trap.
 
|-
 
|-
 
| ACTION_REST
 
| ACTION_REST
 
| 17
 
| 17
| UNKNOWN
+
| [[ActionRest]]
 +
| NB: Only Henchmen tends to "sit and rest" when this is called on them so very unlikely to find this outside of PCs and henchmen.
 
|-
 
|-
 
| ACTION_SETTRAP
 
| ACTION_SETTRAP
 
| 12
 
| 12
| UNKNOWN
+
| Currently no action functions.
 +
| NPC's can't use [[ActionUseSkill]] but a future action to use item properties is coming. PCs can select this action from the radial menus.
 
|-
 
|-
 
| ACTION_SIT
 
| ACTION_SIT
 
| 37
 
| 37
| UNKNOWN
+
| [[ActionSit]]
 +
| Sitting on an object.
 
|-
 
|-
 
| ACTION_SMITEGOOD
 
| ACTION_SMITEGOOD
 
| 40
 
| 40
| UNKNOWN
+
| [[ActionUseFeat]]([[Feat|FEAT_SMITE_GOOD]]) (and probably [[Feat|FEAT_SMITE_EVIL]])
 +
| Extra damage against certain alignments.
 
|-
 
|-
 
| ACTION_TAUNT
 
| ACTION_TAUNT
 
| 18
 
| 18
| UNKNOWN
+
| [[SetActionMode]]([[Action mode|ACTION_MODE_PARRY]] is probably best here.
 +
| If a creature is currently taunting. Can also be found using [[GetActionMode]] (which is probably more reliable).
 
|-
 
|-
 
| ACTION_USEOBJECT
 
| ACTION_USEOBJECT
 
| 15
 
| 15
| UNKNOWN
+
| [[ActionUseObject]]
 +
| "Use" and object, may include walking up to it first.
 
|-
 
|-
 
| ACTION_WAIT
 
| ACTION_WAIT
 
| 36
 
| 36
| UNKNOWN
+
| [[ActionWait]]
 +
| Used purely on NPCs. This is the way to put a delay between two actions firing.
 
|}
 
|}
  

Revision as of 17:15, 5 July 2020

Constants representing standard actions that objects can perform.

Note there are several things that would be considered "actions" that cannot be detected by this, especially since ACTION_INVALID can be returned in a lot of cases.

For some stances (Parry, Defensive Casting, etc.) see relevant stance functions.

Constants

Constant Value Function Description
ACTION_ANIMALEMPATHY 16 ActionUseSkill(SKILL_ANIMAL_EMPATHY, oAnimal) When using the Animal Empathy skill
ACTION_ATTACKOBJECT 3 ActionAttack Attacking an object. Could be ranged, melee, or even potentially a special attack since hardly any are listed here (only Ki Damage and Smite Evil for some reason).
ACTION_CASTSPELL 4 ActionCastSpellAtObject or ActionCastSpellAtLocation or appropriate talent found. Given feat usage isn't categorised here it could also return for ActionUseFeat(). Needs further testing.
ACTION_CLOSEDOOR 6 ActionCloseDoor Closing a door
ACTION_COUNTERSPELL 31 ActionCounterSpell Counter spelling a target creature
ACTION_DIALOGOBJECT 7 ActionStartConversation This is when in a conversation. Note PC's can functionally move during these so unknown what they return if also moving to a point (in fact NPCs can do some actions during conversation too...).
ACTION_DISABLETRAP 8 ActionUseSkill(SKILL_DISABLE_TRAP, oTrap) Disabling a trap
ACTION_DROPITEM 2 ActionPutDownItem Putting down an item
ACTION_EXAMINETRAP 11 ActionUseSkill(SKILL_DISABLE_TRAP, oTrap, SUBSKILL_EXAMINETRAP) Examining a trap.
ACTION_FLAGTRAP 10 ActionUseSkill(SKILL_DISABLE_TRAP, oTrap, SUBSKILL_FLAGTRAP) Flagging a trap.
ACTION_FOLLOW 35 ActionForceFollowObject This is usually present until cleared or interrupted.
ACTION_HEAL 33 ActionUseSkill(SKILL_HEAL, oToHeal, 0, oHealingKit) Healing using a healing kit
ACTION_INVALID 65535 Many! Most other actions. This fires for a lot of things, such as a player using WASD movement and possibly other actions not listed on this page.
ACTION_ITEMCASTSPELL 19 Appropriate talent that returns an item to use. Scrolls, wands, magical items which can cast spells.
ACTION_KIDAMAGE 41 ActionUseFeat(FEAT_KI_DAMAGE, oTarget) Ki Damage feat
ACTION_LOCK 14 ActionLockObject or ActionUseSkill(SKILL_OPEN_LOCK, oDoorOrPlaceable) The second one may not work, depending on the circumstance (while the skill is called Open Lock, it is also used for locking).
ACTION_MOVETOPOINT 0 ActionMoveToObject ActionMoveToLocation This is specifically moving to a clicked point it seems, since it uses ACTION_INVALID if the player is using WASD movement. No idea if ActionMoveAwayFromLocation or ActionMoveAwayFromObject trigger it.
ACTION_OPENDOOR 5 ActionOpenDoor Opening a door.
ACTION_OPENLOCK 13 ActionUseSkill(SKILL_OPEN_LOCK, oLockedObject) Opening a lock on a door or placeable.
ACTION_PICKPOCKET 34 ActionUseSkill(SKILL_PICK_POCKET, oPickPocketTarget) Picking someones pocket. Nice gems you have, shame if someone snatched them from you...
ACTION_PICKUPITEM 1 ActionPickUpItem Picking up an item (may include walking to it first)
ACTION_RANDOMWALK 43 ActionRandomWalk This was added in the Hordes sets of patches. It is the value associated with ActionRandomWalk(). Note: In pre-1.64 patches, it referenced the wrong line in the actions.2da file, but it has now been corrected.
ACTION_RECOVERTRAP 9 ActionUseSkill(SKILL_DISABLE_TRAP, oTrap, SUBSKILL_RECOVERTRAP) Recovering a trap.
ACTION_REST 17 ActionRest NB: Only Henchmen tends to "sit and rest" when this is called on them so very unlikely to find this outside of PCs and henchmen.
ACTION_SETTRAP 12 Currently no action functions. NPC's can't use ActionUseSkill but a future action to use item properties is coming. PCs can select this action from the radial menus.
ACTION_SIT 37 ActionSit Sitting on an object.
ACTION_SMITEGOOD 40 ActionUseFeat(FEAT_SMITE_GOOD) (and probably FEAT_SMITE_EVIL) Extra damage against certain alignments.
ACTION_TAUNT 18 SetActionMode(ACTION_MODE_PARRY is probably best here. If a creature is currently taunting. Can also be found using GetActionMode (which is probably more reliable).
ACTION_USEOBJECT 15 ActionUseObject "Use" and object, may include walking up to it first.
ACTION_WAIT 36 ActionWait Used purely on NPCs. This is the way to put a delay between two actions firing.

See Also

functions:  GetCurrentAction