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!

Resolved Swapped Settlement Plans

I updated my last post above since I found the reason exactly why 246ee7 is problematic. I can confirm with basically 100% certainty, now, that raw item count is not an issue unless you have lots of scripted items. For shipments specifically, I raised an issue on the UFO4P bug tracker, so with some luck that ought to eventually eliminate the shipment problem for unofficial patch users, at least.

I did have someone inquiring recently why their settlement menus were impossibly slow while my mod's supply lines were active, but I couldn't figure out why that was happening. That user mentioned that he had spawned in hundreds of thousands of resources, and eventually I gave up troubleshooting and just said effectively "well, it must be a game engine issue". I'm pretty sure, now, that the real reason was that that user had spawned way way too many shipment items, probably adding tens of thousands of items stacks to their supply network, which is guaranteed to cause what they described.

Additionally, @tankthing had mentioned that my other mod, Uncapped Settlement Surplus, had potential issues as a result of too many items being generated. This sounded like b******t to me, so I wanted to investigate why someone would say that, because it's very important to me that my mods are as bug-free as possible. I do not ever want to be the reason why someone's game breaks, so I find these sorts of things very concerning when someone brings them up. I've gotten to the bottom of it, now, so I'm satisfied that my mod does not, in fact, cause any of the issues described, and I can stop obsessing over it.
 
it's very important to me that my mods are as bug-free as possible. I do not ever want to be the reason why someone's game breaks

I feel you on that - I'm obsessed with resolving all crashing in this game.
 
Oh yeah, so here's a fun bug that appears to have no workaround. One functionality of my Logistics Station mod allows you to move the entire contents of a container to a different container, in case you want to quickly change your Logistics Storage container to a different one, but don't want to have to do it manually.

The problem, the RemoveAllItems() function doesn't work properly when it tries to move a stack that's bigger than 65535 items, and it'll cause that item stack's size to overflow and roll over, so that e.g. doing that on a stack that's 65536 will totally delete the stack, or 65537 will move one item and delete the rest of the stack (etc). It appears that I can't even work around this with some careful use of RemoveItem() instead, since that function cannot be used to move arbitrary, previously unknown item types.

This affects the Storage Beacons mod too, by the way, since it uses the same function for a very similar purpose, as well as like 30 different places in Sim Settlements, however the SS calls are significantly less likely to run into this problem.

I'm debating what I should do about this:
  • Ignore the problem and hope that nobody notices it, and justify it to myself by saying that anyone affected by this probably cheated anyway?
  • Put a warning before using that functionality that it may cause item loss with extremely large item stacks?
  • Remove the feature altogether? I'm not really willing to choose this one anyway.
*sigh*
 
Last edited:
Could you just move 65536 items when the count is over that number and warn the user, leaving the overage behind?

Also, for the record I did say scriptable objects (probably should have said it as "scripted", mea culpa)
 
I'd just calculate how many items there are and loop through that many/65535 iterations of moving 65535 items if I could, but the thing is that there appears to be no function to remove an arbitrary number of unknown items from a container at a time. You can move *one* random item using DropFirstObject(), and you can move *all* items with RemoveAllItems, but you can't just get say, the first 100 (or 65535) items without actually knowing what they are beforehand, since RemoveItem() cannot be passed a wildcard. Frustrating.

To be fair, it is unlikely to actually get 65536+ of any individual item legitimately, but I could see it happening with, say, purified water, or certain kinds of ammo.
 
I dreamed up another potential solution for the supply safe issue - it won't necessarily fix other issues with your workshops array - but this fix might be enough to at least get the city plans and donations working again. Will be going live in patch 3.1.6 next week. If any of you are still having this problem on a save, let me know if it's fixed after this next patch.
Unfortunately 3.1.6 does not fix the city plans issue. I'm in a relatively stable state where I can still use ROTC for some settlements. I'm using regular SS for the others and disabling maintenance locally. Unless there are better ideas, I'm going to keep pressing forward in my game, and keep an eye out for any info on how to identify settlement data in save files so I can compare a good instance with my broken one. I'm too far in on this playthrough to start over, so we'll see how it goes.
 
I'm not sure what you mean by city plans issue. I thought your issue in this thread was that the supply safe was showing the incorrect settlement?
 
Top