Skip to content

XML Modding ‐ Migration Guide for 1.3.0

tmp64 edited this page Dec 31, 2024 · 2 revisions

Migration Guide for 1.3.0

Chairloader 1.3.0 uses new XML Merging v3, which breaks compatibility with old mods. This article guides you how to upgrade your mod to XML Merging v3.

Common steps

  1. Remove all ch:patch_mode.
    This mode is now the default. If you need the old behavior without ch:patch_mode="true" (replace the entire node), set ch:action="replace".
  2. Replace ch:apply_if with ch:applyIf.
    Attribute was renamed for consistency.
  3. Replace ch:remove="true" with ch:action="delete".
    ch:patch_mode and ch:remove were combined into ch:action.

Level steps

For each mission_mission0.xml file:

  1. Make sure that every node in <Objects> (like <Entity>, <Object>, <Decal>) has EntityGuid attribute. This attribute is generated for non-entities. See Chairloader's PreyFiles for reference.
  2. Remove all EntityId attributes from <Entity>. This ID is now auto-generated. Click here for details.
  3. Replace all references of EntityID (e.g. in flowgraphs and entity links) with $(EntityId:[guid]). Click here for details.

For each level:

  1. Delete serialize.xml file. This file is now auto-generated. Set ch:serialize="true" for entities that you want to serialize. Click here for details.

Special steps

Try to install and merge your mod. You might get a few more errors.

  • Error: Set ch:action="replaceChildren" to replace children but merge attributes
    This node's children can't be patched. You must set ch:action="replaceChildren" so all of the node's children are replaced by your node's.
  • Index attribute is missing for an array element
    The node is now an array. Array node must specify ch:index attribute so the merger knows which node you want to mod. Find the index in in the file in Chairloader's PreyFiles.
  • Read-only attribute ? was changed from '?' to '?' Certain attributes (like internal names) are now read-only. Mods can't modify them on existing nodes. Revert the change in your mod or just remove the attribute.