GetMovementRate(object)

From NWN Lexicon
Jump to: navigation, search

Returns the movement rate of a game being

int GetMovementRate(
    object oCreature
);

Parameters

oCreature
Creature whose movement rate to return

Description

Gets the movement rate of a being, either a PC or an NPC. The possible return values are:

  • 0 = PC Movement Speed or invalid oCreature
  • 1 = Immobile
  • 2 = Very Slow
  • 3 = Slow
  • 4 = Normal
  • 5 = Fast
  • 6 = Very Fast
  • 7 = Creature Default (defined in appearance.2da) - should never return this since it does a lookup to find the value it is set to
  • 8 = DM Speed

Remarks

This cannot be used to determine if a PC (Or any other creature) is walking or running as a PC always returns a value of 0.

When a henchman is added to a PC, or a summon/familiar/animal companion is gained, they seem to obtain "PC speed" ie value 0 (which isn't removed when they are fired oddly). This only seems to occur if they are "Normal" speed or lower. It appears to be the only time NPC creature speeds are set apart from on spawn.

Any creature set to "Immobile" has similar properties to being flat footed - as in they can't use their legs - and the engine makes sure they don't do any combat movement (similar to EffectEntangle).

DM's should always return 8, since they gain this movement speed when they log in.

This value is basically that set in a creatures properties. The Creature Default can only be got by the value in appearance.2da, while the others are in creaturespeed.2da:

     Label       Name   2DAName  WALKRATE RUNRATE
0    PC_Movement ****   PLAYER     2.00      4.00
1    Immobile    2319   NOMOVE     0.00      0.00
2    Very_Slow   2320   VSLOW      0.75      1.50
3    Slow        2321   SLOW       1.25      2.50
4    Normal      2322   NORM       1.75      3.50
5    Fast        2323   FAST       2.25      4.50
6    Very_Fast   2324   VFAST      2.75      5.50
7    Default     6614   DEFAULT    0.00      0.00
8    DM_Fast     6893   DFAST      5.50     11.00

Version

1.22

See Also



 author: Drake Coker, editor: Jasperre