Not logged inOpenClonk Forum
Up Topic New LiquidPump System

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 ST-DDT
I think we should give up the old liquidpipe system.

I developed a liquid tanks for CR.
But i found it very ugly because i had to override the Liquid functions of CR because they only allow putting liquid into barrels.
And does not allow blocking inputs or limiting them very well.

So i invented a new functionality.

It should exist only one type of liquidpipe (not both source and drainpipe). And an engine/default function for liquid transportation.
The pump pumps liquid into the pipe and the structure connected gets an LiquidInput(int dMat, ind dAmount, object pSource, object pPipe) call

Here is my fast implemented code for the pump, pipe and 2 sample buildinds (Tank and Barrelcontainer). (maybe the last one should be made availiable for #include like the Door
http://pastebin.com/Fu6eZCPS

Pump->Timer()
#SourcePipe->GetLiquid(int dnMat, int dnMaxAmount, object pPump)
##SourceObject->LiquidOutput(int dnMat, int dnMaxAmount, object pPump, object pPipe)
#TargetPipe->PutLiquid(int dnMat, int dnMaxAmount, object pPump)
##TargetObject->LiquidInput(int dnMat, int dnMaxAmount, object pPump, object pPipe)

I finished coding and appended the .patch file bellow. Testing this was really hard, because there were no structures to test with.

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill