Jump to content

What would the code be...


Recommended Posts

I need to change the following recipe from

 

<recipe name="ammo9mmBulletBall" count="1" craft_area="workbench" tags="workbenchCrafting">

 

to

 

<recipe name="ammo9mmBulletBall" count="1" craft_area="workbench,Ammo Crafting Station" tags="workbenchCrafting">

 

and just wondering the best way to do this, I need to do this for all ammunition.

Link to comment
Share on other sites

  • AaronG85 changed the title to What would the code be...

<append xpath="/recipes/recipe[@name='ammo9mmBulletBall']/@craft_area">,AmmoCraftingStation</append>

You may want to get rid of spaces in your item names. Chances are it'll cause issues. Use underscore in place of them, or use localization to add spaces.

Link to comment
Share on other sites

Hi Aaron:  Crossed posts with Telric, above, but this is essentially the same, just using attribute instead of appending. I don't know which is 'more correct', but think both will work.
 

In your (drive)\Steam\steamapps\common\7 Days To Die\Mods\(modname)\config\recipes.xml:-

<setattribute xpath="/recipes/recipe[
            @name='ammo9mmBulletBall'
            or @name='ammo9mmBulletAP'
            or @name='ammo9mmBulletHP'
            or @name=ammo762mmBulletBall'
            or @name='ammo762mmBulletAP'
            or @name='ammo762mmBulletAP']" name="craft_area">workbench,AmmoCraftingStation</setattribute>

Add the rest of your ammo as above. You can also write it as below, all inline, but I find it a bit tedious to find one out of a long list.

 <setattribute xpath="/recipes/recipe[ @name='ammo9mmBulletBall' or @name='ammo9mmBulletAP' or @name='ammo9mmBulletHP' or @name='ammo762mmBulletBall' or @name='ammo762mmBulletAP' or @name='ammo762mmBulletAP']" name="craft_area">workbench,Ammo Crafting Station</setattribute>

 

Regards,
pj

 

 

Link to comment
Share on other sites

22 hours ago, Telric said:

<append xpath="/recipes/recipe[@name='ammo9mmBulletBall']/@craft_area">,AmmoCraftingStation</append>

You may want to get rid of spaces in your item names. Chances are it'll cause issues. Use underscore in place of them, or use localization to add spaces.

 

Ive set the code as

 

	<append xpath="/recipes/recipe[@name='ammo9mmBulletBall']/@craft_area">,AmmoCraftingStation</append>
	<append xpath="/recipes/recipe[@name='ammoBundle9mmBulletHP']" name="craft_area">workbench,ammoCraftingStation</append>
	<append xpath="/recipes/recipe[@name='ammoBundle9mmBulletAP']" name="craft_area">workbench,ammoCraftingStation</append>
	<append xpath="/recipes/recipe[@name='ammoBundle44MagnumBulletBall']" name="craft_area">workbench,ammoCraftingStation</append>
	<append xpath="/recipes/recipe[@name='ammoBundle44MagnumBulletHP']" name="craft_area">workbench,ammoCraftingStation</append>
	<append xpath="/recipes/recipe[@name='ammoBundle44MagnumBulletAP']" name="craft_area">workbench,ammoCraftingStation</append>
	<append xpath="/recipes/recipe[@name='ammoBundle762mmBulletBall']" name="craft_area">workbench,ammoCraftingStation</append>
	<append xpath="/recipes/recipe[@name='ammoBundle762mmBulletHP']" name="craft_area">workbench,ammoCraftingStation</append>
	<append xpath="/recipes/recipe[@name='ammoBundle762mmBulletAP']" name="craft_area">workbench,ammoCraftingStation</append>
	<append xpath="/recipes/recipe[@name='ammoBundleShotgunShell']" name="craft_area">workbench,ammoCraftingStation</append>
	<append xpath="/recipes/recipe[@name='ammoBundleShotgunSlug']" name="craft_area">workbench,ammoCraftingStation</append>
	<append xpath="/recipes/recipe[@name='ammoBundleShotgunBreachingSlug']" name="craft_area">workbench,ammoCraftingStation</append>
	<append xpath="/recipes/recipe[@name='ammoBundleJunkTurretRegular']" name="craft_area">workbench,ammoCraftingStation</append>
	<append xpath="/recipes/recipe[@name='ammoBundleJunkTurretShell']" name="craft_area">workbench,ammoCraftingStation</append>
	<append xpath="/recipes/recipe[@name='ammoBundleJunkTurretAP']" name="craft_area">workbench,ammoCraftingStation</append>
	<append xpath="/recipes/recipe[@name='ammoBundleArrowStone']" name="craft_area">workbench,ammoCraftingStation</append>
	<append xpath="/recipes/recipe[@name='ammoBundleArrowIron']" name="craft_area">workbench,ammoCraftingStation</append>
	<append xpath="/recipes/recipe[@name='ammoBundleArrowSteelAP']" name="craft_area">workbench,ammoCraftingStation</append>
	<append xpath="/recipes/recipe[@name='ammoBundleArrowFlaming']" name="craft_area">workbench,ammoCraftingStation</append>
	<append xpath="/recipes/recipe[@name='ammoBundleArrowExploding']" name="craft_area">workbench,ammoCraftingStation</append>
	<append xpath="/recipes/recipe[@name='ammoBundleCrossbowBoltStone']" name="craft_area">workbench,ammoCraftingStation</append>
	<append xpath="/recipes/recipe[@name='ammoBundleCrossbowBoltIron']" name="craft_area">workbench,ammoCraftingStation</append>
	<append xpath="/recipes/recipe[@name='ammoBundleCrossbowBoltSteelAP']" name="craft_area">workbench,ammoCraftingStation</append>
	<append xpath="/recipes/recipe[@name='ammoBundleCrossbowBoltFlaming']" name="craft_area">workbench,ammoCraftingStation</append>
	<append xpath="/recipes/recipe[@name='ammoBundleCrossbowBoltExploding']" name="craft_area">workbench,ammoCraftingStation</append>
	
	<append xpath="/recipes/recipe[@name='ammo9mmBulletBall']/@tags">,ammoCraftingStation</append>
	<append xpath="/recipes/recipe[@name='ammoBundle9mmBulletHP']/@tags">,ammoCraftingStation</append>
	<append xpath="/recipes/recipe[@name='ammoBundle9mmBulletAP']/@tags">,ammoCraftingStation</append>
	<append xpath="/recipes/recipe[@name='ammoBundle44MagnumBulletBall']/@tags">,ammoCraftingStation</append>
	<append xpath="/recipes/recipe[@name='ammoBundle44MagnumBulletHP']/@tags">,ammoCraftingStation</append>
	<append xpath="/recipes/recipe[@name='ammoBundle44MagnumBulletAP']/@tags">,ammoCraftingStation</append>
	<append xpath="/recipes/recipe[@name='ammoBundle762mmBulletBall']/@tags">,ammoCraftingStation</append>
	<append xpath="/recipes/recipe[@name='ammoBundle762mmBulletHP']/@tags">,ammoCraftingStation</append>
	<append xpath="/recipes/recipe[@name='ammoBundle762mmBulletAP']/@tags">,ammoCraftingStation</append>
	<append xpath="/recipes/recipe[@name='ammoBundleShotgunShell']/@tags">,ammoCraftingStation</append>
	<append xpath="/recipes/recipe[@name='ammoBundleShotgunSlug']/@tags">,ammoCraftingStation</append>
	<append xpath="/recipes/recipe[@name='ammoBundleShotgunBreachingSlug']/@tags">,ammoCraftingStation</append>
	<append xpath="/recipes/recipe[@name='ammoBundleJunkTurretRegular']/@tags">,ammoCraftingStation</append>
	<append xpath="/recipes/recipe[@name='ammoBundleJunkTurretShell']/@tags">,ammoCraftingStation</append>
	<append xpath="/recipes/recipe[@name='ammoBundleJunkTurretAP']/@tags">,ammoCraftingStation</append>
	<append xpath="/recipes/recipe[@name='ammoBundleArrowStone']/@tags">,ammoCraftingStation</append>
	<append xpath="/recipes/recipe[@name='ammoBundleArrowIron']/@tags">,ammoCraftingStation</append>
	<append xpath="/recipes/recipe[@name='ammoBundleArrowSteelAP']/@tags">,ammoCraftingStation</append>
	<append xpath="/recipes/recipe[@name='ammoBundleArrowFlaming']/@tags">,ammoCraftingStation</append>
	<append xpath="/recipes/recipe[@name='ammoBundleArrowExploding']/@tags">,ammoCraftingStation</append>
	<append xpath="/recipes/recipe[@name='ammoBundleCrossbowBoltStone']/@tags">,ammoCraftingStation</append>
	<append xpath="/recipes/recipe[@name='ammoBundleCrossbowBoltIron']/@tags">,ammoCraftingStation</append>
	<append xpath="/recipes/recipe[@name='ammoBundleCrossbowBoltSteelAP']/@tags">,ammoCraftingStation</append>
	<append xpath="/recipes/recipe[@name='ammoBundleCrossbowBoltFlaming']/@tags">,ammoCraftingStation</append>
	<append xpath="/recipes/recipe[@name='ammoBundleCrossbowBoltExploding']/@tags">,ammoCraftingStation</append>
	<append xpath="/recipes/recipe[@name='ammoBundleCrossbowBoltExploding']/@tags">,ammoCraftingStation</append>

 

But still nothing shows up in the ammoCraftingStation, the only thing that shows up are my custom bullets which have " craft_area="ammoCraftingStation" tags="learnable,ammoCraftingStation">

 

Any ideas?

Link to comment
Share on other sites

Try the method I posted earlier above.  I should add that, after looking at Telic's post - I realized I had also added spaces in the "Crafting Station" name. Try it as I've re-written it now, and just using those two or three bullets for the test, and see if it works.

Link to comment
Share on other sites

3 hours ago, AaronG85 said:
<append xpath="/recipes/recipe[@name='ammoBundle9mmBulletHP']" name="craft_area">

This isn't a valid xpath format. 1) you're closing the xpath with the ]" so the name= part isn't even making it into the format. 2) your very first xpath is correct.

 

<append xpath="/recipes/recipe[@name='ammo9mmBulletBall']/@craft_area">

This line will append whatever you add within the node to the craft_area attribute. So if you put

 

,ammoCraftingStation

 

that will be added, which will make it show up. Your tag changes look correct as well.

On another note, if you are making a custom crafting station, you'll need to set up the UI for that. Not sure if you've done this already.

Link to comment
Share on other sites

 

46 minutes ago, AaronG85 said:

Yeah got the UI and everything else working i just cant seem to craft? Ill dig through the code tomorrow and figure it out, hopefully lol, thanks for all the help

 

Probably because you are doing this:

 

<append xpath="/recipes/recipe[@name='ammoBundle9mmBulletHP']" name="craft_area">workbench,ammoCraftingStation</append>

 

Note that you have

workbench,ammoCraftingStation

for craft_area  where it should be

,ammoCraftingStation

 

Also suggestion to improve the code

 

To use less lines, I would recommend writing it like this:

 

<append xpath="/recipes/recipe[contains(@name,'ammo') and not(contains(@name,'dart'))]/@craft_area">,ammoCraftingStation</append>

 

If I typed it right, this one line of code should add ammoCraftingStation to all ammo recipes except for darts.

Link to comment
Share on other sites

One liners are good!    ..and in my own case I did this:

<!-- Items that can be crafted in pj's AmmoWeaponWorkBench -->
    <set xpath="/recipes/recipe[contains(@name,'gun') and @craft_area='workbench']/@craft_area">AmmoWeaponWorkBench</set>    
    <set xpath="/recipes/recipe[contains(@name,'ammo') and @craft_area='workbench']/@craft_area">AmmoWeaponWorkBench</set>

 

Link to comment
Share on other sites

I've tried both @BFT2020 and @paulj_3 methods and have found that BFT2020 line works but its strange its adding it to a workbench (there is a little hammer next to all the ammo now) but still wont show up in the ammoCraftingStation, guns will but no ammo?. I have checked the block name and its ammoCraftingStation, ive got the following code in my ammoCraftingStation

 

<property name="CraftingAreaRecipes" value="workbench,ammoCraftingStation"/>

 

Link to comment
Share on other sites

Interesting. . . I've been using those two lines of code since A19, maybe A18 and I can only create (and dismantle) ammo, guns and gun parts in the AmmoWeaponWorkBench - but why do you want to craft ammo from both the Workbench and the Ammo Crafting Station? or am I missing something here (but I'm also not the brightest light bulb around). . .

 

Link to comment
Share on other sites

1 hour ago, AaronG85 said:

I've tried both @BFT2020 and @paulj_3 methods and have found that BFT2020 line works but its strange its adding it to a workbench (there is a little hammer next to all the ammo now) but still wont show up in the ammoCraftingStation, guns will but no ammo?. I have checked the block name and its ammoCraftingStation, ive got the following code in my ammoCraftingStation

 

<property name="CraftingAreaRecipes" value="workbench,ammoCraftingStation"/>

 

 

This is out of the box thinking, but have you tried changing the tag name?

 

For workbench, it has workbench for craft_area and workbenchCrafting for tag.  Maybe try changing the tag for ammoCraftingStation to aCSCrafting (I shorthand the first 3 letters).  Not sure if have the craft_area and the tags the same is causing the issue.

 

Chemistry station is similar to the workbench.

 

<recipe name="carBattery" count="1" craft_area="chemistryStation" tags="learnable,perkGreaseMonkey,chemStationCrafting">

 

Also, another out of the box thought - can the game do crafting out of two stations on one recipe (workbench,ammoCrafting) or does it need to have two separate recipes (one for each workstation)?

 

Herbal Antibiotics has two recipes for different locations.  Granted the crafting amounts are different, but I couldn't find an example of one recipe listing multiple crafting stations.

Link to comment
Share on other sites

8 hours ago, BFT2020 said:

Also, another out of the box thought - can the game do crafting out of two stations on one recipe (workbench,ammoCrafting) or does it need to have two separate recipes (one for each workstation)?

 

6 hours ago, bdubyah said:

Pretty sure you can only have one craft_area per recipe.

 

Looks that way, I just added a new recipe for ammo9mmBulletIncendiary and put the craft station as ammoCraftingStation and now it works perfectly. Thank you everyone (especially @BFT2020) for your help and support.

9 hours ago, paulj_3 said:

Interesting. . . I've been using those two lines of code since A19, maybe A18 and I can only create (and dismantle) ammo, guns and gun parts in the AmmoWeaponWorkBench - but why do you want to craft ammo from both the Workbench and the Ammo Crafting Station? or am I missing something here (but I'm also not the brightest light bulb around). . .

 

 

I'm creating my own ammoCraftingStation not using a pre done one.

Link to comment
Share on other sites

Before opening a new thread i was wondering if you guys would know why my localization file is not working i have the following code

 

<effect_description level="1" desc_base="perkHomeTimeRank1Desc" long_desc_key="perkHomeTimeRank1LongDesc"/>

 

in my Progression.xml and have the following code in my Localization.txt file

 

perkHomeTimeRank1Desc,progression,Attribute,New,Walking Home,
perkHomeTimeRank1LongDesc,progression,Attribute,,,"I walk alone. Increase your walk speed by 50%.",

 

When i load the game it shows the long description but shows the name as perkHomeTimeRank1Desc

Link to comment
Share on other sites

9 hours ago, AaronG85 said:

Before opening a new thread i was wondering if you guys would know why my localization file is not working i have the following code

 

<effect_description level="1" desc_base="perkHomeTimeRank1Desc" long_desc_key="perkHomeTimeRank1LongDesc"/>

 

in my Progression.xml and have the following code in my Localization.txt file

 

perkHomeTimeRank1Desc,progression,Attribute,New,Walking Home,
perkHomeTimeRank1LongDesc,progression,Attribute,,,"I walk alone. Increase your walk speed by 50%.",

 

When i load the game it shows the long description but shows the name as perkHomeTimeRank1Desc

Make sure you use the same number of commas

 

Also, you need the word key in desc_base.  Key tells the game to look in the localization file.  Not having it will just use the words in-between the quotation marks

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...