Modding:General Best Practices: Difference between revisions

From Caves of Qud Wiki
Jump to navigation Jump to search
imported>CaptainTechnicality54384
No edit summary
imported>CaptainTechnicality54384
mNo edit summary
Line 4: Line 4:


<syntaxhighlight lang="xml">
<syntaxhighlight lang="xml">
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<objects>
<objects>
  <object Name="ALPHABEARDMODS_CoolNewSword" Load="Merge">
  <object Name="ALPHABEARDMODS_CoolNewSword" Load="Merge">
...
...
  </object>  
  </object>  
</objects>
</objects>
</syntaxhighlight>
</syntaxhighlight>


Line 18: Line 18:


<syntaxhighlight lang="xml">
<syntaxhighlight lang="xml">
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<objects>
<objects>
  <object Name="Chain Mail" Load="Merge">
  <object Name="Chain Mail" Load="Merge">
    <part Name="Armor" DV="2" />
    <part Name="Armor" DV="2" />
  </object>  
  </object>  
</objects>
</objects>
</syntaxhighlight>
</syntaxhighlight>

Revision as of 15:56, 23 May 2019

Prefix your object and table names with some unique ID

For instance, alphabeardmods_{id}, this will prevent namespace conflicts with official content and other mods in the future.

<?xml version="1.0" encoding="utf-8"?>
<objects>
  <object Name="ALPHABEARDMODS_CoolNewSword" Load="Merge">
...
  </object> 
</objects>

Only include your content and the minimum changeset via Load="Merge" in tables and object definitions

Don't copy the whole contents of the game xml. You only need to include new content.

For objects and encountertables, if you're editing an existing item you can use Load="Merge" in it's tag and only specify new items. For example, if I wanted my mod to give chain mail a 2DV:

<?xml version="1.0" encoding="utf-8"?>
<objects>
  <object Name="Chain Mail" Load="Merge">
    <part Name="Armor" DV="2" />
  </object> 
</objects>