I have a question about patching xml files, I made a little mod with the goal of adding different npcs to stations and for that I needed to change the md/npc_instantiation.xml file. But while replacing the whole file with changes included works fine, it's not really future proof (or other-mods proof for that matter) in any way so I've been looking into patching it properly and this is what I ended up with :
Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<diff xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<replace sel="/mdscript/cues/cue/cues/library[@name='InstantiateNPCs']/actions/do_if/do_if[@value='this.$Object.exists']/do_elseif/
do_if[@value='this.$Object.workforce.amount and this.$Object.workforce.capacity']/do_all/do_all/do_if/do_if[@value='this.$SelectedRace']/do_any">
<set_value name="this.$Role" exact="entityrole.service" weight="50"/>
<set_value name="this.$Role" exact="entityrole.marine" weight="10"/>
<set_value name="this.$Role" exact="entityrole.pilot" weight="20"/>
<set_value name="this.$Role" exact="entityrole.manager" weight="10"/>
</do_any>
</replace>
</diff>

If anyone could help on what's wrong it'd be greatly appreciated
