HorseGetHorse

From NWN Lexicon


Contents

[edit] HorseGetHorse(object, int)

Retrieves the horses owned by a creature.

object HorseGetHorse(
    object oRider,
    int nN = 1
);

[edit] Parameters

oRider

The object that might own horses.

nN

The Nth horse owned may be requested. (Default: 1)


[edit] Description

This function will return the Nth horse owned by the target.



[edit] Remarks

Returns OBJECT_INVALID if fewer than nN horses are owned.

If the target is mounted, the horse they are riding doesn't count, because it doesn't exist as a horse object. The function will only return the owner's dismounted horses.


[edit] Requirements

#include " x3_inc_horse "

[edit] Version

1.69

[edit] Example

// This example actions the PC to mount the first horse which they own.
#include "x3_inc_horse"
 
 
void main()
{
  object oPC = GetEnteringObject();
 
  object oHorse = HorseGetHorse(oPC);
 
  if(GetIsObjectValid(oHorse))
  { 
    AssignCommand(oPC, HorseMount(oHorse));
  }  
}

[edit] See Also

functions: 

HorseGetOwner



author: Proleric, editor: Mistress

Personal tools
Categories