Eco
sh0ckwaVe29 May 16, 2018 @ 6:10am
Stockpile Stack Size
Any ideas on how to mod the size of the stacks in the Stockpile?

I have modded the size of carrying size but with i go back to the stockpile it turns it back into its default size.

:steamsad:
< >
Showing 1-15 of 17 comments
DiabloDBS May 16, 2018 @ 4:20pm 
So you want the stockpile to have more storage capacity?
And with modding you mean just changing stuff in the server .cs files or actual modding?
Would be helpful if you posted the code parts which don't work out.

I think the stockpile specifics are mostly handled in the StockpileComponent class which is most likely not accessible easily.

If you're just looking for a fast solution to have more storage in less space you could also change the storage chest to have an increased size:

storage.Initialize(40); //storage.Storage.AddRestriction(new NotCarriedRestriction());

And if you comment the line below you can put in any kind of item even carried items.
But if you're not creating a mod each and every chest you place down after changing this will be like that. (Every chest placed before should be as before afaik)

http://steamcommunity.com/profiles/76561197967223153/screenshot/927057975750575308

If i find the time i'll try to look into it further but i don't have more stuff than those server files atm so if it's not in there ir is really hard to figure out if there might be a workaround or better how to effectively implement it.
Last edited by DiabloDBS; May 16, 2018 @ 4:25pm
sh0ckwaVe29 May 17, 2018 @ 3:01am 
okay thank you and i was looking for a line of code to change the stock pile stack size, say for instance iron ore hold 20 i want it to hold 100 ect but i cant see the code to do so
DiabloDBS May 18, 2018 @ 3:45pm 
Originally posted by sh0ckwaVe.BnC:
okay thank you and i was looking for a line of code to change the stock pile stack size, say for instance iron ore hold 20 i want it to hold 100 ect but i cant see the code to do so

Well from how the stockpile is structured i'd say it is likely that the StockpileComponent class which also provides the stockpile dimensions does it.
There might be a way to set it without having access to the StockpileComponent class by initializing it differently (if that is implemented) but as it is a blackbox it is hard to tell the correct semantic to do so.
As i didn't change the stack sizes at all it would be nice if you could refer to the cs and line of code you did that as it might use a similar semantic.

Edit:
Ok i think i found a workaround but i first have to check if i can fix up the graphics as well.
The problem with the Stockpile is that it actually stacks stuff in a limited spartial area (5x5x5)

To change the behaviour we either need to increase the stockpiles area or make a (stockpile) stack of ore smaller (in dimensional size 4 ore make up 1 of the 125 available slots in a 5x5x5 stockpile).
Increasing the stockpile as far as i see it requires at least some knowledge about the StockpileComponent class.

To change the dimensional size of a stack you need to not only set up the stack size but also change the stacking behaviour on the stockpile.
IronOre.cs:
[Serialized] [Minable, Solid,Wall] public partial class IronOreBlock : Block { } [Serialized] [MaxStackSize(40)] [Weight(30000)] [ResourcePile] [Currency] public partial class IronOreItem : BlockItem<IronOreBlock> { public override string FriendlyName { get { return "Iron Ore"; } } public override string FriendlyNamePlural { get { return "Iron Ore"; } } public override string Description { get { return "Unrefined ore with traces of iron."; } } public override bool CanStickToWalls { get { return false; } } private static Type[] blockTypes = new Type[] { typeof(IronOreStacked1Block), typeof(IronOreStacked2Block), typeof(IronOreStacked3Block), typeof(IronOreStacked4Block), typeof(IronOreStacked5Block), typeof(IronOreStacked6Block), typeof(IronOreStacked7Block), typeof(IronOreStacked8Block), typeof(IronOreStacked9Block), typeof(IronOreStacked10Block) }; public override Type[] BlockTypes { get { return blockTypes; } } } [Serialized, Solid] public class IronOreStacked1Block : PickupableBlock { } [Serialized, Solid] public class IronOreStacked2Block : PickupableBlock { } [Serialized, Solid] public class IronOreStacked3Block : PickupableBlock { } [Serialized, Solid] public class IronOreStacked4Block : PickupableBlock { } [Serialized, Solid] public class IronOreStacked5Block : PickupableBlock { } [Serialized, Solid] public class IronOreStacked6Block : PickupableBlock { } [Serialized, Solid] public class IronOreStacked7Block : PickupableBlock { } [Serialized, Solid] public class IronOreStacked8Block : PickupableBlock { } [Serialized, Solid] public class IronOreStacked9Block : PickupableBlock { } [Serialized, Solid,Wall] public class IronOreStacked10Block : PickupableBlock { }

Usually the iron ore only ranges from IronOreStacked1Block to IronOreStacked4Block
but if you add in more StackedBlock classes then more ore will take up the same space 4 ore do in a normal setup.
The downside is that i still need to figure out where to set the graphics for the new stockpile classes and i guess that might be out of reach. But if you don't mind the looks it should work:
http://steamcommunity.com/profiles/76561197967223153/screenshot/927057975758800329
http://steamcommunity.com/profiles/76561197967223153/screenshot/927057975758802918

PS:
If you're doing the doubling of the stockpile slots for the inventory menu then once the stockpile has run out of space (dimensionally the 5x5x5 thing) to store stuff and you place a stack on it it will just vanish. So better don't :-X
Last edited by DiabloDBS; May 18, 2018 @ 4:22pm
PYRO Jun 3, 2018 @ 5:17pm 
Originally posted by DiabloDBS:
So you want the stockpile to have more storage capacity?
And with modding you mean just changing stuff in the server .cs files or actual modding?
Would be helpful if you posted the code parts which don't work out.

I think the stockpile specifics are mostly handled in the StockpileComponent class which is most likely not accessible easily.

If you're just looking for a fast solution to have more storage in less space you could also change the storage chest to have an increased size:

storage.Initialize(40); //storage.Storage.AddRestriction(new NotCarriedRestriction());

And if you comment the line below you can put in any kind of item even carried items.
But if you're not creating a mod each and every chest you place down after changing this will be like that. (Every chest placed before should be as before afaik)

http://steamcommunity.com/profiles/76561197967223153/screenshot/927057975750575308

If i find the time i'll try to look into it further but i don't have more stuff than those server files atm so if it's not in there ir is really hard to figure out if there might be a workaround or better how to effectively implement it.

I tried to edit my server file StorageChestObject.cs but it did not work. Can you explain it in detail?
DiabloDBS Jun 4, 2018 @ 12:39pm 
You gotta do it in the Initialize method of the StorageChest.cs if you want to have it for the normal storage chest.

Server\Mods\AutoGen\WorldObject\StorageChest.cs:
protected override void Initialize() { this.GetComponent<MinimapComponent>().Initialize("Storage"); var storage = this.GetComponent<PublicStorageComponent>(); storage.Initialize(16); storage.Storage.AddRestriction(new NotCarriedRestriction()); // can't store block or large items }

Hudspeth Nov 13, 2019 @ 8:01pm 
Sorry to necro this thread but my wife and I wanted to increase the stack size for the stock pile and I figured out the following ways with the help of this thread and other ones.

A) Easiest I think? With about 20 minutes of research.
Remove the restriction for stack size in the StockpileObject.cs located at:
Steam\steamapps\common\Eco\Eco_Data\Server\Mods\Objects\StockpileObject.cs
by removing this line which is on line 49 for me:
storage.Storage.AddInvRestriction(new StockpileStackRestriction(DefaultDim.y)); // limit stack sizes to the y-height of the stockpile

Now you need to increase the [MaxStackSize(100)] of each item that you can store in the stockpile for example, setting Log.cs [MaxStackSize(100)] I can now stack 100 logs in the StockPile.

B) Not sure what the implications of this are, but you increase the Y value of this line
public static readonly Vector3i DefaultDim = new Vector3i(5, 5, 5);
on the same StockpileObject.cs file.
The Y value is the middle number in the Vector3i object x, Y, z

Now you need to increase the MaxStackSize just like in method A. Although doing this is still restricted to the Y value of the StockpileObject.cs.

For example, setting
public static readonly Vector3i DefaultDim = new Vector3i(5, 10, 5);
and HewnLog.cs MaxStackSize to 60, I could carry 60 hewn logs in my hands, but the stockpile would only stack a maximum of 30. If I increase the Y value to 20, then I could stack a maximum of 60 hewnlogs.

---------------------------

Hope this helps.
Last edited by Hudspeth; Nov 13, 2019 @ 8:01pm
MinoCraft Nov 30, 2019 @ 4:49am 
Hello !

Actually, I’m looking for a way to increase Max stack size in stockpile.

In:

Steam\steamapps\common\Eco\Eco_Data\Server\Mods\Objects\StockpileObject.cs

You just need to change "DefaultDim.y" value with a number in:

storage.Storage.AddInvRestriction(new StockpileStackRestriction(DefaultDim.y)); // limit stack sizes to the y-height of the stockpile

For exemple:

storage.Storage.AddInvRestriction(new StockpileStackRestriction(100)); // limit stack sizes to the y-height of the stockpile


Same way for tiny and small stockpile change "DefaultDim.y" value in .cs file
Valerius Apr 7, 2020 @ 8:07pm 
Originally posted by Hudspeth:
Sorry to necro this thread but my wife and I wanted to increase the stack size for the stock pile and I figured out the following ways with the help of this thread and other ones.

A) Easiest I think? With about 20 minutes of research.
Remove the restriction for stack size in the StockpileObject.cs located at:
Steam\steamapps\common\Eco\Eco_Data\Server\Mods\Objects\StockpileObject.cs
by removing this line which is on line 49 for me:
storage.Storage.AddInvRestriction(new StockpileStackRestriction(DefaultDim.y)); // limit stack sizes to the y-height of the stockpile

Now you need to increase the [MaxStackSize(100)] of each item that you can store in the stockpile for example, setting Log.cs [MaxStackSize(100)] I can now stack 100 logs in the StockPile.

(...)

Confirmed working in 2020 game version. As soon as you find out where exacly the "dirt block" is located, the tyranny of dirt filling up tons of stockpiles with a limit of 5 each stack, is finally over. the dirt block's [MaxStackSize] can be edited under 'LandscapeItems.cs' and is called "dirtitem".

Thanks to Hudspeth and his wife for the effort to make this restriction understandable. ;) :RyseCoin::RyseCoin:
Last edited by Valerius; Apr 7, 2020 @ 8:09pm
Manny one Ball Jun 21, 2020 @ 8:06pm 
I figured it out and it's still working in 2020
this is the easiest way by far

go to


Steam\steamapps\common\Eco\Eco_Data\Server\Mods\Objects\StockpileObject.cs

and change this


storage.Storage.AddInvRestriction(new StockpileStackRestriction(DefaultDim.y)); // limit stack sizes to the y-height of the stockpile


which is on line 49 for me:

to this


storage.Storage.AddInvRestriction(new StockpileStackRestriction(100) or number of choice


then change your item stack size to whatever you want
Valerius Jun 22, 2020 @ 3:05am 
Originally posted by Manny one Ball:
I figured it out and it's still working in 2020
this is the easiest way by far

go to

Steam\steamapps\common\Eco\Eco_Data\Server\Mods\Objects\StockpileObject.cs

and change this

storage.Storage.AddInvRestriction(new StockpileStackRestriction(DefaultDim.y)); // limit stack sizes to the y-height of the stockpile

which is on line 49 for me:

to this

storage.Storage.AddInvRestriction(new StockpileStackRestriction(100) or number of choice

then change your item stack size to whatever you want

Why is it easier to change a line compared to delete a line? This solution is literally the same as above with one detail changed. What's the 'magical' difference?
Last edited by Valerius; Jun 22, 2020 @ 3:06am
SGAMEZ Jan 30, 2022 @ 8:42am 
This working in 2022 V 0.9.4.5 ?

Originally posted by ƔALERIUS:
Originally posted by Manny one Ball:

Why is it easier to change a line compared to delete a line? This solution is literally the same as above with one detail changed. What's the 'magical' difference?
Last edited by SGAMEZ; Jan 30, 2022 @ 8:46am
Manny one Ball Feb 13, 2022 @ 10:03pm 
Originally posted by SGAMEZ:
This working in 2022 V 0.9.4.5 ?


yes it is working in 2022 v0.9.4.6
fiiiisch___ Apr 9, 2024 @ 7:42am 
Have follow issue:
it this working 2024?

System.Exception: E:\SteamLibrary\steamapps\common\Eco\Eco_Data\Server\Mods\__core__\Objects\StockpileObject.cs(31,82): error CS1002: ; erwartet.
at Eco.ModKit.RoslynCompiler.HandleCompilerError(ImmutableArray`1 diagnostics)
at Eco.ModKit.RoslynCompiler.Compile(AssemblyLoadContext assemblyContext)
at Eco.ModKit.RoslynCompiler..ctor(AssemblyLoadContext assemblyContext, String modsDirectory, String modsAssemblyPath)
at Eco.ModKit.RoslynCompiler..ctor(String modsDirectory, String modsAssemblyPath)
at Eco.ModKit.ModKitPlugin..ctor()
at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean wrapExceptions)
Outer Exceptions:
Exception has been thrown by the target of an invocation.
: 1
SLG-Dennis  [developer] Apr 9, 2024 @ 7:44am 
Sounds like broken mods folder, delete the E:\SteamLibrary\steamapps\common\Eco\Eco_Data\Server\Mods\ folder and verify game files via steam.
fiiiisch___ Apr 9, 2024 @ 8:53am 
Thanks for the quick answer, yes the file is broken because I made a change:
My question is, it is possible to change: Stockpile Stack Size?



the way below does not work

"Steam\steamapps\common\Eco\Eco_Data\Server\Mods\Objects\StockpileObject.cs

and change this

storage.Storage.AddInvRestriction(new StockpileStackRestriction(DefaultDim.y)); // limit stack sizes to the y-height of the stockpile

which is on line 49 for me:

to this

storage.Storage.AddInvRestriction(new StockpileStackRestriction(100) or number of choice

then change your item stack size to whatever you want"
< >
Showing 1-15 of 17 comments
Per page: 1530 50