Also, how do you update items in the game that are in the possession of players? A couple examples of what I'm talking about:
1.) I had a necklace on a vendor that I changes some properties on. But, the ones bought by the players before the update were unchanged. I wanted the purchased items to update too.
2.) I am giving out a book item that has all the credits for people that helped me when the player logs in for the first time. I added more credits to the book's description in the toolset, but they didn't update the ones already in the players possession. Same thing as #1, just a different item.
Credit to whomever mentioned the script for greater restoration (nw_s0_grrestore). This is the loop within that script that scans thru all the effects on the target and removes them if they are in the list. I think a lot of rest scripts do a similar thing but just remove any effect where GetEffectDurationType(eEffect) == DURATION_TYPE_TEMPORARY. But that will also removes beneficial stuff.
2. Updating items players already have:
Right, so updating the blueprint doesn't change what players already have.
You could check somewhere (e.g. OnModuleEnter) if they have the thing, destroy it and give them another one.
object oPC = GetEnteringObject();
object oExchange;
oExchange = GetItemPossessedBy(oPC,"OLD_ITEM_TAG");
if( oExchange != OBJECT_INVALID )
{
//In the toolset, you should give the new versions a new TAG.
//Otherwise, this script destroys it regardless everytime they join.
CreateItemOnObject(GetResRef(oExchange),oPC);
DestroyObject(oExchange);
}
//Repeat the process for the other item.
oExchange = GetItemPossessedBy(oPC,"OLD_CREDIT_BOOK_TAG");
if( oExchange != OBJECT_INVALID )
{
CreateItemOnObject(GetResRef(oExchange),oPC);
DestroyObject(oExchange);
}
Players can put items in chests, of course, or drop them, or sell them, so the safest method is to cycle through all item instances using GetObjectByTag, applying the change.
Comments
1.) I had a necklace on a vendor that I changes some properties on. But, the ones bought by the players before the update were unchanged. I wanted the purchased items to update too.
2.) I am giving out a book item that has all the credits for people that helped me when the player logs in for the first time. I added more credits to the book's description in the toolset, but they didn't update the ones already in the players possession. Same thing as #1, just a different item.
2. Updating items players already have:
Right, so updating the blueprint doesn't change what players already have.
You could check somewhere (e.g. OnModuleEnter) if they have the thing, destroy it and give them another one.