Not logged inOpenClonk Forum
Up Topic Liquid container branch

This board is threaded (i.e. has a tree structure). Please use the Reply button of the specific post you are referring to, not just any random button. If you want to reply to the topic in general, use the Post button near the top and bottom of the page.

Post Reply
In Response to Marky

>Yes, they should use the stackable-interface then.


That's what they did, but it prooved to be not that useful: Objects that include Library_Stackable can be stack up to 999 objects. For liquids that is not enough, because one barrel contains 300 items already, and I do not want to have 3x999xWater in a container. Having another "non-limited, but not infinite" mode for stackable objects seemed to be strange, too.

>At the moment, producers can take only the objects they need for production (you can't put loam into a chemical lab). I guess that would be the same there? (And wouldn't need any changes?)


Lets say the chemical lab needs water for one product, and oil for another product. You can put oil into it, but then you would not be able to put any water into it (as a reserve) until the oil is used up. Once could make an exception, so that producers can contain any amount of liquids at the same time, but that would effectively make all producers a liquid storage that can hold e.g. 100+ barrels worth of water each. On the other hand, one could actually put 100+ barrels inside the producer at the moment, so no actual change.

>Or did I misunderstand anything?


There are three kinds object objects for liquid at the moment:
* Liquid containers (Barrel), marked by "IsLiquidContainer". These contain liquid and should not be removed by the producer, just emptied.
* Liquid objects (Liquid_Water), has a function "IsLiquid" that returns water. These also "contain/are" liquid, and should not be removed by the producer, just emptied. I.e. if there is 90 water in the producer and it needs 60, then 30 should remain.
* Other objects (Ice) that also have a function "IsLiquid", but the producer just counts how many water is contained in such an item and removes the entire object.

So in the end I need to distinguish these items, or make them use the same interface. This is somewhat hindered by the fact that the producer handles fuel and liquid completely different from normal components. If that were not the case, then the code might become less convoluted indeed.

Still the actual questions that we must ask are these:
- what is the benefit of having, say 100 water items in the kitchen, instead of a barrel that contains 100 water?
- would barrel empty into the kitchen if you transfer a water barrel to the kitchen, leaving the empty barrel in the Clonk?
- if not, then why include the water item? It would only ever enter the kitchen if there were a pipe attached to it, which is not possible at the moment.

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill