HorseInstantMount

From NWN Lexicon

Contents

[edit] HorseInstantMount(object, int, int, string)

Change a creature to a mounted appearance instantly.

void HorseInstantMount(
    object oRider,
    int nTail,    
    int bJoust = FALSE,    
    string sRefRes = ""
);

[edit] Parameters

oRider

The creature who is to have a mounted appearance.

nTail

The tail to be given to the creature (to resemble a horse).

bJoust

If TRUE, the rider will adopt the jousting posture, rather than the normal riding posture. (Default: FALSE)

sResRef

If specified, the resref to be used to create the horse when the rider dismounts. (Default: "")


[edit] Description

This function is primarily supplied for cutscenes and other instances where you simply need the rider to be switched to mounted mode as quickly as possible without creating a horse or preserving any horse system variables.

The function does not check whether someone meets the criteria to mount, or if they are already mounted.

It will simply set them to the proper appearance and mode.

Bioware recommends that this function only be used in conjunction with HorseInstantDismount() .



[edit] Remarks

In effect, this causes the rider to be mounted without having to create a horse object first.

If the rider is already mounted, the old mount will be destroyed.

The specified tail must correspond to a valid horse appearance - there is no default. HorseMount with the "instant" option is speed - it's executed immediately, so you don't have to wait for horse spawning or the action queue.


[edit] Requirements

#include " x3_inc_horse "

[edit] Version

1.69

[edit] Example

// This script will mount the PC on a horse which looks like a pre-defined horse oHorse, which could be anywhere in the module.
#include "x3_inc_horse"
 
void main()
{
  // Note:  The use of GetFirstPC() is not multiplayer friendly.
  object oPC    = GetFirstPC();
  object oHorse = GetObjectByTag("enter tag of an existing horse here");
 
  HorseInstantMount(oPC, HorseGetMountTail(oHorse));
}

[edit] See Also

functions: 

HorseMount



author: Proleric, editor: Mistress

Personal tools
Categories