Jump to content

XPath append issue


JasonX

Recommended Posts

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: 
 

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>


    

Link to comment
Share on other sites

3 hours ago, JasonX said:

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: 
 

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

Edited by doughphunghus (see edit history)
Link to comment
Share on other sites

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']/
Link to comment
Share on other sites

3 hours ago, JasonX said:

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

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...