Skip to content

GasDef Properties

NachoToast edited this page Mar 28, 2025 · 14 revisions

All possible properties for you GasDefs.

Source: GasDef.cs

Full Example

<SCGF.GasDef ParentName="GasBase">
    <defName>MyCustomGas</defName>
    <label>my custom gas</label>

    <!-- RGB colour values. -->
    <color>(0, 123, 234)</color>

    <!-- Density decreases by 3 (~1%) every gas tick. -->
    <dissipationRate>3</dissipationRate>

    <!-- Can diffuse into surrounding cells. -->
    <diffuses>true</diffuses>

    <appliesTo>
        <!-- Apply to pawns with 'organic' flesh... -->
        <li Class="SCGF.Filters.Organic" />

        <!-- That also have the kind or psychopath traits. -->
        <li Class="SCGF.Filters.Traits">
            <traits>
                <li>Kind</li>
                <li>Psychopath</li>
            </traits>
        </li>
    </appliesTo>

    <immunityWhen>
        <!-- Mouth-covering protective apparel (like gas masks) mean immunity for this gas. -->
        <li Class="SCGF.Filters.ProtectiveApparel">
            <types>
                <li>Mouth</li>
            </types>
        </li>

        <!-- Alternatively, pawns with red eyes are also immune.  -->
        <li Class="SCGF.Filters.Genes">
            <genes>
                <li>Eyes_Red
            </genes>
        </li>
    </immunityWhen>

    <actions>
        <!-- Give the Carcinoma hediff. -->
        <li Class="SCGF.Actions.ApplyHediff">
            <hediffDef>Carcinoma</hediffDef>
        </li>

        <!-- As well as toxic buildup. -->
        <li Class="SCGF.Actions.DoToxicDamage" />
    </actions>

    <immuneActions>
        <!-- Immune pawns get sand in their eyes lol. -->
        <li Class="SCGF.Actions.ApplyHediff">
            <hediffDef>SandInEyes</hediffDef>
        </li>
    </immuneActions>

    <texPath>Things/Gas/GasCloudThickA</texPath>

    <shaderPath>Map/GasRotating</shaderPath>
</SCGF.GasDef>

Required Properties

These properties must be defined!

defName

Type string
Example
<defName>MyCustomGasWow</defName>

Unique identifier for this gas.

label

Type string
Example
<label>tox gas 2: electric boogaloo</label>

Display name for this gas.

Vanilla Values
Blind Smoke blind smoke
Tox Gas tox gas
Rot Stink rot stink
Deadlife Dust deadlife dust

color

Type color
Example
<color>(255, 255, 255)</color>

RGB colour values, can either be from 0 to 255 or 0 to 1, alpha supported. I like to use this colour mixing tool.

Vanilla Values
Blind Smoke (200, 200, 200)
Tox Gas (180, 214, 24)
Rot Stink (214, 90, 24)
Deadlife Dust (3, 13, 51)

Optional Properties

dissipationRate

Type int
Default
<dissipationRate>0</dissipationRate>

How many "particles" of the gas are lost every gas tick. Goes from 0 to 255, with 0 meaning the gas will last forever, and 255 meaning the gas will almost instantly disappear.

Vanilla Values
Blind Smoke 4
Tox Gas 3
Rot Stink 4
Deadlife Dust 3

diffuses

Type bool
Default
<diffuses>false</diffuses>

Whether this gas can spread into adjacent cells when possible.

Vanilla Values
Blind Smoke false
Tox Gas true
Rot Stink true
Deadlife Dust true

appliesTo

Type List<GasFilter|>
Default Empty List
Example
<appliesTo>
    <!-- Apply to pawns with 'organic' flesh... -->
    <li Class="SCGF.Filters.Organic" />

    <!-- That also have the kind or psychopath traits. -->
    <li Class="SCGF.Filters.Traits">
        <traits>
            <li>Kind</li>
            <li>Psychopath</li>
        </traits>
    </li>
</appliesTo>

List of Gas Filters that determine which pawns this gas can affect. A pawn must pass all of the filters to be affected.

immunityWhen

Type List<GasFilter>
Default Empty List
Example
<immunityWhen>
    <!-- Mouth-covering protective apparel (like gas masks) mean immunity for this gas. -->
    <li Class="SCGF.Filters.ProtectiveApparel">
        <types>
            <li>Mouth</li>
        </types>
    </li>

    <!-- Alternatively, pawns with red eyes are also immune.  -->
    <li Class="SCGF.Filters.Genes">
        <genes>
            <li>Eyes_Red
        </genes>
    </li>
</immunityWhen>

List of Gas Filters that filter pawns that the gas would otherwise apply to. If a pawn passes any of the filters they are counted as immune to the gas.

actions

Type List<GasAction>
Default Empty List
Example
<actions>
    <!-- Give the Carcinoma hediff. -->
    <li Class="SCGF.Actions.ApplyHediff">
        <hediffDef>Carcinoma</hediffDef>
    </li>

    <!-- As well as toxic buildup. -->
    <li Class="SCGF.Actions.DoToxicDamage" />
</actions>

List of Gas Actions that run for every pawn that is affected by this gas and not considered immune.

immuneActions

Type List<GasAction>
Default Empty List
Example
<immuneActions>
    <!-- Immune pawns get sand in their eyes lol. -->
    <li Class="SCGF.Actions.ApplyHediff">
        <hediffDef>SandInEyes</hediffDef>
    </li>
</immuneActions>

List of Gas Actions that run for every pawn that is affected by this gas and considered immune.

texPath

Type string
Default Things/Gas/GasCloudThickA
Example
<texPath>Things/Item/Skull/Skull_a</texPath>

Path to the texture to use for the gas cloud, you shouldn't change this unless you know what you're doing.

shaderPath

Type string
Default Map/GasRotating
Example
<shaderPath>Map/SolidColor</shaderPath>

Path to the shader to use for rendering this gas, you shouldn't change this unless you know what you're doing.

Clone this wiki locally