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

Please help - item scrapping

chillfoy

New member
I am trying to assign a new scrap product (Indica Seeds) to a custom item (Indica Blunt). All goes well & the scrapping works with vanilla materials.xml for glass, until I change the forge_category to the desired new scrap product. The initial code is the following:

recipes.xml :

<configs>
<append xpath="/recipes">
<recipe name="Indica Blunt" count="1" craft_area="Weed Workstation" craft_time="0" tooltip="ttScrapMetalBrass" always_unlocked="true" tags="salvageScrap">
<wildcard_forge_category />
<ingredient name="Indica Bud" count="2"/>
<ingredient name="Blunt Wrap" count="1"/>
</recipe>
</append>
</configs>




items.xml:

<configs>
<append xpath="/items">

<item name="Indica Blunt">
<property name="CustomIcon" value="BlackForestBlunt"/>
<property name="Tags" value="drinks,foodSkill"/>
<property name="HoldType" value="3"/>
<property name="Meshfile" value="@:Other/Items/Misc/sackPrefab.prefab"/>
<property name="DropMeshfile" value="@:Other/Items/Misc/sack_droppedPrefab.prefab"/>
<property name="Material" value="Mindica"/>
<property name="Weight" value="10"/>
<property name="Stacknumber" value="10"/> <!-- STK resource -->
<property name="EconomicValue" value="500"/>
<property name="UnlockedBy" value="craftingFood"/><!-- perkMasterChef,drinkJarGrandpasMoonshineSchematic, -->
<property name="DisplayType" value="waterGrandpasMoonshine"/>
<property name="Group" value="Food/Cooking,CFDrink/Cooking"/>
</item>

<item name="Indica Seeds">
<property name="CustomIcon" value="BlackForestSeeds"/>
<property name="HoldType" value="45"/>
<property name="Tags" value="dukes"/>
<property name="Meshfile" value="@:Other/Items/Misc/sackPrefab.prefab"/>
<property name="DropMeshfile" value="@:Other/Items/Misc/sack_droppedPrefab.prefab"/>
<property name="Material" value="Mindica"/>
<property name="FuelValue" value="1"/>
<property name="Weight" value="1"/>
<property name="Stacknumber" value="100"/>
<property name="EconomicValue" value="100"/>
<property name="Group" value="Resources"/>
</item>

</append>
</configs>




(initial) materials.xml:

<configs>
<append xpath="/materials">


<material id="Mindica">
<property value="glass" name="damage_category"/>
<property value="glass" name="surface_category"/>
<property value="glass" name="forge_category"/>
<property value="1" name="Hardness" type="float"/>
<property value="1" name="lightopacity"/>
<property value="metal" name="stepsound"/>
<property value="20" name="stability_glue"/>
<property value="5" name="Mass" type="int"/>
<property value="true" name="StabilitySupport"/>
<property value="1" name="MaxDamage"/>
<property value="2" name="Experience"/>
</material>


</append>
</configs>




As I said, everything works well up to this point - the Indica Blunt is able to scrap into glass. The issue occurs when I try to change the forge_category so that the Indica Blunt instead scraps into Indica Seeds, like so:

(new & problematic) materials.xml :

<configs>
<append xpath="/materials">


<material id="Mindica">
<property value="glass" name="damage_category"/>
<property value="glass" name="surface_category"/>
<property value="Indica Seeds" name="forge_category"/>
<property value="1" name="Hardness" type="float"/>
<property value="1" name="lightopacity"/>
<property value="metal" name="stepsound"/>
<property value="20" name="stability_glue"/>
<property value="5" name="Mass" type="int"/>
<property value="true" name="StabilitySupport"/>
<property value="1" name="MaxDamage"/>
<property value="2" name="Experience"/>
</material>


</append>
</configs>



After I make the forge_category change to value="Indica Seeds" the option to scrap the Indica Blunt entirely disappears. 

What am I doing wrong?

 
As I said, everything works well up to this point - the Indica Blunt is able to scrap into glass. The issue occurs when I try to change the forge_category so that the Indica Blunt instead scraps into Indica Seeds, like so:

(new & problematic) materials.xml :
After I make the forge_category change to value="Indica Seeds" the option to scrap the Indica Blunt entirely disappears. 

What am I doing wrong?


For the new scrapping material, did you also add it to the recipes file?

Material types
    material="wood|metal|organic|bullet" 
    
    These *are* defined in materials.xml. If you need a new "scrapable" material it must be defined as such in materials.xml + recipes.xml.


Based on the code you posted, the material you setup as the scrapped material is Indica Blunt in the recipe file, not seeds.  So when you are scrapping the Blunt, it doesn't see seeds as the material to scrap down to.

Also you cannot scrap down into more than one material (based on the two ingredients I see in your code)

This is the proper way to setup a scrap recipe in the recipes file

<recipe name="resourceMilitaryFiber" count="1" tooltip="ttScrapMetalBrass" always_unlocked="true" tags="salvageScrap"> <wildcard_forge_category /> </recipe>




If you are wanting to get both a bud and a wrap, you need to make a crafting recipe to do that.  Then to go from bud, you can do scrapping or just use the vanilla seeds recipes as an example and set it up that way.

Code:
<recipe name="plantedPumpkin1" count="1" craft_time="1" tags="learnable">
    <ingredient name="foodCropPumpkin" count="5"/>
</recipe>
 
Ok so what you're saying is that the Indica Blunt will need 2 separate recipes? One recipe for crafting the item, and another to scrap the item?
So my recipes.xml should actually look like this?
 

<configs>
<append xpath="/recipes">
<recipe name="Indica Blunt" count="1" craft_area="Weed Workstation" craft_time="0">
<ingredient name="Indica Bud" count="2"/>
<ingredient name="Blunt Wrap" count="1"/>
</recipe>
<recipe name="Indica Blunt" count="1" tooltip="ttScrapMetalBrass" always_unlocked="true" tags="salvageScrap"> <wildcard_forge_category />
</recipe>
</append>
</configs>




If so, then what determines what the Indica Blunt will salvage into? Do I just add an ingredient to the 2nd "scrap" recipe in this new recipes.xml?

 

Based on the code you posted, the material you setup as the scrapped material is Indica Blunt in the recipe file, not seeds.  So when you are scrapping the Blunt, it doesn't see seeds as the material to scrap down to.


Perhaps I am misunderstanding how this is defined. 

I thought this part of the items.xml:

<item name="Indica Blunt">
     <property name="Material" value="Mindica"/>

defines its material as "Mindica"
and then this part of the materials.xml:

<material id="Mindica">

     <property value="Indica Seeds" name="forge_category"/>

defines that any Mindica material (the Indica blunt) will scrap down into the material's forge_category item (Indica seeds)

Is this a wrong understanding? If so, how do I define the Indica seeds as the scrapped material?

 

For the new scrapping material, did you also add it to the recipes file?


The Indica Seeds don't have a recipe in the recipes.xml since I didn't intend for these to be crafted
What would their entry in recipes.xml look like, as a scrapping material? 

 
Back
Top