HorseGetMountFailureMessage

From NWN Lexicon
Jump to: navigation, search


HorseGetMountFailureMessage(object, object)

Obtain the horse mount error message.

string HorseGetMountFailureMessage(
    object oHorse,
    object oRider = OBJECT_INVALID
);

Parameters

oHorse

The horse to be mounted.

oRider

If specified, the rider who will mount.


Description

This is a companion function to HorseGetCanBeMounted , if you need a text message that explains why the horse cannot be mounted.



Remarks

A null string is returned if no failure is detected.

The parameters need to be identical to the HorseGetCanBeMounted call.

This function does not check that the rider has the Mount Actions feat.


Requirements

#include " x3_inc_horse "

Version

1.69

Example

// Called from a conversation.  Attempts to have a PC mount the horse specified by the tag.
// If the horse can not be mounted, the failure message is sent to the PC.  	
 
#include "x3_inc_horse"
void main()
{
  object oPC = GetPCSpeaker(); 
  object oHorse = GetObjectByTag("tag of an existing horse");
 
  if(HorseGetCanBeMounted(oHorse, oPC))
  {
    AssignCommand(oPC, HorseMount(oHorse));
  }    
  else
  {
    SendMessageToPC(oPC, HorseGetMountFailureMessage(oHorse, oPC));
  }
}

See Also

functions: 

HorseMount



author: Proleric, editor: Mistress