HorseInstantMount(object, int, int, string)

Change a creature to a mounted appearance instantly.

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

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: "")


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().

The ResRef is provided only in case you use HorseDismount() instead of using HorseInstantDismount().



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. HorseGetMountTail will provide the tail value for an existing horse that you want to use as a template.

If a resref is specified, on dismount using HorseDismount a horse object is created from that template - otherwise, the rider can never dismount (an attempt to do results in feedback "target is not mounted"). So, the module builder must ensure that HorseDismount is called before the end of the cutscene if the horse is to be available for general use thereafter. If an instant dismount is requested via HorseInstantDismount as recommended, the horse vanishes, regardless of the sResRef setting.

The advantage of this function over 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.


Requirements

#include "x3_inc_horse"

Version

1.69

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));
}
	

See Also

functions:  HorseInstantDismount | HorseGetMountTail | HorseCreateHorse | HorseSetPhenotype | HorseGetIsMounted | HorseMount
categories:  Horse Functions


author: Proleric, editor: Mistress