Zockaholic Posted November 12, 2022 Share Posted November 12, 2022 Hello, I'm trying to change the output of normal scrapping (nothing relating to forges which I found here but that doesn't really help me a lot) but I'm getting more confused by the second. I want skillbooks to scrap into an item called "book" (don't worry about icons, ill fix that later) which are then supposed to be scrappable into paper. what my current code does, is letting me scrap any skillbook into a "book" item but those don't have any scrap option anymore. if I change the material of the book item to paper, than skillbooks aren't scrappable anymore, my books are scrappable into paper, but for some reason paper scraps into books. i need help. my brain hurts. my current files : recipes.xml : <configs> <append xpath="/recipes"> <recipe name="resourceBook" count="1" tooltip="ttScrapMetalBrass" always_unlocked="true" tags="salvageScrap"> <wildcard_forge_category /> </recipe> </append> </configs> items.xml: <configs> <append xpath="/items"> <item name="resourceBook"> <property name="CustomIcon" value="meleeWpnClubT1BaseballBat"/> <property name="HoldType" value="45"/> <property name="Meshfile" value="#Other/Items?Misc/sackPrefab.prefab"/> <property name="DropMeshfile" value="#Other/Items?Misc/sack_droppedPrefab.prefab"/> <property name="Material" value="Mbook"/> <property name="Stacknumber" value="10"/> <!-- STK resource --> <property name="FuelValue" value="50"/> <property name="Weight" value="50"/> <property name="EconomicValue" value="50"/> <property name="EconomicBundleSize" value="1"/> <property name="Group" value="Resources,Chemicals,CFChemicals"/> <property name="CraftingIngredientTime" value=".5"/> </item> </append> <setattribute xpath="/items/item[@name='schematicMaster']/property[@name='Material']" name="value">Mbook</setattribute> <setattribute xpath="/items/item[@name='schematicMaster']/property[@name='Weight']" name="value">100</setattribute> </configs> materials.xml: <configs> <append xpath="/materials"> <material id="Mbook"> <property name="damage_category" value="cloth"/> <property name="surface_category" value="cloth"/> <property name="forge_category" value="book"/> <property name="Hardness" type="float" value="1"/> <property name="stepsound" value="wood"/> <property name="stability_glue" value="20"/> <property name="Mass" type="int" value="1"/> <property name="MaxDamage" value="1"/> <property name="Experience" value="2"/> </material> </append> </configs> Link to comment Share on other sites More sharing options...
BFT2020 Posted November 12, 2022 Share Posted November 12, 2022 First, some advice on posting code. Use the </> button above on your code as it makes it easier to distinguish code from text. This is how I would do your post originally: recipes.xml : <configs> <append xpath="/recipes"> <recipe name="resourceBook" count="1" tooltip="ttScrapMetalBrass" always_unlocked="true" tags="salvageScrap"> <wildcard_forge_category /> </recipe> </append> </configs> items.xml: <configs> <append xpath="/items"> <item name="resourceBook"> <property name="CustomIcon" value="meleeWpnClubT1BaseballBat"/> <property name="HoldType" value="45"/> <property name="Meshfile" value="#Other/Items?Misc/sackPrefab.prefab"/> <property name="DropMeshfile" value="#Other/Items?Misc/sack_droppedPrefab.prefab"/> <property name="Material" value="Mbook"/> <property name="Stacknumber" value="10"/> <!-- STK resource --> <property name="FuelValue" value="50"/> <property name="Weight" value="50"/> <property name="EconomicValue" value="50"/> <property name="EconomicBundleSize" value="1"/> <property name="Group" value="Resources,Chemicals,CFChemicals"/> <property name="CraftingIngredientTime" value=".5"/> </item> </append> <setattribute xpath="/items/item[@name='schematicMaster']/property[@name='Material']" name="value">Mbook</setattribute> <setattribute xpath="/items/item[@name='schematicMaster']/property[@name='Weight']" name="value">100</setattribute> </configs> materials.xml: <configs> <append xpath="/materials"> <material id="Mbook"> <property name="damage_category" value="cloth"/> <property name="surface_category" value="cloth"/> <property name="forge_category" value="book"/> <property name="Hardness" type="float" value="1"/> <property name="stepsound" value="wood"/> <property name="stability_glue" value="20"/> <property name="Mass" type="int" value="1"/> <property name="MaxDamage" value="1"/> <property name="Experience" value="2"/> </material> </append> </configs> Need more information to try and help. When you state skill books, are you talking about a specific mod? Vanilla only has schematics and perk books which already scrap down to paper. Also, why are you looking for items to scrap down into a "book" form? Is there a use for the book? Link to comment Share on other sites More sharing options...
Zockaholic Posted November 12, 2022 Author Share Posted November 12, 2022 5 minutes ago, BFT2020 said: First, some advice on posting code. Use the </> button above on your code as it makes it easier to distinguish code from text. This is how I would do your post originally: recipes.xml : <configs> <append xpath="/recipes"> <recipe name="resourceBook" count="1" tooltip="ttScrapMetalBrass" always_unlocked="true" tags="salvageScrap"> <wildcard_forge_category /> </recipe> </append> </configs> items.xml: <configs> <append xpath="/items"> <item name="resourceBook"> <property name="CustomIcon" value="meleeWpnClubT1BaseballBat"/> <property name="HoldType" value="45"/> <property name="Meshfile" value="#Other/Items?Misc/sackPrefab.prefab"/> <property name="DropMeshfile" value="#Other/Items?Misc/sack_droppedPrefab.prefab"/> <property name="Material" value="Mbook"/> <property name="Stacknumber" value="10"/> <!-- STK resource --> <property name="FuelValue" value="50"/> <property name="Weight" value="50"/> <property name="EconomicValue" value="50"/> <property name="EconomicBundleSize" value="1"/> <property name="Group" value="Resources,Chemicals,CFChemicals"/> <property name="CraftingIngredientTime" value=".5"/> </item> </append> <setattribute xpath="/items/item[@name='schematicMaster']/property[@name='Material']" name="value">Mbook</setattribute> <setattribute xpath="/items/item[@name='schematicMaster']/property[@name='Weight']" name="value">100</setattribute> </configs> materials.xml: <configs> <append xpath="/materials"> <material id="Mbook"> <property name="damage_category" value="cloth"/> <property name="surface_category" value="cloth"/> <property name="forge_category" value="book"/> <property name="Hardness" type="float" value="1"/> <property name="stepsound" value="wood"/> <property name="stability_glue" value="20"/> <property name="Mass" type="int" value="1"/> <property name="MaxDamage" value="1"/> <property name="Experience" value="2"/> </material> </append> </configs> Need more information to try and help. When you state skill books, are you talking about a specific mod? Vanilla only has schematics and perk books which already scrap down to paper. Also, why are you looking for items to scrap down into a "book" form? Is there a use for the book? Hi there, thank you for the formatting tips, I'll use it next time. Im talking about the vanilla books that you can learn. Scrapping them down into books is just something to practice changing the scrap output on (maybe ill make recipes with a book a feather and paint to craft the specific schematics and perk books). I was trying to find out if it is even possible to make these scrap chanins. Maybe I understand something wrong. I'm under the impression that an item has a material and said material tells the game what the item scraps into, but im not even sure how the recipe of the basic resource plays into that. I just played around with it a bit more and I noticed that I might have to play around with the Weight / Mass aswell which makes it even more confusing. What would I have to do, to make any perkbook scrap into 1 book which scraps down into 50 paper ? Link to comment Share on other sites More sharing options...
BFT2020 Posted November 12, 2022 Share Posted November 12, 2022 (edited) I have an idea. Why not use (read) the perk book and then have it create the blank book. Then just set that up to scrap into paper. From one of the drinks in the items.xml file <property class="Action0"> <property name="Class" value="Eat"/> <property name="Delay" value="1.0"/> <property name="Use_time" value="..."/> <property name="Sound_start" value="player_drinking"/> <property name="Create_item" value="drinkJarEmpty"/> Just add the Create_item code to create a book when you use the perk book. I am not sure that the game will allow you to scrap down two levels, at least by making changes to the xml code. I could be wrong though, but I couldn't figure it out this morning. Edited November 12, 2022 by BFT2020 (see edit history) Link to comment Share on other sites More sharing options...
khzmusik Posted November 13, 2022 Share Posted November 13, 2022 12 hours ago, Zockaholic said: <setattribute xpath="/items/item[@name='schematicMaster']/property[@name='Material']" name="value">Mbook</setattribute> <setattribute xpath="/items/item[@name='schematicMaster']/property[@name='Weight']" name="value">100</setattribute> These XPath commands are probably not applying. The "setattribute" command is to add a new attribute to an XML tag, when that attribute isn't already there. The "value" attribute already exists on those property tags. You should be using the "set" command to change the value of the "value" attribute: <set xpath="/items/item[@name='schematicMaster']/property[@name='Material']/@value">Mbook</set> <set xpath="/items/item[@name='schematicMaster']/property[@name='Weight']/@value">100</set> Link to comment Share on other sites More sharing options...
Cranberry Monster Posted November 14, 2022 Share Posted November 14, 2022 On 11/12/2022 at 9:59 PM, Zockaholic said: I just played around with it a bit more and I noticed that I might have to play around with the Weight / Mass aswell which makes it even more confusing. What would I have to do, to make any perkbook scrap into 1 book which scraps down into 50 paper ? Material determines what something scraps to, and Weight is how many units of that material you get for each one scrapped. In your case, you'd need to define the perk book to be a Material such as Mbook that scraps in your new item "book", and the perk book needs to have a Weight of 1 so you only get 1 book when you scrap each perk book. Then, your "book" item should be set up as Mpaper for Material, with a Weight of 50, so you get 50 paper when you scrap one. At least, in my head that's how it should work. I'm at work at the moment, so can't test it for you. Link to comment Share on other sites More sharing options...
Zockaholic Posted November 15, 2022 Author Share Posted November 15, 2022 On 11/13/2022 at 1:34 AM, khzmusik said: These XPath commands are probably not applying. The "setattribute" command is to add a new attribute to an XML tag, when that attribute isn't already there. The "value" attribute already exists on those property tags. You should be using the "set" command to change the value of the "value" attribute: <set xpath="/items/item[@name='schematicMaster']/property[@name='Material']/@value">Mbook</set> <set xpath="/items/item[@name='schematicMaster']/property[@name='Weight']/@value">100</set> the xpaths do apply. I can exchange Mbook for Mpaper or any other material and it works. 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