• If you have a mod, tool or prefab, please use the Resources section. Click Mods at the top of the forums.

XPath append issue

JasonX

Refugee
Hi all,

I'm trying to add a custom electrical recipe to the existing recipes... and I keep getting an error no matter what syntax I use.

Anyone spot what I'm doing wrong?

The error is: 
 

Code:
2023-09-07T18:09:54 34.536 WRN XML patch for "progression.xml" from mod "Test" did not apply: <append xpath="progression/crafting_skill[@name='craftingElectrician']/display_entry[@name_key='electricianT1']/unlock_entry/@item"  (line 14 at pos 2)
The code I'm using is:

<append xpath="progression/crafting_skill[@name='craftingElectrician']/display_entry[@name_key='electricianT1']/unlock_entry/@item">,TestlightIndustrialRed></append>




The code in progression.xml that I'm trying to add to is the first unlock_entry item.. basically adding the custom recipe after the recipe "ceilingLight07_player".

Code:
<crafting_skill name="craftingElectrician" max_level="100" parent="attCrafting" name_key="craftingElectricianName" desc_key="craftingElectricianDesc" long_desc_key="craftingElectricianLongDesc" icon="ui_game_symbol_electric_generator">

        <display_entry icon="generatorBankA" name_key="electricianT1" has_quality="false" unlock_level="25" >
            <unlock_entry item="generatorbank,electricwirerelay,switch,tripwirepost,ceilingLight01_player,industrialLight01_player,industrialLight02_player,ceilingLight07_player" unlock_tier="1" />
        </display_entry>
        <display_entry icon="motionsensor" name_key="electricianT2" has_quality="false" unlock_level="50" >
            <unlock_entry item="motionsensor,electrictimerrelay,pressureplate,pressureplateLong,spotlightPlayer,speaker" unlock_tier="1" />
        </display_entry>
 
Hi all,

I'm trying to add a custom electrical recipe to the existing recipes... and I keep getting an error no matter what syntax I use.

Anyone spot what I'm doing wrong?

The error is: 
 

Code:
2023-09-07T18:09:54 34.536 WRN XML patch for "progression.xml" from mod "Test" did not apply: <append xpath="progression/crafting_skill[@name='craftingElectrician']/display_entry[@name_key='electricianT1']/unlock_entry/@item"  (line 14 at pos 2)
The code I'm using is:

<append xpath="progression/crafting_skill[@name='craftingElectrician']/display_entry[@name_key='electricianT1']/unlock_entry/@item">,TestlightIndustrialRed></append>




The code in progression.xml that I'm trying to add to is the first unlock_entry item.. basically adding the custom recipe after the recipe "ceilingLight07_player".

<crafting_skill name="craftingElectrician" max_level="100" parent="attCrafting" name_key="craftingElectricianName" desc_key="craftingElectricianDesc" long_desc_key="craftingElectricianLongDesc" icon="ui_game_symbol_electric_generator">

        <display_entry icon="generatorBankA" name_key="electricianT1" has_quality="false" unlock_level="25" >
            <unlock_entry item="generatorbank,electricwirerelay,switch,tripwirepost,ceilingLight01_player,industrialLight01_player,industrialLight02_player,ceilingLight07_player" unlock_tier="1" />
        </display_entry>
        <display_entry icon="motionsensor" name_key="electricianT2" has_quality="false" unlock_level="50" >
            <unlock_entry item="motionsensor,electrictimerrelay,pressureplate,pressureplateLong,spotlightPlayer,speaker" unlock_tier="1" />
        </display_entry>

Im on my phone, so i cant verify you entire append xml stuff,  but in your "append"  i believe you need a / before "progression", like this: xpath="/progression/...".  i have a mod with a progression modification, for reference:

https://github.com/doughphunghus/7D2D-Doughs-Mods-a21/blob/main/Doughs-Food-SousChefOfTheApocalypse/Config/progression.xml

 
Last edited:
Turns out that the / didn't matter - though it is best practice.

The issue was I missed a parent "crafting_skills" XML wrapper. :(

THIS

<append xpath="progression/crafting_skills/crafting_skill[@name='craftingElectrician']/


MISSED THE PARENT

Code:
[COLOR=#e8bd89]<append[/COLOR][COLOR=#ebe7e3] [/COLOR][COLOR=#df897a]xpath[/COLOR][COLOR=#d9b180]=[/COLOR][COLOR=#7ea9c4]"progression/crafting_skill[@name='craftingElectrician']/[/COLOR]
 
Turns out that the / didn't matter - though it is best practice.

The issue was I missed a parent "crafting_skills" XML wrapper. :(

THIS

<append xpath="progression/crafting_skills/crafting_skill[@name='craftingElectrician']/


MISSED THE PARENT

<append xpath="progression/crafting_skill[@name='craftingElectrician']/

Did that before, Mixed up tag and tags, took me forever to find the error.

something I started to do after that is to have the vanilla file opened at the same time and copy/paste from it.  Cut down the errors a lot

 
Back
Top