User:MomBun/Sandbox: Difference between revisions

106 bytes removed ,  20:47, 3 August 2022
some light edits to the xml side
(more comments and edits thanks to gnarf)
(some light edits to the xml side)
Line 39: Line 39:
The tile you will be using for said mutation in-game.
The tile you will be using for said mutation in-game.


By default most mutations use gold/yellow for detail and brown for foreground but this can be customized for any color of your choice, see [[Modding:Tiles]] and [[Modding:Colors_%26_Object_Rendering]] for further info on this.
By default most mutations use gold/yellow for background and brown for foreground but this can be customized for any color of your choice, see [[Modding:Tiles]] and [[Modding:Colors_%26_Object_Rendering]] for further info on this.


=== Constructor ===
=== Constructor ===
Line 55: Line 55:
public class GasGeneration : BaseMutation
public class GasGeneration : BaseMutation
{
{
        // In the above XML, you can see that the constructor is set to "SleepGas" which replaces the GasObject within this file
        // This means you could create a new mutation easily by copying the above xml, and replacing sleep gas with say confusion gas
public GasGeneration(string _GasObject)
public GasGeneration(string _GasObject)
{
{
Line 61: Line 63:
}
}
</syntaxhighlight>
</syntaxhighlight>
The GasObject property is set to to "SleepGas" in this case, because that was the value provided in the Constructor element of Mutations.xml.
Theoretically you could create a new mutation that generates any type of gas simply by adding a single <mutation> tag to a Mutations.xml file. For example, this Mutations.xml file alone would create a new mutation called "Confusion Gas Generation"


=== Exclusions ===
=== Exclusions ===
Line 74: Line 72:
== C# Scripting, and Making The Mutation ==
== C# Scripting, and Making The Mutation ==


Here is an example of a mutation that will add udders to your character, editing the title of your character "With Udders" and occasionally moo
Here is an example of a mutation that will add udders to your character, which will edit the title of your character to add udders, and make you moo occasionally.
<syntaxhighlight lang="csharp">
<syntaxhighlight lang="csharp">
using System;
using System;
12

edits