LastTugBoat243 Posted November 15, 2022 Share Posted November 15, 2022 (edited) I want to make a mod that adds a new recipe for an already existing item in the game. But I want to hide the current one first. How would I go about doing that? Edited November 15, 2022 by LastTugBoat243 didn't make sense before (see edit history) Link to comment Share on other sites More sharing options...
a_jp Posted November 15, 2022 Share Posted November 15, 2022 「recipes.xml」 but it seems to be a file related to recipes。 example:AOO \7 Days To Die\Mods\00-AOO_Core_Vehicles\Config\recipes.xml 1 Link to comment Share on other sites More sharing options...
doughphunghus Posted November 15, 2022 Share Posted November 15, 2022 (edited) Yeah, look at that file and find the recipes you don't want. Then on your mod, use XPATH to remove/delete that recipe (remove/delete the entire recipe). I believe you can delete recipes and not affect anything. Edited November 15, 2022 by doughphunghus (see edit history) 1 Link to comment Share on other sites More sharing options...
Gamida Posted November 15, 2022 Share Posted November 15, 2022 15 hours ago, LastTugBoat243 said: I want to make a mod that adds a new recipe for an already existing item in the game. But I want to hide the current one first. How would I go about doing that? If you are just changing the ingredients couldn't you just change the ones in the recipe. For example for shotgun shells... <recipe name="ammoShotgunShell" count="1" craft_area="workbench" tags="workbenchCrafting"> <ingredient name="resourceBuckshot" count="1"/> <ingredient name="resourceGunPowder" count="4"/> <ingredient name="resourcePaper" count="1"/> </recipe> <recipe name="ammoShotgunShell" count="1" craft_area="workbench" tags="workbenchCrafting"> <ingredient name="resourceAnimalFat" count="3"/> <ingredient name="resourceScrapPolymers" count="2"/> <ingredient name="resourceFeather" count="1"/> </recipe> I am not sure how to do the xpath thing to change it without actually changing in in the recipes.xml file but am sure someone could help you. 2 Link to comment Share on other sites More sharing options...
BFT2020 Posted November 15, 2022 Share Posted November 15, 2022 (edited) 1 hour ago, Gamida said: I am not sure how to do the xpath thing to change it without actually changing in in the recipes.xml file but am sure someone could help you. What I have done in the past (using your example of the shotgun shell): <append xpath="//recipe[@name='ammoShotgunShell']/ingredient[@name='resourcePaper']"> <ingredient name="resourceAnimalFat" count="3"/> <ingredient name="resourceScrapPolymers" count="2"/> <ingredient name="resourceFeather" count="1"/> </append> <remove xpath="//recipe[@name='ammoShotgunShell']/ingredient[@name='resourcePaper']"/> <remove xpath="//recipe[@name='ammoShotgunShell']/ingredient[@name='resourceBuckshot']"/> <remove xpath="//recipe[@name='ammoShotgunShell']/ingredient[@name='resourceGunPowder']"/> I would add the items to the existing recipe (adding after resourcePaper) and then remove the old items I want to remove. Edited November 15, 2022 by BFT2020 Removed added spacing in code (see edit history) 2 Link to comment Share on other sites More sharing options...
LastTugBoat243 Posted November 16, 2022 Author Share Posted November 16, 2022 Thanks for the help! I was able to get something working and I'm very happy.😊 2 Link to comment Share on other sites More sharing options...
paulj_3 Posted November 27, 2022 Share Posted November 27, 2022 (edited) Another way is to merely use "set" to change the values - as part of a Mod, and using only three lines in a recipes.xml: <set xpath="/recipes/recipe[@name='ammoShotgunShell']/ingredient[@name='resourceBuckshot']/@name">resourceScrapPolymers</set> <set xpath="/recipes/recipe[@name='ammoShotgunShell']/ingredient[@name='resourceGunPowder']/@name">resourceFeather</set> <set xpath="/recipes/recipe[@name='ammoShotgunShell']/ingredient[@name='resourcePaper']/@name">resourceAnimalFat</set> Looking at the the "Saves\(World)\ConfigsDump\recipes.xml" file - it will show the actual code as it has worked during the last load: <recipe name="ammoShotgunShell" count="1" craft_area="AmmoWeaponWorkBench" tags="workbenchCrafting"><!--Attribute "craft_area" replaced by: "Red22"--> <ingredient name="resourceScrapPolymers" count="1"><!--Attribute "name" replaced by: "Red22"--></ingredient> <ingredient name="resourceFeather" count="4"><!--Attribute "name" replaced by: "Red22"--></ingredient> <ingredient name="resourceAnimalFat" count="1"><!--Attribute "name" replaced by: "Red22"--></ingredient> </recipe> (Red22 is just the name of my own mod). I'm not sure quite what you mean, or are trying to achieve by "hiding" the (games?) original code, as any removing of the (modname)\Config\recipe.xml, from the game will simply cause the game to load its own default recipes.xml - which doesn't - or shouldn't - get modified by your mod. Edited November 27, 2022 by paulj_3 clarity. (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now