GenMalfunction / world-of-sanctuary

Project to fix bugs and add enhancements to Diablo2-NWN mod Diablo Lord of Destruction
2 stars 0 forks source link

fix persistent chest to prevent overflow dropping items on the ground #3

Closed GenMalfunction closed 3 years ago

GenMalfunction commented 3 years ago

When players put too many items in their Persistent Chest, the script simply drops random overflow items on the ground next to the chest, with no other indication of why.

GenMalfunction commented 3 years ago

CREDIT: L0BSTER suggested code changes to address / limit the impact of this issue.

Compute platform used to run module may mitigate the issue somewhat; however, frequently when this version of "persistent chest" script is used, items stored in excess of ~75 to ~80 won't go into the chest. Instead, they are left in a pile on the ground after PC closes the chest.

To limit the impact, we will set a hard limit of 80 items. Further, we will issue a "floating text" message informing PC how many items are stored in the chest each time it is closed.

sfpb_config: ... const int MAX_ITEMS = 80; // default is 100 ...

sfpb_close: ... (starting at approximately line 90, insert the following) // testing flyover text announcing number of items stored, and capacity string sCheck = IntToString(nCount); FloatingTextStringOnCreature("" + sCheck +"/80"+ " items stored successfully!", oPC); // end_test ...

GenMalfunction commented 3 years ago

target v1.4.1 for validation during beta

GenMalfunction commented 3 years ago

verified works!