EffectMovementSpeedIncrease(int)

From NWN Lexicon
Jump to: navigation, search

Create a Movement Speed Increase effect to speed target movement rate.

effect EffectMovementSpeedIncrease(
    int nPercentChange
);

Parameters

nPercentChange
Percentage change in movement speed

Description

Returns a new effect object that when applied to a target will speed their rate of movement by nPercentChange percent.

nPercentChange can be from -99 to 99.

-99 = almost twice as slow
-50 = 50% slower
0 = no change in speed
50 = 50% faster
99 = almost twice as fast

Effect also handles passing values over 100 but they work the same. (In fact, engine adds 100 to every value lower than 100.)

The target this effect is applied to must be a creature for it to work. This effect should not be applied instantly, only temporarily or permanently.

Remarks

This effect is not stopped with immunity to movement speed decreases. It can be used with negative value to create a slowing effect which will ignore all immunities.

This will stack and hinder people more with Haste and other movement speed increases - the movement speed decreases and slow will merely cancel each other out (thus you walk/run at normal speed with both haste and slow on you).

A quick note is that all PC movement rates are 2.00, as defined in CreatureSpeed.2da. That is their walkrate, their runrate is 4.00. This is the amount of distance, in meters, they can cover in one second.

There is no way to directly change a PC's movement speed (say, to 5.00 meters a round). You can make them up to almost immobile, to 99% faster.

Effect functions are Constructors, which are special methods that help construct effect "objects". You can declare and link effects, and apply them using an ApplyEffectToObject() Command. Once applied, each effect can be got separately via looping valid effects on the target (GetFirst/NextEffect()). See the Effect tutorial for more details.

There apparently is also a hard cap of 150% for the comination of movement from this and other things like Haste, Barbarian Movement Speed and Monk Movement Speed bonuses.

Cutscene Remarks

Cutscene speed is pre-set (and likely removes the Monk and Barbarian speeds) since the "camera" is the player themselves. In cases you need to alter this speed use SetCutsceneCameraMoveRate not this effect.

Version

1.62

Example

// Sample code for applying a 50% movement speed increase
// bonus to a target
 
void main()
{
    // This is the Object to apply the effect to.
    object oTarget = OBJECT_SELF;
 
    // Create the effect to apply
    effect eGoFast = EffectMovementSpeedIncrease(50);
 
    // Create the visual portion of the effect. This is instantly
    // applied and not persistent with whether or not we have the
    // above effect.
    effect eVis = EffectVisualEffect(VFX_IMP_HASTE);
 
    // Apply the visual effect to the target
    ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
    // Apply the effect to the object
    ApplyEffectToObject(DURATION_TYPE_PERMANENT, eGoFast, oTarget);
}

See Also

functions:  EffectMovementSpeedDecrease


 author: John Shuell, editors: Jasperre, Mistress, additional contributor: Jasperre