[Mod Request] A slider to limit maximum stack size for shelves

Started by Debbonair, September 26, 2017, 06:23:28 AM

Previous topic - Next topic

Debbonair

Just what the title says. I ran a search for every way I could think of to say it but came up with no results. I want the ability to say 'this shelf should be stocked with X and no more.' rather than it being filled to the stack size maximum before items are taken elsewhere.

Two other things that would be highly desirable but far less essential are:
-An ability that suspends restocking until a specified number remains on the shelf.
-The ability to designate what is stocked on each of the two shelf spaces independently.

TheWrongColonist

This suggestion is so subtle but "game changer" QOL level specialy with Stack XXL, this would allow us to spread the items across the colony the way we want to.

I think this should be a feature of the game though.

SpaceDorf

Maxim 1   : Pillage, then burn
Maxim 37 : There is no overkill. There is only open fire and reload.
Rule 34 of Rimworld :There is a mod for that.
Avatar Made by Chickenplucker

Debbonair

Is this really that hard to do? I know absolutely nothing about modding, but I wouldn't imagine adding a simple slider to set max quantity would be very difficult compared to, for instance, all the stuff the mod 'improved workbench' adds to production benches.

SpaceDorf

Storage is a place where a complete Stack of Stuff can be placed.

Stacksize is a property of the Stuff itself ( 10, 25, 75, 200 for example )

The way to implement such a thing would be to add a individual, variable carry capacity per tile to the building/area similiar like pawns have it now.

If this is possible, adding a slider to the UI that controls the variable is easy  ;D
Maxim 1   : Pillage, then burn
Maxim 37 : There is no overkill. There is only open fire and reload.
Rule 34 of Rimworld :There is a mod for that.
Avatar Made by Chickenplucker

Debbonair

Umm, I think I sorta understand what you're saying... So how about copying the stacksize property of stuff and renaming the copy to like shelfstacksize and doing the same for shelfstorage to change the reference to shelfstacksize the changing shefl properties to point to the newly made shelfstorage instead of the normal storage? Or just creating a new cabinet (preferably only 1 tile) that uses the new property. Would that work?

Albion

I think that won't work that easily because of how the underlying mechanics work.
Everything in the game was properties written in its XML file but for those properties to mean and do anything you'll have to write the corresponding game (C#) code. Not only do you have to write the code but it usually also has to fit in or interact with the vanilla game code.
TlL;DR everything you need actual coding for might be difficult.

The issue is that as pointed out by SpaceDorf the value for stacksize is a property of the stuff itself so to change that you'll have to look into the way the game is handling this on a code level and how to inject something somehow if that is even possible.
It's therefore unfortunately not as easy as simply adding a new property.
The same problem arises if you want to create a copy of normal stuff just to achieve this functionality.

The way stockpiles work by the way is that they are simply a filter. They basically tell the game/pawns: you can put these things over here but not those. Actual stacksizes are handled differently.

SpaceDorf mentioned an interesting idea though. One could somehow use the carrying mechanism to have the shelf carry the desired amount.
However implementing this might be somewhat difficult as mentioned above and is definitely beyond me, unfortunately.

SpaceDorf

Thank you Albion,

good description and good catch with the Item Filter, I forgot to include that one.

I was just preparing the word definition speach.
Because Things and Stuff can become quite irritating, especially if someone new to the forum does not know that those are actual defined ingame terms  ;D

So fo all ya n00bs and n3wbs out there ..

Definition of Ingame and Programming Terms.:
Stuff - the ingame Name for a building material or anything that can get stacked.
Things - Buildings, Weapons and more that are made from Stuff.
Pawn - Everything that moves on it's own, Member of a Race and Faction

Class - general definition of something in Programm code ( Stuff Class, Building Class .. )
Object - a special named variable of the type class, with property content defined for it.
Instance - of an Object of a Class that now finally is active and created ( Steve is an Instance of Human which is a Member of the Pawn Class )
Property - A named Description of a Property of a Class. This can either be constant or variable.
( Stacksize is Variable, Race is Constant )
Method - a function or Order owned by a class, that is able to change the value of a property.
Variable - Like in Math, a named thingy that can contain different "CHANGING" values stored somewhere in memory.
Constant - Like in Math, a named thingy that can contain different "UNCHANGING" values stored somewhere in memory


Like Albion said, translated with the definitions above :

The storage zone Class has only the ability to filter, but no own property for carryweight.
Same does the Shelf which is a Object of the Building Class, which inherited some Properties of the Storage Zone.

What is missing is a carry weight property for the shelf. Defining this could be possible the way Debbonair described it, but it would still have the upper limit of Item-Stacksize.
So a XML Version of a Shelf with a Constant carryweight for stuff would be possible, if you defined the right class.

The slider for a variable amount of carryweight would require C# defining a Method to do this and influence the UI.
( look at the fun that Extended Storage and Quantum Storage are having )

sorry, to tired and confused now ..




Maxim 1   : Pillage, then burn
Maxim 37 : There is no overkill. There is only open fire and reload.
Rule 34 of Rimworld :There is a mod for that.
Avatar Made by Chickenplucker

Debbonair

Thanks for the definitions, now I can sound slightly less newbish. lol

That other mod that TheWrongColonist linked can increase the stacksize of stuff by applying a multiplier (No one has responded to my post there asking if the multiplier can be less than 1) Doesn't this mean that there is a number somewhere that's getting multiplied? And in that case why can't the line it appears on be duplicated and renamed?

I really am a newb when it comes to modding, best I've done is some simple .ini edits in a few games.

SpaceDorf

Yes. There is a Number for every stackable Item which defines its Maximum Stack size.
Except for some Items, the global hardcoded Number was 75.

The Multiplier Modifies that Number.

The Number we would need in addition is the max amount that can be carried by a pawn, which is given per race and modified by manipulation .. so the slider would be the manipulation value of the holding item.
Maxim 1   : Pillage, then burn
Maxim 37 : There is no overkill. There is only open fire and reload.
Rule 34 of Rimworld :There is a mod for that.
Avatar Made by Chickenplucker

Debbonair

So, could anyone do this please? It's certainly beyond my ability...

aimxoo0o

Is pushing allowed? Would be really cool to have such a feature.

Or maybe there is another way.

I have 4 Mortars and 2 seperate locations. 2 left in the base and 2 right.
Next to them is a shelf. It would be really cool, if I could limit the grenade stock to for example 20. So I have 10 grenades for each mortar.

Now I have one shelf without grenades and one with all grenades.

Thanks in advance!

Lurmey

Quote from: aimxoo0o on May 16, 2018, 04:40:41 AM
Is pushing allowed?
What you've done is called a bump and yes, it's allowed. Frowned upon on older threads but this thread isn't particularly old.

I think this is one of those mod ideas that sounds easy in principle because on the front end it's just a slider that just changes the maximum stack size for that specific storage building, but in reality, it's much more difficult to make happen. No doubt it would be a game changer, making it possible to spread certain items around your colony evenly so they can be accessed from anywhere, like food, medicine or steel. I've had a need for this kind of thing before, but eventually just got around it in my own ways.

The closest thing I can think of that may help you is Hauling Hysteresis. With a stack size of 750 for one item, you could potentially make it so each spot around your base is only refilled when it drops below 5 or 10%, meaning there will only ever be around 75 there at one time, depending on how much your colonists can carry. If they can carry a whole stack of 750, then this would make no difference since as soon as it drops below 10% they'll just refill it back to the maximum since they can carry that much.

FuriouslyEloquent

Someone should be cropping their images ... but I'm not

BlackSmokeDMax

Quote from: FuriouslyEloquent on May 29, 2018, 06:22:06 PM
I may consider adding storage limits to my shelving mod, which I am posting now.
https://ludeon.com/forums/index.php?topic=41612.0

Adding something like that to a shelving mod sounds like a great idea. Would actually give me a reason to build a shelf. In a couple years of playing Rimworld, i have yet to ever build one.