the Sim Settlements forums!

Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Fixed 3.1.6

wim95

Active Member
Verified Builder
Messages
98
I donated everything in the inventory. As it turned out later there were 12,428 items of 453 types. And got CTD. In log dumping stack.
I tried to donate in small portions. But after closing the inventory, I could press Donate again. And again, and again, ... And got CTD. In log dumping stack.
I tried doing the same after receiving the message about settlers happy with donations. And again, and again, ... And got CTD. In log dumping stack.
I decompiled CitySupplies.pex and added BlockActivation.
I donated everything in the inventory. Sometimes CTD. Sometimes no CTD, but in log dumping stack. Sorting of inventory took more than 30 minutes.
I changed a lot in the script and here is the result

Now I can donate everything in the inventory. No CTD. No dumping stack in log. Message about happy settlers after sorting all items. Sorting of 12,428 items of 453 types took less than 10 minutes.

If anyone wants to test this file you can install it as a mod.
 

Attachments

  • SimSettlements_CitySupplies.7z
    14.9 KB · Views: 26
Better to let me integrate the changes than have others using this script. Otherwise I lose the ability to add new functionality.
 
Yes, of course. Integration is best. That's exactly what I was thinking when I uploaded the file.

This version of the script works well for me. How it works for others that is the question. Just offered to test those who are want and able to confirm.

PSC file included in the archive.
I think it's best to copy back to SimParentScript the modified version of function ProcessDonatedItem. I copied the function only in order not to mess with the two scripts files.
 
I'm going to have to take your general idea and apply it - the decompile isn't perfect and I don't want to overwrite my own comments.

What were your general findings that were causing the issue?
 
What were your general findings that were causing the issue?
Too many events OnItemAdded after RemoveAllItems in Function ProcessDonations. In addition, when you add a stack of items to inventory, the game tries to add them one by one. For example, a stack of 10 items added by 1 item, 1 item, 1 item, 7 items. This causes an even greater number of events OnItemAdded. The script system is overloaded and causes dumping stack, then CTD.

Removal of many items one by one without delay causes overload in my PC. Need a Utility.Wait after each removal.

Other changes attempt to speed up the process. Waiting for 30 minutes too long.
 
Awesome - thank you! Will get this implemented for next week's patch.
 
yeah I usually donate in huge batches and always got ctd to get around this I would use the salvage beacon to donate huge amounts of stuff
 
In addition, when you add a stack of items to inventory, the game tries to add them one by one. For example, a stack of 10 items added by 1 item, 1 item, 1 item, 7 items.
I just wrote a few posts elsewhere about this, but I though I'd explain this here too.

This is because the apparent stack of 10 items is actually 4 stacks, each with slightly different metadata, but the inventory interface hides this and shows it all as one stack. When you try to move an item with a script via e.g. RemoveItem, it always moves the first matching item stack it finds in memory, so it's possible that it'll do up to one separate movement operation per individual item if each item is actually technically unique.

The individual items in this case most likely have ownership data on them because they were picked up from an owned area or cell, but there are other things that can cause this too. Other causes that come to mind are that the item is being made persistent because of a script or quest alias, the item itself has a script attached to it, a script used AddKeyword on it for one reason or another, or it was spawned by a leveled list set up to add a keyword to the spawned item.
 
Last edited:
Issued fixed in 3.1.6. From the Release Notes:

Rewrote supply safe donation code to make it virtually impossible to crash your game. It can now support up to 1000 different item types per donation, but will prevent you from making additional donations until the previous one has completed processing. (thanks wim95 for finding the code flaw and solution!)


If you have a similar issue please check the forums for a report that is newer. If you cannot find one please create a new thread and mark it with the Bug tag.

Thank you
 
Top