HorseReloadFromDatabase

From NWN Lexicon

Contents

[edit] HorseReloadFromDatabase(object, string)

Reload horse system from database.

[edit] Parameters

oPC

The PC whose horses are to be reloaded.

sDatabase

The data base name.


[edit] Description

This function is provided for use with an OnClientEnter script when you are using a persistent world type environment and need the PC's mounted state reloaded.

It will also make sure that henchmen for the PC are also restored as they were.



[edit] Requirements

#include " x3_inc_horse "

[edit] Version

1.69

[edit] Example

// A simple OnClientEnter script.
// Refer to x3_mod_def_enter for the standard code.
// The delay required on the data base load may vary by PW.
#include "x3_inc_horse"
 
 
void main()
{
    object oPC = GetEnteringObject();
 
    if((GetIsPC(oPC) || GetIsDM(oPC)) && !GetHasFeat(FEAT_HORSE_MENU, oPC))
    { 
        // add horse menu 
        HorseAddHorseMenu(oPC);
        if(GetLocalInt(GetModule(),"X3_ENABLE_MOUNT_DB"))
        { 
           // restore PC horse status from database
           DelayCommand(5.0, HorseReloadFromDatabase(oPC, X3_HORSE_DATABASE));
        } 
    } 
}

[edit] See Also

functions: 

HorseSaveToDatabase



author: Proleric, editor: Mistress

Personal tools
Categories