Now I know its possible to stop this, and for the item duplication to be prevented some how, becos others have done it, I just dont know how as I am not a scriptor. Does anyone know how to solce this issue?
Here is one thing you may find interresting that I noticed while playing around with these scripts and testing. I took these scripts and placed them on a chest, then put that chest inside a brand new area of some kind. Then I took Vordons Hero Creator, and put the same chest with the same scripts, and placed it near the beginning starting point in vordons hero creator and tested both chests with a bag filled with items. In the new area, when a bag was placed into the chest, it duplicated every item inside the bag stored inside that chest. Oddly enough, when i placed a similar bag with the same items into a chest with these same scripts, into the chest that I added to the Vordons Hero Creator mod, no items were duplicated at all. Something, some code of some kind in vordons hero creator, prevents item duplication when a bag/container is stored inside a persistant chest storage containter, but as I am not a scriptor ........ I dont know what to look for to be able to spot it so I can add it to these scripts properlly to be able to solve this item duplication issue. And I would love to find it and then give credit to whoever has the answer and post this on the NWN2 vault for others to benefit from.
here are the 3 scripts:
----------------------------------------------------------------------------------------
chest_close to be put on the On Closed line;
void main()
{
int i=1;
object item=GetFirstItemInInventory(OBJECT_SELF);
while (GetIsObjectValid(item))
{
if (GetLocalInt(item,"added"))
{
string index="item"+IntToString(i)+GetTag(OBJECT_SELF);
StoreCampaignObject("chest_persistence",index,item,OBJECT_SELF);
DestroyObject(item);
i++;
}
item=GetNextItemInInventory(OBJECT_SELF);
}
}
-----------------------------------------------------------------------------------
chest_disturbed to be put on the On Disturbed line;
void main()
{
object item=GetInventoryDisturbItem();
int type=GetInventoryDisturbType();
if (type==INVENTORY_DISTURB_TYPE_ADDED)
SetLocalInt(item,"added",1);
else
DeleteLocalInt(item,"added");
}
-----------------------------------------------------------------------------------
chest_open to be put on ther On Open line;
void main()
{
int i=1;
object item;
do
{
string index="item"+IntToString(i)+GetTag(OBJECT_SELF);
item=RetrieveCampaignObject("chest_persistence",index,
GetLocation(OBJECT_SELF),OBJECT_SELF,OBJECT_SELF);
SetLocalInt(item,"added",1);
DeleteCampaignVariable("chest_persistence",index,OBJECT_SELF);
i++;
}
while (GetIsObjectValid(item));
}
-----------------------------------------------------------------------------------
Please if you have any suggestions or answer any of you have, help would be appreciated
FE
Modifié par FallenExarch, 09 novembre 2010 - 06:26 .





Retour en haut






