Commit Graph

46 Commits (bce903ee0434ffae24bf02c898ab456adee9ffdf)

Author SHA1 Message Date
Sven Eberhardt bce903ee04 Merge branch 'master' into qteditor
Conflicts:
	planet/Objects.ocd/Items.ocd/Tools.ocd/Dynamite.ocd/Script.c
	planet/Objects.ocd/Libraries.ocd/Animal.ocd/CreatureControl.ocd/DefCore.txt
2016-08-13 23:42:59 -04:00
Maikel de Vries df098d2840 pump only activates when drain is free or accepts liquid 2016-08-07 21:26:23 +02:00
Sven Eberhardt 36685a3119 Add HideInCreator=true to internal/helper/library definitions 2016-07-10 22:06:48 -04:00
Maikel de Vries c538a0d617 add missing neutral pipe interaction menu tooltips for liquid tank 2016-06-11 20:57:06 +02:00
Mark d51a8cfa6d Liquds: Liquids can be passed either as a string or as a definition 2016-06-05 12:05:48 +02:00
Mark 923ee485ec Liquid container: PutLiquid(*, nil, *) inserts maximum amount of liquid
Added unit test.
2016-06-05 12:05:42 +02:00
Mark ffcbdc7fd0 Fixed producers unit test #7
The problems here were:
- the foundry cannot take 400 water from ice if it has a fill limit
- the pump cannot pump anything into the object if it has no fill limit
2016-06-01 19:10:46 +02:00
Mark ab5d92117a Refactoring: Added parameter for container in CreateLiquid() 2016-03-25 19:44:36 +01:00
Mark 52542d7977 Refactoring: Liquids: Removed GetLiquidID() and changed CreateLiquid()
CreateLiquid() can be called from definition context now, to create a certain amount of liquid.
2016-03-25 19:34:36 +01:00
Mark 1c1ea38efa Renamed the liquids IDs
Omitted the prefix "Liquid_".
2016-03-25 19:11:55 +01:00
Mark ed75112715 Move liquids to the folder Items\Resources 2016-03-25 19:11:34 +01:00
Mark a34eea41dc Power: Fixed unit test 21 2016-03-25 16:24:43 +01:00
Mark 6b7dc6015d Liquids: Fix liquids entering Clonks 2016-03-25 16:12:02 +01:00
Mark 332b899c54 Barrel: Fixed barrel liquid ejection
The barrel did not eject liquids with the correct angle when using the barrel, because the parameters were not used by the liquids.
2016-03-23 20:18:08 +01:00
Mark 02b8cf8422 Barrel: Fixed barrel getting filled with liquids
Barrels was not updating, and caused an error when getting filled with liquid.
2016-03-23 20:11:23 +01:00
Mark 274379ddc3 Producers: Fixed unit test 5
Added unit test 6 for fuel objects that do not behave correctly. Fuel should always return the current fuel amount if not parameter is passed.
2016-03-18 17:44:51 +01:00
Mark 8749300622 Fix unit tests: Some code adjustments were forgotten in the other commits. 2016-03-16 22:44:48 +01:00
Mark 7febb8fd91 Refactoring: Stackable: The size of stacks can be limited by a container now.
The function RejectEntrance() has two more callbacks to the object it should enter:
- CollectFromStack(object stack): The object can grab items from the stack, before the stack tries to merge with stacks in the object. This is necessary for barrels, so that a large liquid stack can fill an empty barrel.
- RejectStack(object stack): This is called after the stack is merged. Currently, the stack merging counts as handled only if the stack is removed. This callback allows the object to still reject the stack, for example if it accepts only one item, such as the barrel does.
2016-03-16 22:43:44 +01:00
Mark ac8d40418c Refactoring: Stackable: Renamed TryPutInto() to MergeWithStacksIn()
The previous name suggested that the object actually gets put into another object. In fact it merges the stack count with other stacks, and it does not only try to (and reverts the state if it fails), but it actually changes other objects even if the function returns false.
2016-03-16 18:19:55 +01:00
Mark a785ca83da Stackable: Added InitialStackCount()
For things such as the liquid object that starts with 1 item in the stack, so that the Construction() function does not have to be overloaded.
2016-03-03 22:13:27 +01:00
Mark 1786f5b3d9 Liquid objects: Fix unit test, Stackable
Addedv debugging logs, will remove them once all unit tests work. The stackable library function "TryPutInto" was changed slightly.
2016-03-03 17:10:43 +01:00
Mark cbe8bbd8e8 Removed authors Ringwaul and ST-DDT from liquid container
They were not involved in the current script
2016-03-03 17:07:37 +01:00
Mark a7ed516c39 Refactoring: Liquid container
The liquid container library was severely reduced by the changes that the liquid objects bring. The remaining unit tests nearly work.
2016-03-01 22:29:35 +01:00
Mark f78890142c Refactoring: Fuel
Added parameter to 'GetFuelAmount' that specified how much fuel is requested from this object. Oil is now fuel and only the needed amount is removed instead of removing the entire stack when a producer requests fuel.
2016-03-01 17:29:24 +01:00
Mark 4f51a75a20 Removed fuel object
Need for a fuel burner library is evident
2016-03-01 06:55:02 +01:00
Mark 0536520bc8 Refactoring: Liquid object stackable
Made the liquid object stackable again. Will replace component amounts in the next step.
2016-02-29 21:40:45 +01:00
Mark 7561779d8c Producers handle fuel and liquid with liquid objects 2016-02-27 15:04:37 +01:00
Mark 7894fb0fc6 Steam Engine: Use fuel liquid, Work in progress 2016-02-27 12:41:46 +01:00
Mark 52884fb685 Removed liquid container logic from pump.
Previously, sharing the logic made sense, because both objects used variables to store the liquid. Now, the liquid container stores liquid in an object - this is not desirable in the pump because it would create and remove objects for no good reason (only so that it has a virtual liquid storage) every time it pumps. Consequently, liquid objects cannot enter a pump anymore.
2016-02-26 23:17:38 +01:00
Mark 351e61832c Liquid Container: Fixed liquid objects remaining in existence after test. 2016-02-26 22:38:38 +01:00
Mark af8e681ec8 Liquid Container: Let liquid object handle removing liquids 2016-02-26 22:11:11 +01:00
Mark 8a49ae10c0 Liquid Container: Removed logging 2016-02-26 22:06:04 +01:00
Mark 1acdfd4c1a Liquid object: Fixed unit test 3 2016-02-26 21:56:52 +01:00
Mark 55401f88e3 Liquid object: Fixed unit test 12
Added test for filling an empty barrel partially
2016-02-26 15:42:54 +01:00
Mark 79df36eb6b Liquid object: Refactored object entering system.
Unit test 3 still fails, because the functions are not runtime overloadable. Test 12 fails, because liquid transfer does not work correctly yet. This fill be fixed in the next checkin.

Added debug logging, this has to be removed again later.
2016-02-26 15:19:41 +01:00
Mark 862e69655e Liquid object: Test for liquid leaving the container 2016-02-20 21:10:41 +01:00
Mark 7cc88bd909 Liquid Object: Simplified transfer into liquid container.
Unfortunately, now the object is not actually transferred, but removed, and a new one is created or an existing one is filled in the liquid container. The logic could use a rework actually, because everything was more clear when the container stored things in variables.
2016-02-20 21:00:48 +01:00
Mark 9e46d752a9 Liquid Object: Unit test for entering liquid containers
The tests handles the entrance of liquid objects into the container. Will look to simplify the script in the next commit.
2016-02-20 20:14:19 +01:00
Mark 2dd09fc8bd Liquid Object: Dispersing contents is a function of the liquid object now, instead of the barrel
The object now also disperses if it exits a liquid container
2016-02-20 17:08:55 +01:00
Mark 8698aa25cf Object Interation Menu: Request displayed amount from objects
The special handling of the stackable library was moved from the interaction menu to that library. The reasoning behind this is that the menu should not have to know each and every object, but the objects should tell the menu how they are displayed.
Liquids are displayed by their liquid count now. It would be even better, if the max. capacity would be displayed without having to hover the description field.
2016-02-19 15:19:41 +01:00
Mark 8c578931bb Liquid Object: Replaced liquid container logic
The liquid container now stores liquid objects, instead of volume and liquid type. Liquid objects can have be of a specific type, such as Liquid_Water, Liquid_Oil, etc..., but they can also just stay Library_Liquid for other liquids.
The liquid container logic has become more complex now, but still works as before. Transferring liquids to other objects may still need some improvements:
- at the moment, transferring liquids between liquid containers is possible
- maybe liquids objects, such as oil, can enter a liquid container while another liquid is in that container already - will need a unit test for that
- transferring liquid from a liquid container to a structure or crew member should be possible (but is not yet), if the target is not a liquid container but contains liquid containers
2016-02-19 06:53:44 +01:00
Mark 9a2b8449ec Liquid objects: No stackable library 2016-02-17 06:49:53 +01:00
Mark e2689ad1c3 Prototype: Liquid objects as menu icon
It seems that real objects would be nicer.
2016-02-16 21:08:23 +01:00
Mark 1cf04d24c5 Liquid objects: Enter liquid containers only 2016-02-16 21:08:18 +01:00
Mark e39dbe48db Prototype: Liquid objects
Stackable liquid objects, as a prototype for storing liquids
2016-02-16 21:08:09 +01:00
Mark ae9736c18b Move liquid libraries to sub-folder LiquidControl 2016-02-16 21:08:00 +01:00