This is what I would want to know:
Is a database really needed to store it all? Or is there an other way to store it? Maybe an object the PC's gain on enter?
I would appreciate any information I can get
Eh?SuperFly_2000 wrote...
I noticed one thing...that closing down the server window while NWNX was running was not a good idea. NWNX would treat that situation like a "crash" and some data would be lost.
Then I recomend to close down NWNX first...then the server...then start NWNX again and let it start up the server as usual. We had no losses using this way...
Modifié par SuperFly_2000, 17 septembre 2010 - 10:42 .
I don't really know, its possible, or maybe it does not matter really. Im not such expert on NWNX to tell you.SuperFly_2000 wrote...
Shadoow, you have to agree with me however that NWNX does record closing down the window as a server crash.
if(!GetLocalInt(oPC,"FirstTime"))
{
SetLocalInt(oPC,"FirstTime",TRUE);
//add lines below this comment for anything that is required to make a first time after restart
}
if(GetXP(oPC) == 0)
{
//add here
}
//OnEnter script
void main()
{
//Player is the entering object.
object oPC = GetEnteringObject();
//The DB item we will check for. This uses the tag of item.
object oDBItem = GetItemPossessedBy(oPC, "Tag Of DB Item Here");
//If not a player or is a DM then end.
if (!GetIsPC(oPC) || GetIsDM(oPC)) return;
//If the player does NOT have the DB item...
if (oDBItem == OBJECT_INVALID)
//create a DB item on the player. This uses the res ref of the item. Not tag.
CreateItemOnObject("res ref of DB item", oPC);
}
//example set mining skill script
void main()
{
//The player. Will need to be defined for your purpose. In this case it is the
//last user of a placeable.
object oPC = GetLastUsedBy();
//The DB item the player has. Checks the tag.
object oDBItem = GetItemPossessedBy(oPC, "TAG Of Item Here");
//Get current integer for "MINING_SKILL"
int iSkill = GetLocalInt(oDBItem, "MINING_SKILL");
//Set the new integer for "MINING_SKILL". In this case is the current amount +5
//You can change the 5 to however much you want to increase the skill.
SetLocalInt(oDBItem, "MINING_SKILL", iSkill + 5);
}
Modifié par GhostOfGod, 17 septembre 2010 - 08:41 .
TheSpiritedLass wrote...
Perhaps a silly question here, but to write to the database are you using things like SetLocalInt or SetCampaignInt? If you are using SetLocalInt, that could be the problem. Those database writes do not last across a server reset, only a player relog. Writes using SetCampaignInt remain across server resets.
-- Mistress