Modding:Liquids: Difference between revisions
m (Teamtoto moved page Modding/Liquids to Modding:Liquids) |
mNo edit summary |
||
(3 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{Modding Info}}{{Stub}} | {{Modding Info}}{{Modding Topic Prerequisites | Modding:C Sharp Scripting}}{{Stub}} | ||
=Adding a new liquid= | =Adding a new liquid= | ||
Line 34: | Line 34: | ||
{{Missing info|This section has yet to be written.}} | {{Missing info|This section has yet to be written.}} | ||
[[Category:Modding]] | [[Category:Script Modding]] | ||
{{Modding Navbox}} |
Latest revision as of 06:49, 2 April 2022
This page is about modding. See the modding overview for an abstract on modding.
For best results, it's recommended to have read the following topics before this one:
Adding a new liquid
A new liquid is implemented by a C# class that inherits from XRL.Liquids.BaseLiquid
and has the XRL.World.Parts.IsLiquid
attribute. A trivial liquid might be implemented, say, in a file called MyLiquid.cs
directly inside the mod's directory, as follows:
using XRL.Liquids;
[IsLiquid]
public class MyLiquid : BaseLiquid {
public MyLiquid () : base ("myliquid") {}
}
This creates a liquid with largely uninteresting properties whose internal identifier is myliquid
. The easiest way is to see it in-game is to spawn it in some container, so let's create an ObjectBlueprints.xml
as well:
<objects>
<object Name="MyLiquidPool" Inherits="Water">
<part Name="LiquidVolume" MaxVolume="-1" Volume="10" StartVolume="10d10" InitialLiquid="myliquid-1000"></part>
</object>
</objects>
Now you can wish it into existence with MyLiquidPool
.
Modifying an existing liquid
This article has information that is missing or not up to par.
Reason: This section has yet to be written.
Reason: This section has yet to be written.
Properties that a liquid can implement
This article has information that is missing or not up to par.
Reason: This section has yet to be written.
Reason: This section has yet to be written.