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

How to control what things scrap into?

-Holo-

New member
As the title says, anyone have insight on how to control/change what a thing scraps into?

I have experimented a bit with the 44magnum gun and changed it's  material into a new material i added with a small modlet.

(truncated a bit, edits go in and showsup as intended in configsDump folder)
items.xml
<set xpath="/items/item[@name='gunHandgunT2Magnum44']/property[@name='Material']/@value">M44MagnumParts</set>

materials.xml
<append xpath="/materials">
<material id="M44MagnumParts">
<property name="damage_category" value="metal" />
<property name="surface_category" value="metal" />
<property name="forge_category" value="parts44Magnum"/>
<property name="Experience" value="6" />
</material>
</append>

items.xml
<append xpath="/items">
<item name="parts44Magnum">
<property name="Extends" value="gunMGT1AK47Parts"/>
<property name="CustomIcon" value="parts44Magnum"/>
</item>
</append>


All it does is remove the scrap option on the gun, but I can't figure out why

As far as I (think) figured out, the pistol item scraps into what the material it's using with the material tag, and the material inturn uses forge_category to determine what item it scraps into. (?)

Changing the magnum material to something else already in the game, it works fine, like motorparts och shotgunparts but not as soon as it supposed to use a custom material to scrap into.

Been butting my head against this for so long now i'm starting to think it's hardcoded in somehow -.-

 
Not something I'm super familiar with, but maybe take a look at the top of the recipes.xml. Might need to add one of the <wildcard_forge_category /> lines for your item.

 
Hi -Holo-

You are correct Bdubyah, you have to add a line something like this in recipes.xml, in the form of a modlet:

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

Regards

 
bdubyah said:
Not something I'm super familiar with, but maybe take a look at the top of the recipes.xml. Might need to add one of the <wildcard_forge_category /> lines for your item.


Gouki said:
Hi -Holo-

You are correct Bdubyah, you have to add a line something like this in recipes.xml, in the form of a modlet:

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

Regards
Darnit, cant seem to get it to work anyways :(

I did some renaming on somethings to make more sense in the files, now all looks like this

*In recipies.xml
<insertBefore xpath="/recipes/recipe[@name='resourceRockSmallBundle']" >
<recipe name="parts44Magnum_frame" count="1" tooltip="ttScrapMetalBrass" always_unlocked="true" tags="salvageScrap"> <wildcard_forge_category /> </recipe>
</insertBefore>

*In items.xml
<set xpath="/items/item[@name='gunHandgunT2Magnum44']/property[@name='Material']/@value">M44MagnumParts</set>

<item name="parts44Magnum_frame">
<property name="Extends" value="gunMGT1AK47Parts"/>
<property name="CustomIcon" value="parts44Magnum_frame"/>
</item>

*In materials.xml
<material id="M44MagnumParts">
<property name="damage_category" value="metal" />
<property name="surface_category" value="metal" />
<property name="forge_category" value="parts44Magnum_frame"/>
<property name="Experience" value="6" />
</material>


Everythings seems to be at the right place, looking at the files in ConfigDumps, but the whole scrap options is gone on the magnum with these changes -.-

 
<item name="parts44Magnum_frame">
<property name="Extends" value="gunMGT1AK47Parts"/>
<property name="CustomIcon" value="parts44Magnum_frame"/>
</item>



I think you need to add  <property name="Material" value="M44MagnumParts"/>  to this item.

 
Back
Top