StoreCampaignDBObject

From NWN Lexicon


Contents

[edit] StoreCampaignDBObject(object, string, object)

Store a campaign object on a player in the default database for this module.

void StoreCampaignDBObject(
    object oPC,
    string sVarname,
    object value
);

[edit] Parameters

oPC

Player this variable is attached to.

sVarname

Name of the variable to store.

value

The object to store to the database.


[edit] Description

Store a campaign object on a player in the default database for this module.

NOTE: This does not store a reference, it stores the entire actual object, including all of its inventory. Storing many objects can be highly resource intensive! It should NOT be used like GetLocalObject .



[edit] Remarks

This is a wrapper for GetCampaignDBName as the first parameter.


[edit] Requirements

#include " x0_i0_campaign "


[edit] Version

???

[edit] Example

// Check if we have armor on and if so store it to the database.
#include "x0_i0_campaign"
 
void main()
{
    // Get what armor the calling object is currently wearing.
    object oArmor = GetItemInSlot(INVENTORY_SLOT_CHEST, OBJECT_SELF);
 
    // Validate we found some armor.
    if(TRUE == GetIsObjectValid(oArmor))
    {
        StoreCampaignDBObject(OBJECT_SELF, "CURRENT_ARMOR", oArmor);
    }
}

[edit] See Also

functions: 

StoreCampaignObject



author: Baragg, editor: Mistress

Personal tools
Categories