im trying to make an xml patch to change the starting ship and its loadout in the pirate start number 1 where you start with the cargo ship i want to change it to a ship from my mod here is the code so far if anyone can point out if i have anything wrong with it id greatly appreciate it
<?xml version="1.0" encoding="utf-8"?>
<diff>
<replace sel="//macro[@name='ship_pir_s_trans_container_01_a_macro']">
<ship macro="ghost_macro">
</replace>
<replace sel="//macro[@name='ship_pir_s_trans_container_01_a_macro']/loadout/macros">
<engine macro="engine_s_ftl_macro" path="../con_engine_02"/>
<engine macro="engine_s_ftl_macro" path="../con_engine_01"/>
<weapon macro="weapon_s_laser_macro" path="../con_weapon_01"/>
<shield macro="shield_s_aegis_macro" path="../con_shield_01"/>
</replace>
<add sel="//macro[@name='ship_pir_s_trans_container_01_a_macro']/loadout/macros">
<weapon macro="weapon_s_laser_macro" path="../con_weapon_02"/>
<weapon macro="weapon_s_mtorpedo_macro" path="../con_weapon_03"/>
<weapon macro="weapon_s_mtorpedo_macro" path="../con_weapon_04"/>
<shield macro="shield_s_aegis_macro" path="../con_shield_02"/>
</add>
</diff>
question on xml patching
Moderators: Moderators for English X Forum, Scripting / Modding Moderators
Re: question on xml patching
should be <replace sel="//ship[@macro='ship_pir_s_trans_container_01_a_macro']"> since you're trying to replace this node:
<ship macro="ship_pir_s_trans_container_01_a_macro">
...
</ship>
Also, if going that route, you'll have to populate everything within the ship node in the same go since it'll replace the entire node. (Everything between <ship macro="ship_pir_s_trans_container_01_a_macro"> and the closing </ship> line.)
And make sure your mod specifies a dependency to ego_dlc_pirate to make sure that the DLC is loaded before your mod is.