Editing Modding Tutorials/Compatibility with defs

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 162: Line 162:
 
</Defs>
 
</Defs>
 
</source>
 
</source>
 
== Conditional on DLC or other mods ==
 
Sometimes you only need something to be there when a specific mod or DLC is present. For that we use MayRequire and MayRequireAnyOf.
 
 
'''Note:''' the following examples use the DLC for the required content, but it could just as easily require "sarg.alphagenes" as "Ludeon.RimWorld.Biotech".
 
 
MayRequire requires the presence of all listed content. For example a list of pawns may include:
 
<pre>
 
<Tribal_Child MayRequire="Ludeon.RimWorld.Biotech">10</Tribal_Child>
 
</pre>
 
This requires that the [[Biotech DLC]] be enabled for this entry in the list to be used.
 
 
Multiple mods/DLC may be listed to required all of them at once for example:
 
<pre>
 
<li MayRequire="Ludeon.RimWorld.Royalty,Ludeon.RimWorld.Ideology">DarklightBrazier</li>
 
</pre>
 
Which requires both the [[Royalty DLC]] and the [[Ideology DLC]] to be enabled at the same time - if only one is enabled, it won't be included.
 
 
Finally there is MayRequireAnyOf which enables content when any of the list is present. For example:
 
<pre>
 
<li MayRequireAnyOf="Ludeon.RimWorld.Royalty,Ludeon.RimWorld.Biotech">
 
</pre>
 
Would enable the content when Royalty and/or Biotech are enabled.
 
  
 
=Next up=
 
=Next up=

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: