Jump to content

XPath Modding Explanation Thread


sphereii

Recommended Posts

Hmm. I think I have another probably stupid question, is it possible to remove the eh... tag "tag"

For example, remove the entire "tags="learnable"" part of a recipie like <recipe name="gunRocketLauncher" craft_area="workbench" count="1" tags="learnable">

 

If you're trying to remove the rocket launcher and ammo from being craftable, but still found in game, this is what I did in recipies.xml.

<!-- Remove recipes (can still find em in game, just not make em) -->
	<remove xpath="/recipes/recipe[@name='gunRocketLauncher']" />
	<remove xpath="/recipes/recipe[@name='ammoRocketFrag']" />
	<remove xpath="/recipes/recipe[@name='ammoRocketHE']" />
	<remove xpath="/recipes/recipe[@name='resourceRocketCasing']" />
	<remove xpath="/recipes/recipe[@name='resourceRocketTip']" />

 

You can re-add the entire recipe without the learnable tag with an Append.

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

Hi everyone :)

 

I would like to change the output for Lead in the Forge but everything i tried, is not working. I am new to XPath modding (have only changed simple things in A15 and A16) This is what i have tried so far...

 

<changedrecipes>

<!-- <append xpath="/recipes/recipe[@name='resourceScrapLead']/@count">3</append> -->


<!-- <set xpath="/recipes/recipe[@name='resourceScrapLead']/@count">3</set> -->


<!-- <set xpath="/recipes/recipe[@name='resourceScrapLead']/ingredient [@name='unit_lead']/@count">3</set> -->

<!-- <set xpath="/recipes/recipe[@name='resourceScrapLead']/ingredient [@name='unitlead']/@count">3</set> -->


<append xpath="/recipes">
<recipe name="resourceScrapLead" count="1" craft_area="forge" material_based="true" craft_time = "1" craft_exp_gain="0" always_unlocked="true">
<ingredient name="unit_lead" count="3"/>
</recipe>

</append>


</changedrecipes>

 

Somehow noone is asking for this to be changed (or i can't find it, been searching on Google, and went thru Nexus, Youtube and this Forum so far) and i am starting to wonder if we can change it at all ? I have tried the codes all seperatly but the output stays at 1.

I have the 'ModInfo.xml' so that's not the problem.

 

Any help is greatly appreciated

 

greets cheeky2

Link to comment
Share on other sites

Hi everyone :)

 

I would like to change the output for Lead in the Forge but everything i tried, is not working. I am new to XPath modding (have only changed simple things in A15 and A16) This is what i have tried so far...

 

<changedrecipes>

<!-- <append xpath="/recipes/recipe[@name='resourceScrapLead']/@count">3</append> -->


<!-- <set xpath="/recipes/recipe[@name='resourceScrapLead']/@count">3</set> -->


<!-- <set xpath="/recipes/recipe[@name='resourceScrapLead']/ingredient [@name='unit_lead']/@count">3</set> -->

<!-- <set xpath="/recipes/recipe[@name='resourceScrapLead']/ingredient [@name='unitlead']/@count">3</set> -->


<append xpath="/recipes">
<recipe name="resourceScrapLead" count="1" craft_area="forge" material_based="true" craft_time = "1" craft_exp_gain="0" always_unlocked="true">
<ingredient name="unit_lead" count="3"/>
</recipe>

</append>


</changedrecipes>

 

Somehow noone is asking for this to be changed (or i can't find it, been searching on Google, and went thru Nexus, Youtube and this Forum so far) and i am starting to wonder if we can change it at all ? I have tried the codes all seperatly but the output stays at 1.

I have the 'ModInfo.xml' so that's not the problem.

 

Any help is greatly appreciated

 

greets cheeky2

 

Let's try something like this. This will remove the existing wildcard_forge_category, and add a new one.

 

<changedrecipes>
   <remove xpath="/recipes/recipe[@name='resourceScrapLead']/wildcard_forge_category" />
   <append xpath="/recipes/recipe[@name='resourceScrapLead']">
         <ingredient name="unit_lead" count="3" />
   </append>
</changerecipes>

Link to comment
Share on other sites

Hi guys i got a new Error for unknown reasons.

 

i added new Lootcontainer like the screenshot below shows:

http://prntscr.com/m4v61y

http://prntscr.com/m4v6bj

 

the new Container are named "metalJunk" and "otherJunk"

 

after the New Container, i added the Group "otherJunk" to the LootGroup "Garbage"

but when i start the Game the following Error is shown:

 

http://prntscr.com/m4v4yv

 

Can anyone explain me why this happend ? the new Container are above the edit once in loading order.

Link to comment
Share on other sites

Hi guys i got a new Error for unknown reasons.

 

i added new Lootcontainer like the screenshot below shows:

http://prntscr.com/m4v61y

http://prntscr.com/m4v6bj

 

the new Container are named "metalJunk" and "otherJunk"

 

after the New Container, i added the Group "otherJunk" to the LootGroup "Garbage"

but when i start the Game the following Error is shown:

 

http://prntscr.com/m4v4yv

 

Can anyone explain me why this happend ? the new Container are above the edit once in loading order.

 

Sounds like its being added out-of-order.

 

Change your appends to be:

 

<insertAfter xpath="/lootcontainers/lootcontainer[@name='Garbage']" >
  <!--  your xml -->
</insertAfter>

 

This should explicity place it after the garbage loot container, allowing it to load in order.

Link to comment
Share on other sites

so should i write:

<insertAfter xpath="/lootcontainers/lootcontainer[@name='Garbage']" >
<item group="otherJunk" count="1,3" prob="0.60"/>
</insertAfter>

 

or

 

<insertAfter xpath="/lootcontainers/lootcontainer[@name='Garbage']" >
<!-- The whole script from loot.xml file ??? -->
</insertAfter>

 

never used "insertAfter" before :D

Link to comment
Share on other sites

so should i write:

<insertAfter xpath="/lootcontainers/lootcontainer[@name='Garbage']" >
<item group="otherJunk" count="1,3" prob="0.60"/>
</insertAfter>

 

or

 

<insertAfter xpath="/lootcontainers/lootcontainer[@name='Garbage']" >
<!-- The whole script from loot.xml file ??? -->
</insertAfter>

 

never used "insertAfter" before :D

 

insertAfter is exactly like an append, but it'll insert your snippet in a position.

 

<insertAfter xpath="/lootcontainers/lootcontainer[@name='Garbage']" >
   <lootgroup name="metalJunk" >
          <!-- your other stuff -->
   </lootgroup>

   <lootgroup name="otherJunk" >
          <!-- your other stuff -->
   </lootgroup>

</insertAfter>

Link to comment
Share on other sites

so do i need the write the <append xyz> command to start with insert after?

<configs>
<append xpath="/lootcontainers">  ----- IS THIS STILL NEEDED ?????? cuz of setting the path !?
<insertAfter xpath="/lootcontainers/lootcontainer[@name='Garbage']" >
<lootgroup name="metalJunk">
      ---ALL THE STUFF
       </lootgroup>
</insertAfter>
</append>

 

anyway

<insertAfter xpath="/lootcontainers/lootcontainer[@name=Garbage]" >

... i mean garbage was a LootGroup instead a Lootcontainer

<insertAfter xpath="/lootcontainers/lootgroup[@name=Garbage]" >

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

How it looks like atm:

(<insertAfter xpath="/lootcontainers/lootcontainer[@name=Garbage]" >) -lootcontainer

http://prntscr.com/m4vvd0

http://prntscr.com/m4vvn5

 

and error:

http://prntscr.com/m4vuwo

 

i also tried to to set

<insertAfter xpath="/lootcontainers/lootgroup[@name=Garbage]" > -lootgroup

but nearly same issue:

http://prntscr.com/m4vxe1

 

 

lootgroup[@name=garbage] Try that. Need to match the entry in the file.

Link to comment
Share on other sites

<insertAfter xpath="/lootcontainers/lootgroup[@name='garbage']">
<item group="otherJunk" count="1,3" prob="0.80"/>
<item group="metalJunk" count="1,3" prob="1.0"/>
</insertAfter>

looks like it would load the game without any errors.

 

but i checked 0ver 100 container and didn't get a single item from my both Container (otherJunk / metalJunk) .....

Link to comment
Share on other sites

<insertAfter xpath="/lootcontainers/lootgroup[@name='garbage']">
<item group="otherJunk" count="1,3" prob="0.80"/>
<item group="metalJunk" count="1,3" prob="1.0"/>
</insertAfter>

looks like it would load the game without any errors.

 

but i checked 0ver 100 container and didn't get a single item from my both Container (otherJunk / metalJunk) .....

 

Do an exportcurrentconfigs, then look at the loot.xml in the path it provides you in the console (it's the save game folder), and see if your changes applied to the file.

Link to comment
Share on other sites

my command:

<insertAfter xpath="/lootcontainers/lootgroup[@name='garbage']">
<item group="otherJunk" count="1,3" prob="0.80"/>
<item group="metalJunk" count="1,3" prob="1.0"/>
</insertAfter>

 

the config shows me the issue:

 

<lootgroup name="garbage">
<item group="junk" />
</lootgroup>
<item group="metalJunk" count="1,3" prob="1.0"><!--Element inserted by: "NewLifeExperience_Addon_MoreJunkItems"--></item>
<item group="otherJunk" count="1,3" prob="0.80"><!--Element inserted by: "NewLifeExperience_Addon_MoreJunkItems"--></item>

 

as you can see, my both lootgrous are out of reachable point^^ so this is a issue from the insertAfter command i think^^

could you help again to fix it :D ?

Link to comment
Share on other sites

my command:

<insertAfter xpath="/lootcontainers/lootgroup[@name='garbage']">
<item group="otherJunk" count="1,3" prob="0.80"/>
<item group="metalJunk" count="1,3" prob="1.0"/>
</insertAfter>

 

the config shows me the issue:

 

<lootgroup name="garbage">
<item group="junk" />
</lootgroup>
<item group="metalJunk" count="1,3" prob="1.0"><!--Element inserted by: "NewLifeExperience_Addon_MoreJunkItems"--></item>
<item group="otherJunk" count="1,3" prob="0.80"><!--Element inserted by: "NewLifeExperience_Addon_MoreJunkItems"--></item>

 

as you can see, my both lootgrous are out of reachable point^^ so this is a issue from the insertAfter command i think^^

could you help again to fix it :D ?

Since it doesn't matter where it needs to exist, you can just use append :)

<append xpath="/lootcontainers/lootgroup[@name='garbage']">
       <item group="otherJunk" count="1,3" prob="0.80"/>
       <item group="metalJunk" count="1,3" prob="1.0"/>
</append>

Link to comment
Share on other sites

Hi again :)

 

Thanks for trying to help :)

 

This is not working either. I thought about removing xpath... but didn't know i could use the 'wildcard forge category' in it because it is not mentioned there.

It's still only giving 1 - i also tried this:

 

<changedrecipes>


   <remove xpath="/recipes/recipe[@name='resourceScrapLead']">
         <ingredient name="unit_lead" count="1" /> </remove>


    <append xpath="/recipes/recipe[@name='resourceScrapLead']">
         <ingredient name="unit_lead" count="3" />
   </append>

</changerecipes>

 

and this

 

<changedrecipes>


   <remove xpath="/recipes/recipe[@name='resourceScrapLead']/wildcard_forge_category">
         <ingredient name="unit_lead" count="1" /> </remove>


    <append xpath="/recipes/recipe[@name='resourceScrapLead']">
         <ingredient name="unit_lead" count="3" />
   </append>

</changedrecipes> 

 

still no luck. I tried your suggestion with and without the </remove> at the end.

 

greets cheeky2

Edited by cheeky2
Added a comment (see edit history)
Link to comment
Share on other sites

Hi again :)

 

Thanks for trying to help :)

 

This is not working either. I thought about removing xpath... but didn't know i could use the 'wildcard forge category' in it because it is not mentioned there.

It's still only giving 1 - i also tried this:

 

<changedrecipes>


   <remove xpath="/recipes/recipe[@name='resourceScrapLead']">
         <ingredient name="unit_lead" count="1" /> </remove>


    <append xpath="/recipes/recipe[@name='resourceScrapLead']">
         <ingredient name="unit_lead" count="3" />
   </append>

</changerecipes>

 

and this

 

<changedrecipes>


   <remove xpath="/recipes/recipe[@name='resourceScrapLead']/wildcard_forge_category">
         <ingredient name="unit_lead" count="1" /> </remove>


    <append xpath="/recipes/recipe[@name='resourceScrapLead']">
         <ingredient name="unit_lead" count="3" />
   </append>

</changedrecipes> 

 

still no luck. I tried your suggestion with and without the </remove> at the end.

 

greets cheeky2

 

The remove is a single line command. Be sure to end it with />

 

You are telling xpath to remove the node called wildcard_forge_category

 

<remove xpath="/recipes/recipe[@name='resourceScrapLead']/wildcard_forge_category" />

Link to comment
Share on other sites

Hi again :)

 

ok i didn't know that but when i try this (your suggestion from my first post)...

 

<changedrecipes>
   <remove xpath="/recipes/recipe[@name='resourceScrapLead']/wildcard_forge_category" />
   <append xpath="/recipes/recipe[@name='resourceScrapLead']">
         <ingredient name="unit_lead" count="3" />
   </append>
</changerecipes>

 

i get an error: Failed loading xml and parsing XML (recipes.xml)

XML exeption 'changed recipes' is expected Line 7 Position 10

so i tried some other codes which i could think of might work or not (in my second post)...

 

tried this now and get yet another error in Line 12 which is the Line where <changedrecipes> is written... :(

 

<changedrecipes>


   <remove xpath="/recipes/recipe[@name='resourceScrapLead']">
         <ingredient name="unit_lead" count="1" /> 


    <append xpath="/recipes/recipe[@name='resourceScrapLead']">
         <ingredient name="unit_lead" count="3" />
   </append>

</changerecipes>

 

omg i see it... changedrecipes and change(d)recipes... ok going to try again pff I just copied your code and didn't see that the d is missing lol

 

 

Still not working tho. I will try Malacay2k11's suggestion and see if that works.

 

thanks again for trying to help :)

 

greets cheeky2

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

@Cheeky2

 

amout of scrap_lead is appended on the material.xml and weight of the item...

 

every item with "Material" "Mlead" are scraped to Scrap_Lead. also the Forged merged these kind of Items into Scrap...

maybe you should just edit the weight of Lead items, to increase the Lead output !?

Link to comment
Share on other sites

Hi again :)

 

ok this works... thanks Malacay2k11 for the tip with the weight... it was in items.xml not in materials.xml btw.

<changedforgeoutput>

<append xpath="/items">
<item name="resourceScrapBrass"> <!-- scrap material -->
<property name="HoldType" value="45"/>
<property name="Meshfile" value="Items/Misc/sackPrefab"/>
<property name="DropMeshfile" value="Items/Misc/sack_droppedPrefab"/>
<property name="Material" value="MresourceScrapBrassSmall"/>
<property name="Stacknumber" value="6000"/> <!-- STK resource -->
<property name="Weight" value="3"/>                                                <<< changed this
<property name="EconomicValue" value="20"/>
<property name="EconomicBundleSize" value="10"/>
<property name="Group" value="Resources"/>
</item>

<item name="resourceScrapLead"> <!-- scrap material -->
<property name="HoldType" value="45"/>
<property name="Meshfile" value="Items/Misc/sackPrefab"/>
<property name="DropMeshfile" value="Items/Misc/sack_droppedPrefab"/>
<property name="Material" value="MresourceScrapLeadSmall"/>
<property name="Stacknumber" value="6000"/> <!-- STK resource -->
<property name="Weight" value="3"/>                                              <<< changed this
<property name="EconomicValue" value="20"/>
<property name="EconomicBundleSize" value="10"/>
<property name="Group" value="Resources"/>
</item>
</append>

</changedforgeoutput>

 

Thanks for all the help @sphereii and @ Malacay2k11 :)

greets cheeky2

Link to comment
Share on other sites

i can't use <append> to add my own LootContainer to "garbage"

cuz in den exportet Config, my own Containers are shown on the bottom of loot.xml

 

https://pastebin.com/cVLSGXps

 

error said wrong loading order...

so i need a way to place my own Container before gargabe....

 

Sorry, I may have misunderstood. Rather than insertAfter, try insertBefore. Same syntax.

 

- - - Updated - - -

 

Can you only change things within the Config folder with Xpath? What about referencing the 'World' folder to alter things in there, is that possible?

 

Correct, only the files under Config. We are hoping for more support in the future for prefab loading, etc.

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...