• If you have a mod, tool or prefab, please use the Resources section. Click Mods at the top of the forums.

Modding scrap output

Zockaholic

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

 
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?

 
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 ?

 
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.

 
Last edited by a moderator:
<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:

Code:
<set xpath="/items/item[@name='schematicMaster']/property[@name='Material']/@value">Mbook</set>
<set xpath="/items/item[@name='schematicMaster']/property[@name='Weight']/@value">100</set>
 
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.

 
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.

 
Back
Top