Would it be possible to make the stack_size property on item_prototype a writeable property?
I could really use this in a mod I'm currently working on.
Make stack_size writeable
Make stack_size writeable
Casual modder
Re: Make stack_size writeable
That's not likely to happen. If any property can be changed runtime it has to be saved in the save file regardless of it being used.
If you want to get ahold of me I'm almost always on Discord.
Re: Make stack_size writeable
Could you save only the differences compared to the data stage? That would only increase the size of saves that modify the property.
Re: Make stack_size writeable
When loading the game it has to know what to load from the input stream and the only way to do that is to always have something there. That means you can't conditionally save something unless something else signals it being conditionally saved.DaveMcW wrote:Could you save only the differences compared to the data stage? That would only increase the size of saves that modify the property.
If you want to get ahold of me I'm almost always on Discord.
Re: Make stack_size writeable
So include an array of stack_size_diferences in every save. It can be empty.
Re: Make stack_size writeable
So you're currently not saving any data of the prototypes in the savegame files as is? Because a single property shouldn't change savegame filesize by much.Rseding91 wrote:That's not likely to happen. If any property can be changed runtime it has to be saved in the save file regardless of it being used.
I think this would be a possibility.DaveMcW wrote:So include an array of stack_size_diferences in every save. It can be empty.
Casual modder
Re: Make stack_size writeable
I can't be bothered to look up the max size of an item stack so we will assume 32bit...
4 bytes * 1,000,00 items = 4 megabytes of storage.
Add in peoples obsession with warehouses and
768 slots * 200 ore each slot = 1.5 additional megabytes PER angels warehouse.
That is a lot of data for something that can be stored in the item prototype at just 4 bytes per item TYPE. And changing the stack size of any item type can be done on an existing map with a mod it just requires a game reload to take effect.
4 bytes * 1,000,00 items = 4 megabytes of storage.
Add in peoples obsession with warehouses and
768 slots * 200 ore each slot = 1.5 additional megabytes PER angels warehouse.
That is a lot of data for something that can be stored in the item prototype at just 4 bytes per item TYPE. And changing the stack size of any item type can be done on an existing map with a mod it just requires a game reload to take effect.
Re: Make stack_size writeable
But what if one wants to make a research to increase stack sizes?
It wouldn't matter, if you just want a static stack size, there are loads of mods out there that change the stack size, but it would be cool if it was possible to change it runtime.
It wouldn't matter, if you just want a static stack size, there are loads of mods out there that change the stack size, but it would be cool if it was possible to change it runtime.
Casual modder
Re: Make stack_size writeable
A technology modifier for stack size might be feasible , It would have drawbacks that it would affect the stack size of everything though.
Re: Make stack_size writeable
I would go for DaveMcW's method instead and use an array.
That way it would be possible to create researches for just some items or even single items.
That way it would be possible to create researches for just some items or even single items.
Casual modder