Editing User:Dninemfive

Jump to navigation Jump to search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision Your text
Line 4: Line 4:
  
 
= Sandbox =
 
= Sandbox =
 
== Introduction to reading Def classes ==
 
This article is intended for XML modders who don't want to work with C# (even though it's [[Plague Gun (1.1)|much less imposing than you think]]) but want to know what exactly they can write in their defs.
 
 
=== Definitions ===
 
'''Fields''' are variables in C# class defintions defined at the top of classes (when decompiled). For example, <source lang="csharp">
 
    public class ExampleDef : Def {
 
    public bool exampleBool = true;
 
    public int exampleInteger = 1;
 
    public float exampleFloat = 1.2f;
 
    public bool exampleNonInitializedField;
 
    public RaceProperties exampleClass;
 
}
 
</source>
 
 
'''Nodes''' are XML entries, for example <source lang="xml">
 
<ExampleDef ExampleAnnotation="ExampleValue">
 
    <exampleBool>true</exampleBool?
 
    <exampleInteger>1</exampleInteger>
 
    <exampleFloat>1.2</exampleFloat>
 
    <exampleNonInitializedField>false</exampleNonInitializedField>
 
    <exampleClass>
 
        <intelligence>Animal</intelligence>
 
        <fleshType>Mechanoid</fleshType>
 
        <hasGenders>false</hasGenders>
 
    </exampleClass>
 
</ExampleDef>
 
</source>
 
  
 
== Royalty compatibility ==
 
== Royalty compatibility ==
Line 44: Line 16:
 
=== ModLister.RoyaltyInstalled ===
 
=== ModLister.RoyaltyInstalled ===
 
In C#, the canonical check for whether Royalty is installed is <code>ModLister.RoyaltyInstalled</code>. Notably, this check whether the Steam user ''owns'' Royalty, rather than whether it's enabled in the load order.
 
In C#, the canonical check for whether Royalty is installed is <code>ModLister.RoyaltyInstalled</code>. Notably, this check whether the Steam user ''owns'' Royalty, rather than whether it's enabled in the load order.
=== IfModActive===
+
=== Other ===
You can use the <code>IfModActive</code> and <code>IfModNotActive</code> attributes in <code>LoadFolders.xml</code> to conditionally load defs, treating Royalty as a mod.
+
D9 Framework: <code>PatchOperationFindPackage</code> or <code>PatchOperationRoyaltyInstalled</code>
<source lang="xml">
 
<loadFolders>
 
  <default>
 
    <li>/</li>
 
    <li IfModActive="Royalty">RoyaltyDefs</li>
 
  </default>
 
</loadFolders>
 
</source>
 
=== Other Options ===
 
If you set your mod to require [https://github.com/dninemfive/d9framework D9 Framework], you can use <code>PatchOperationFindPackage</code> (with the packageId <code>Ludeon.RimWorld.Royalty</code>) or <code>PatchOperationRoyaltyInstalled</code> to check whether Royalty is installed, with the former checking whether it's enabled and the latter checking if the user owns it. Using the vanilla <code>PatchOperationFindMod</code> would not be sufficient because it would be enabled if any local mod was called Royalty.
 
 
 
== Framework Mods ==
 
''intended to be a comprehensive list of mods which add features for XML users''
 
* [O21] Toolbox
 
* Advanced Animal Frameworks
 
* BiomesKit
 
* D9 Framework
 
* HugsLib ''(I think)''
 
* JecsTools
 
* OgsTools
 
* Universal Fermenter
 
  
 
== Version Control Intro ==
 
== Version Control Intro ==

Please note that all contributions to RimWorld Wiki are considered to be released under the CC BY-SA 3.0 (see RimWorld Wiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

Cancel Editing help (opens in new window)

This page is a member of 1 hidden category: