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

Adding new materials to forge.

Taien

Refugee
I'm trying to add a new material to the forge.  I've set up a new forge block that has the materials in its item list (see InputMaterials property):
 

<block name="masterForge">
<property name="Class" value="Forge"/>
<property name="UnlockedBy" value="masterForgeSchematic"/>
<property name="Material" value="Mstone_scrap"/>
<property name="MaxDamage" value="20000"/>
<property name="StabilitySupport" value="true"/>
<property name="Weight" value="0"/>
<property name="Shape" value="ModelEntity"/>
<property name="Path" value="solid"/>
<property name="Model" value="Entities/Crafting/forgePrefab"/>
<property name="CustomIcon" value="forge"/>
<property name="CustomIconTint" value="9E70BB"/>
<property name="CustomTint" value="9E70BB"/>
<property name="TintColor" value="158,112,187"/>
<property name="Place" value="TowardsPlacerInverted"/>
<property name="OnlySimpleRotations" value="true"/>
<property name="IsTerrainDecoration" value="true"/>
<property name="ParticleName" value="forge"/>
<property name="ParticleOffset" value="0.5,0,0.5"/>
<property name="ImposterDontBlock" value="true"/>
<property name="Stacknumber" value="1"/>
<property name="HeatMapStrength" value="6"/>
<property name="HeatMapTime" value="5000"/>
<property name="HeatMapFrequency" value="1000"/>
<property name="BuffsWhenWalkedOn" value="buffBurningEnvironment"/>
<property name="ActiveRadiusEffects" value="buffCampfireAOE(5)"/>
<property class="Workstation">
<property name="CraftingAreaRecipes" value="forge"/>
<property name="Modules" value="tools,output,fuel,material_input"/>
<property name="InputMaterials" value="iron,brass,lead,glass,stone,clay,mythril,adamantite"/>
</property>
<property name="WorkstationIcon" value="ui_game_symbol_forge"/>
<property name="OpenSound" value="forge_open"/>
<property name="CloseSound" value="forge_close"/>
<property name="CraftSound" value="forge_smelt_click"/>
<property name="CraftCompleteSound" value="forge_item_complete"/>
<property name="WorkstationJournalTip" value="forgeTip"/>
<property class="RepairItems">
<property name="resourceRockSmall" value="50"/>
<property name="resourceClayLump" value="60"/>
<property name="resourceLeather" value="20"/>
</property>
<drop event="Harvest" name="resourceRockSmall" count="40" tag="allHarvest"/>
<drop event="Harvest" name="resourceClayLump" count="20" tag="allHarvest"/>
<drop event="Harvest" name="resourceLeather" count="5" tag="allHarvest"/>
<drop event="Destroy" count="0"/>
<drop event="Fall" name="terrDestroyedStone" count="1" prob="0.75" stick_chance="1"/>
<property name="TakeDelay" value="15"/>
<property name="Group" value="Building,advBuilding"/>
<property name="DescriptionKey" value="forgeDesc"/>
<property name="EconomicValue" value="1000"/>
<property name="FilterTags" value="MC_playerBlocks,SC_decor"/>
<property name="SortOrder1" value="70i0"/>
</block>




This made the game crash whenever I looked at the forge until I used xpath to alter windows.xml to add two more rows to the grid in the content2 section of windowForgeInput (bringing the rows to 8).
 

<window name="windowForgeInput" width="228" height="204" panel="Right"
controller="WorkstationMaterialInputWindow" materials_accepted="iron,brass,lead,glass,stone,clay" valid_materials_color="[green]" invalid_materials_color="[red]" cursor_area="true" >
<panel style="header.panel">
<sprite style="header.icon" sprite="ui_game_symbol_forge"/>
<label style="header.name" text="INPUT" text_key="xuiSmelting" />
</panel>

<sprite depth="2" name="backgroundMain" sprite="menu_empty3px" pos="0,-46" height="228" color="[black]" type="sliced" fillcenter="false" on_press="true" />
<rect name="content" depth="1" pos="0,-46" height="228">

<grid depth="7" rows="3" cols="1" pos="3,-3" cell_width="75" cell_height="75" controller="WorkstationMaterialInputGrid" repeat_content="true">
<item_stack name="0"/>
</grid>

</rect>

<rect name="content2" depth="0" pos="78, -49" width="147" height="223">
<sprite depth="1" color="[mediumGrey]" type="sliced" on_press="true"/>
<grid rows="8" cols="1" pos="3,-3" cell_width="147" cell_height="24" repeat_content="true">
<forge_material name="0"/>
</grid>
</rect>
</window>




So now I can open the masterForge and it will show all the normal materials plus Mythril and Adamantite.  But when I try to melt items made of those materials and scrappable into those materials in the forge, they count down as usual but then nothing happens and the item remains.  Has anyone messed with adding items to forges before?  I know I have seen it done on other servers but I don't have access to their xml to see how they did it and learn from their alterations. :(

 
controller="WorkstationMaterialInputWindow" materials_accepted="iron,brass,lead,glass,stone,clay"




You forgot to add them there.

You also need them in materials and smelting recipes in recipes.xml.

 
controller="WorkstationMaterialInputWindow" materials_accepted="iron,brass,lead,glass,stone,clay"




You forgot to add them there.

You also need them in materials and smelting recipes in recipes.xml.


Awesome, this is almost certainly what I forgot, as I already had them in materials and recipes :)   Thanks Khaine, I will report my success when it is attained :)

 
Ok, so I added them to that section but it's still not processing them.  @KhaineGB would you be so kind as to look through the following and see if you can spot anything I've done wrong?  

Here's my append to materials (some of these properties are probably unnecessary...)

<material id="Mmythril">
<property name="damage_category" value="metal"/>
<property name="surface_category" value="metal"/>
<property name="forge_category" value="mythril"/>
<property name="Hardness" type="float" value="1"/>
<property name="stepsound" value="metal"/>
<property name="stability_glue" value="300"/>
<property name="Mass" type="int" value="1"/>
<property name="MaxDamage" value="300"/>
<property name="Experience" value="6"/>
</material>
<material id="Madamantite">
<property name="damage_category" value="metal"/>
<property name="surface_category" value="metal"/>
<property name="forge_category" value="adamantite"/>
<property name="Hardness" type="float" value="1"/>
<property name="stepsound" value="metal"/>
<property name="stability_glue" value="300"/>
<property name="Mass" type="int" value="1"/>
<property name="MaxDamage" value="300"/>
<property name="Experience" value="6"/>
</material>




And here's my recipes.xml for scrapping them (this IS what you meant, right?)

<append xpath="/recipes">
<!--Scrap recipes-->
<recipe name="resourceMythrilPowder" count="1" tooltip="ttScrapMetalBrass" always_unlocked="true" tags="salvageScrap"> <wildcard_forge_category /> </recipe>
<recipe name="resourceAdamantitePowder" count="1" tooltip="ttScrapMetalBrass" always_unlocked="true" tags="salvageScrap"> <wildcard_forge_category /> </recipe>
<!--Forge emptying recipes-->
<recipe name="resourceMythrilPowder" count="1" material_based="true" craft_area="forge" craft_time="1" craft_exp_gain="0" always_unlocked="true" use_ingredient_modifier="false">
<ingredient name="unit_mythril" count="1"/>
</recipe>
<recipe name="resourceAdamantitePowder" count="1" material_based="true" craft_area="forge" craft_time="1" craft_exp_gain="0" always_unlocked="true" use_ingredient_modifier="false">
<ingredient name="unit_adamantite" count="1"/>
</recipe>


Here's the items.xml for the units:
 

<item name="unit_mythril">
<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="CustomIcon" value="resourceCrushedSand"/>
<property name="CustomIconTint" value="64FDBA"/>
<property name="TintColor" value="100,253,186"/>
<property name="Material" value="Mmythril"/>
<property name="Stacknumber" value="30000"/>
<property name="Weight" value="1"/>
<property name="Group" value="Resources"/>
<property name="ResourceUnit" value="true"/>
<property name="MeltTimePerUnit" value=".25"/> <!-- forge smelting time -->
<property name="UserHidden" value="true"/>
<property name="CraftingIngredientTime" value=".5"/>
<property name="CreativeMode" value="None"/>
</item>
<item name="unit_adamantite">
<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="CustomIcon" value="resourceCrushedSand"/>
<property name="CustomIconTint" value="9E70BB"/>
<property name="TintColor" value="158,112,187"/>
<property name="Material" value="Madamantite"/>
<property name="Stacknumber" value="30000"/>
<property name="Weight" value="1"/>
<property name="Group" value="Resources"/>
<property name="ResourceUnit" value="true"/>
<property name="MeltTimePerUnit" value=".25"/> <!-- forge smelting time -->
<property name="UserHidden" value="true"/>
<property name="CraftingIngredientTime" value=".5"/>
<property name="CreativeMode" value="None"/>
</item>




I get the feeling I'm missing something in recipes.xml now.  You said I need some recipes for smelting in there but I am having trouble finding the same for the vanilla ores.  I appreciate any help you can provide. :)

 
Ok, so I added them to that section but it's still not processing them.  @KhaineGB would you be so kind as to look through the following and see if you can spot anything I've done wrong?  

Here's my append to materials (some of these properties are probably unnecessary...)

<material id="Mmythril">
<property name="damage_category" value="metal"/>
<property name="surface_category" value="metal"/>
<property name="forge_category" value="mythril"/>
<property name="Hardness" type="float" value="1"/>
<property name="stepsound" value="metal"/>
<property name="stability_glue" value="300"/>
<property name="Mass" type="int" value="1"/>
<property name="MaxDamage" value="300"/>
<property name="Experience" value="6"/>
</material>
<material id="Madamantite">
<property name="damage_category" value="metal"/>
<property name="surface_category" value="metal"/>
<property name="forge_category" value="adamantite"/>
<property name="Hardness" type="float" value="1"/>
<property name="stepsound" value="metal"/>
<property name="stability_glue" value="300"/>
<property name="Mass" type="int" value="1"/>
<property name="MaxDamage" value="300"/>
<property name="Experience" value="6"/>
</material>




And here's my recipes.xml for scrapping them (this IS what you meant, right?)

<append xpath="/recipes">
<!--Scrap recipes-->
<recipe name="resourceMythrilPowder" count="1" tooltip="ttScrapMetalBrass" always_unlocked="true" tags="salvageScrap"> <wildcard_forge_category /> </recipe>
<recipe name="resourceAdamantitePowder" count="1" tooltip="ttScrapMetalBrass" always_unlocked="true" tags="salvageScrap"> <wildcard_forge_category /> </recipe>
<!--Forge emptying recipes-->
<recipe name="resourceMythrilPowder" count="1" material_based="true" craft_area="forge" craft_time="1" craft_exp_gain="0" always_unlocked="true" use_ingredient_modifier="false">
<ingredient name="unit_mythril" count="1"/>
</recipe>
<recipe name="resourceAdamantitePowder" count="1" material_based="true" craft_area="forge" craft_time="1" craft_exp_gain="0" always_unlocked="true" use_ingredient_modifier="false">
<ingredient name="unit_adamantite" count="1"/>
</recipe>


Here's the items.xml for the units:
 

<item name="unit_mythril">
<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="CustomIcon" value="resourceCrushedSand"/>
<property name="CustomIconTint" value="64FDBA"/>
<property name="TintColor" value="100,253,186"/>
<property name="Material" value="Mmythril"/>
<property name="Stacknumber" value="30000"/>
<property name="Weight" value="1"/>
<property name="Group" value="Resources"/>
<property name="ResourceUnit" value="true"/>
<property name="MeltTimePerUnit" value=".25"/> <!-- forge smelting time -->
<property name="UserHidden" value="true"/>
<property name="CraftingIngredientTime" value=".5"/>
<property name="CreativeMode" value="None"/>
</item>
<item name="unit_adamantite">
<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="CustomIcon" value="resourceCrushedSand"/>
<property name="CustomIconTint" value="9E70BB"/>
<property name="TintColor" value="158,112,187"/>
<property name="Material" value="Madamantite"/>
<property name="Stacknumber" value="30000"/>
<property name="Weight" value="1"/>
<property name="Group" value="Resources"/>
<property name="ResourceUnit" value="true"/>
<property name="MeltTimePerUnit" value=".25"/> <!-- forge smelting time -->
<property name="UserHidden" value="true"/>
<property name="CraftingIngredientTime" value=".5"/>
<property name="CreativeMode" value="None"/>
</item>




I get the feeling I'm missing something in recipes.xml now.  You said I need some recipes for smelting in there but I am having trouble finding the same for the vanilla ores.  I appreciate any help you can provide. :)




Hi Taien

Checking your code, the units and the resource have the same type of material: Mmythril and Madamantite.
You could add a new material type for the resource, something like MresourceMythrilFragment and MresourceAdamantiteFragment, that should now fuse them.
Another thing that I notice is that the units must be different in characteristics from the resource, I will give you an example of my mod:

<item name="unit_graphene">
<property name="Extends" value="unit_iron"/>
<property name="CustomIcon" value="Graphene"/>
<property name="Material" value="Mgraphene"/>
<property name="CreativeMode" value="None"/>
<property name="DescriptionKey" value="resourceGrapheneFragmentDesc"/>
</item>

<item name="resourceGraphene"> <!-- scrap material -->
<property name="Tags" value="graphene"/>
<property name="HoldType" value="40"/>
<property name="CustomIcon" value="Graphene"/>
<property name="DescriptionKey" value="resourceGrapheneDesc"/>
<property name="Meshfile" value="#Other/Items?Crafting/rock_smallPrefab.prefab"/>
<property name="DropScale" value="6"/>
<property name="Material" value="MresourceGrapheneFragment"/>
<property name="Stacknumber" value="6000"/> <!-- STK resource -->
<property name="Weight" value="5"/>
<property name="EconomicValue" value="40"/>
<property name="SellableToTrader" value="true"/>
<property name="Group" value="Resources"/>
</item>

That should work, good luck.

Regards

 
A bunch of helpful stuff


Thank you so much for replying and I'm so sorry but I don't fully understand what you mean.  Do you mean the unit_mythril must have a different material than resourceMythrilPowder?  I think that's what you're saying.  Which item is supposed to have the material that points to the forge_material mythril?  Or should both have different materials that each have the forge_material mythril line? 

The intended outcome is this:
Mythril Powder (found in the world) is smelted in forge into unit_mythril.  And the "forge emptying recipe" for unit_mythril should output Mythril Powder.

I tried altering it based on what I thought you meant but I still can't get it working. :(

 
Last edited by a moderator:
Gouki, could you also post the materials for those items from your mod?  I don't understand how you have them set up differently than me. :)

 
Gouki, could you also post the materials for those items from your mod?  I don't understand how you have them set up differently than me. :)


Hi Taien

In materials.xml I have this:

        <material id="MresourceGrafenoFragment">
            <property name="damage_category" value="stone"/>
            <property name="surface_category" value="stone"/>
            <property name="forge_category" value="grafeno"/>
            <property name="Experience" value="4"/>
        </material>

        <material id="Mgrafeno">
            <property name="damage_category" value="stone"/>
            <property name="surface_category" value="stone"/>
            <property name="forge_category" value="grafeno"/>
            <property name="Hardness" type="float" value="1"/>
            <property name="stepsound" value="stone"/>
            <property name="stability_glue" value="120"/>
            <property name="Mass" type="int" value="10"/>
            <property name="MaxDamage" value="500"/>
            <property name="Experience" value="2"/>
        </material>

If you look closely, unit_graphene has Mgraphene as material and resourceGraphene has MresourceGrapheneFragment as material, that's what I meant, adding a material for each item, with that it should work.
Regards

 
I still cannot get items to melt in the forge.  Worse yet is that when I upload this mod to my server, the adamantite forge seems to nuke any item placed inside it, instantly deleting the item. I'm testing with the resourceMythrilPowder item. This is the current state of my alterations. I'm sorry...I don't know what I'm missing...

Items.xml:
 

<item name="resourceMythrilPowder">
<property name="HoldType" value="40"/>
<property name="Meshfile" value="#Other/Items?Misc/sackPrefab.prefab"/>
<property name="DropMeshfile" value="#Other/Items?Misc/sack_droppedPrefab.prefab"/>
<property name="CustomIcon" value="resourceCrushedSand"/>
<property name="CustomIconTint" value="64FDBA"/>
<property name="TintColor" value="100,253,186"/>
<property name="Material" value="MmythrilPowder"/> <property name="Weight" value="1"/>
<property name="Stacknumber" value="10000"/>
<property name="EconomicValue" value="200"/>
<property name="EconomicBundleSize" value="1"/>
<property name="Group" value="Resources"/>
<property name="UnlockedBy" value="resourceMythrilSchematic"/>
</item>
<item name="resourceAdamantitePowder">
<property name="HoldType" value="40"/>
<property name="Meshfile" value="#Other/Items?Misc/sackPrefab.prefab"/>
<property name="DropMeshfile" value="#Other/Items?Misc/sack_droppedPrefab.prefab"/>
<property name="CustomIcon" value="resourceCrushedSand"/>
<property name="CustomIconTint" value="9E70BB"/>
<property name="TintColor" value="158,112,187"/>
<property name="Material" value="MadamantitePowder"/> <property name="Weight" value="1"/>
<property name="Stacknumber" value="10000"/>
<property name="EconomicValue" value="300"/>
<property name="EconomicBundleSize" value="1"/>
<property name="Group" value="Resources"/>
<property name="UnlockedBy" value="resourceAdamantiteSchematic"/>
</item>
<item name="unit_mythril">
<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="CustomIcon" value="resourceCrushedSand"/>
<property name="CustomIconTint" value="64FDBA"/>
<property name="TintColor" value="100,253,186"/>
<property name="Material" value="Mmythril"/>
<property name="Stacknumber" value="30000"/>
<property name="Weight" value="1"/>
<property name="Group" value="Resources"/>
<property name="ResourceUnit" value="true"/>
<property name="MeltTimePerUnit" value=".25"/> <!-- forge smelting time -->
<property name="UserHidden" value="true"/>
<property name="CraftingIngredientTime" value=".5"/>
<property name="CreativeMode" value="None"/>
</item>
<item name="unit_adamantite">
<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="CustomIcon" value="resourceCrushedSand"/>
<property name="CustomIconTint" value="9E70BB"/>
<property name="TintColor" value="158,112,187"/>
<property name="Material" value="Madamantite"/>
<property name="Stacknumber" value="30000"/>
<property name="Weight" value="1"/>
<property name="Group" value="Resources"/>
<property name="ResourceUnit" value="true"/>
<property name="MeltTimePerUnit" value=".25"/> <!-- forge smelting time -->
<property name="UserHidden" value="true"/>
<property name="CraftingIngredientTime" value=".5"/>
<property name="CreativeMode" value="None"/>
</item>




materials.xml:
 

<material id="Mmythril">
<property name="damage_category" value="metal"/>
<property name="surface_category" value="metal"/>
<property name="forge_category" value="mythril"/>
<property name="Hardness" type="float" value="1"/>
<property name="stepsound" value="metal"/>
<property name="stability_glue" value="300"/>
<property name="Mass" type="int" value="1"/>
<property name="MaxDamage" value="300"/>
<property name="Experience" value="6"/>
</material>
<material id="MmythrilPowder">
<property name="damage_category" value="metal"/>
<property name="surface_category" value="metal"/>
<property name="forge_category" value="mythril"/>
<property name="Experience" value="6"/>
</material>
<material id="Madamantite">
<property name="damage_category" value="metal"/>
<property name="surface_category" value="metal"/>
<property name="forge_category" value="adamantite"/>
<property name="Hardness" type="float" value="1"/>
<property name="stepsound" value="metal"/>
<property name="stability_glue" value="300"/>
<property name="Mass" type="int" value="1"/>
<property name="MaxDamage" value="300"/>
<property name="Experience" value="6"/>
</material>
<material id="MadamantitePowder">
<property name="damage_category" value="metal"/>
<property name="surface_category" value="metal"/>
<property name="forge_category" value="adamantite"/>
<property name="Experience" value="6"/>
</material>




recipes.xml:

<!--Scrap recipes-->
<recipe name="resourceMythrilPowder" count="1" tooltip="ttScrapMetalBrass" always_unlocked="true" tags="salvageScrap"> <wildcard_forge_category /> </recipe>
<recipe name="resourceAdamantitePowder" count="1" tooltip="ttScrapMetalBrass" always_unlocked="true" tags="salvageScrap"> <wildcard_forge_category /> </recipe>
<!--Forge emptying recipes-->
<recipe name="resourceMythrilPowder" count="1" material_based="true" craft_area="forge" craft_time="1" craft_exp_gain="0" always_unlocked="true" use_ingredient_modifier="false">
<ingredient name="unit_mythril" count="1"/>
</recipe>
<recipe name="resourceAdamantitePowder" count="1" material_based="true" craft_area="forge" craft_time="1" craft_exp_gain="0" always_unlocked="true" use_ingredient_modifier="false">
<ingredient name="unit_adamantite" count="1"/>
</recipe>




blocks.xml:

<block name="masterForge">
<property name="Class" value="Forge"/>
<property name="UnlockedBy" value="masterForgeSchematic"/>
<property name="Material" value="Mstone_scrap"/>
<property name="MaxDamage" value="20000"/>
<property name="StabilitySupport" value="true"/>
<property name="Weight" value="0"/>
<property name="Shape" value="ModelEntity"/>
<property name="Path" value="solid"/>
<property name="Model" value="Entities/Crafting/forgePrefab"/>
<property name="CustomIcon" value="forge"/>
<property name="CustomIconTint" value="9E70BB"/>
<property name="CustomTint" value="9E70BB"/>
<property name="TintColor" value="158,112,187"/>
<property name="Place" value="TowardsPlacerInverted"/>
<property name="OnlySimpleRotations" value="true"/>
<property name="IsTerrainDecoration" value="true"/>
<property name="ParticleName" value="forge"/>
<property name="ParticleOffset" value="0.5,0,0.5"/>
<property name="ImposterDontBlock" value="true"/>
<property name="Stacknumber" value="1"/>
<property name="HeatMapStrength" value="6"/>
<property name="HeatMapTime" value="5000"/>
<property name="HeatMapFrequency" value="1000"/>
<property name="BuffsWhenWalkedOn" value="buffBurningEnvironment"/>
<property name="ActiveRadiusEffects" value="buffCampfireAOE(5)"/>
<property class="Workstation">
<property name="CraftingAreaRecipes" value="forge"/>
<property name="Modules" value="tools,output,fuel,material_input"/>
<property name="InputMaterials" value="iron,brass,lead,glass,stone,clay,mythril,adamantite"/>
</property>
<property name="WorkstationIcon" value="ui_game_symbol_forge"/>
<property name="OpenSound" value="forge_open"/>
<property name="CloseSound" value="forge_close"/>
<property name="CraftSound" value="forge_smelt_click"/>
<property name="CraftCompleteSound" value="forge_item_complete"/>
<property name="WorkstationJournalTip" value="forgeTip"/>
<property class="RepairItems">
<property name="resourceRockSmall" value="50"/>
<property name="resourceClayLump" value="60"/>
<property name="resourceLeather" value="20"/>
</property>
<drop event="Harvest" name="resourceRockSmall" count="40" tag="allHarvest"/>
<drop event="Harvest" name="resourceClayLump" count="20" tag="allHarvest"/>
<drop event="Harvest" name="resourceLeather" count="5" tag="allHarvest"/>
<drop event="Destroy" count="0"/>
<drop event="Fall" name="terrDestroyedStone" count="1" prob="0.75" stick_chance="1"/>
<property name="TakeDelay" value="15"/>
<property name="Group" value="Building,advBuilding"/>
<property name="DescriptionKey" value="forgeDesc"/>
<property name="EconomicValue" value="1000"/>
<property name="FilterTags" value="MC_playerBlocks,SC_decor"/>
<property name="SortOrder1" value="70i0"/>
</block>




windows.xml:
 

Code:
        <window name="windowMasterForgeInput" width="228" height="204" panel="Right"
            controller="WorkstationMaterialInputWindow" materials_accepted="iron,brass,lead,glass,stone,clay,mythril,adamantite" valid_materials_color="[green]" invalid_materials_color="[red]" cursor_area="true" >
            <panel style="header.panel">
                <sprite style="header.icon" sprite="ui_game_symbol_forge"/>
                <label style="header.name" text="INPUT" text_key="xuiSmelting" />
            </panel>

            <sprite depth="2" name="backgroundMain" sprite="menu_empty3px" pos="0,-46" height="228" color="[black]" type="sliced" fillcenter="false" on_press="true" />
            <rect name="content" depth="1" pos="0,-46" height="228">

                <grid depth="7" rows="3" cols="1" pos="3,-3" cell_width="75" cell_height="75" controller="WorkstationMaterialInputGrid" repeat_content="true">
                    <item_stack name="0"/>
                </grid>

            </rect>

            <rect name="content2" depth="0" pos="78, -49" width="147" height="223">
                <sprite depth="1" color="[mediumGrey]" type="sliced" on_press="true"/>
                <grid rows="8" cols="1" pos="3,-3" cell_width="147" cell_height="24"  repeat_content="true">
                    <forge_material name="0"/>
                </grid>
            </rect>
        </window>
 
I still cannot get items to melt in the forge.  Worse yet is that when I upload this mod to my server, the adamantite forge seems to nuke any item placed inside it, instantly deleting the item. I'm testing with the resourceMythrilPowder item. This is the current state of my alterations. I'm sorry...I don't know what I'm missing...

Items.xml:
 

<item name="resourceMythrilPowder">
<property name="HoldType" value="40"/>
<property name="Meshfile" value="#Other/Items?Misc/sackPrefab.prefab"/>
<property name="DropMeshfile" value="#Other/Items?Misc/sack_droppedPrefab.prefab"/>
<property name="CustomIcon" value="resourceCrushedSand"/>
<property name="CustomIconTint" value="64FDBA"/>
<property name="TintColor" value="100,253,186"/>
<property name="Material" value="MmythrilPowder"/> <property name="Weight" value="1"/>
<property name="Stacknumber" value="10000"/>
<property name="EconomicValue" value="200"/>
<property name="EconomicBundleSize" value="1"/>
<property name="Group" value="Resources"/>
<property name="UnlockedBy" value="resourceMythrilSchematic"/>
</item>
<item name="resourceAdamantitePowder">
<property name="HoldType" value="40"/>
<property name="Meshfile" value="#Other/Items?Misc/sackPrefab.prefab"/>
<property name="DropMeshfile" value="#Other/Items?Misc/sack_droppedPrefab.prefab"/>
<property name="CustomIcon" value="resourceCrushedSand"/>
<property name="CustomIconTint" value="9E70BB"/>
<property name="TintColor" value="158,112,187"/>
<property name="Material" value="MadamantitePowder"/> <property name="Weight" value="1"/>
<property name="Stacknumber" value="10000"/>
<property name="EconomicValue" value="300"/>
<property name="EconomicBundleSize" value="1"/>
<property name="Group" value="Resources"/>
<property name="UnlockedBy" value="resourceAdamantiteSchematic"/>
</item>
<item name="unit_mythril">
<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="CustomIcon" value="resourceCrushedSand"/>
<property name="CustomIconTint" value="64FDBA"/>
<property name="TintColor" value="100,253,186"/>
<property name="Material" value="Mmythril"/>
<property name="Stacknumber" value="30000"/>
<property name="Weight" value="1"/>
<property name="Group" value="Resources"/>
<property name="ResourceUnit" value="true"/>
<property name="MeltTimePerUnit" value=".25"/> <!-- forge smelting time -->
<property name="UserHidden" value="true"/>
<property name="CraftingIngredientTime" value=".5"/>
<property name="CreativeMode" value="None"/>
</item>
<item name="unit_adamantite">
<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="CustomIcon" value="resourceCrushedSand"/>
<property name="CustomIconTint" value="9E70BB"/>
<property name="TintColor" value="158,112,187"/>
<property name="Material" value="Madamantite"/>
<property name="Stacknumber" value="30000"/>
<property name="Weight" value="1"/>
<property name="Group" value="Resources"/>
<property name="ResourceUnit" value="true"/>
<property name="MeltTimePerUnit" value=".25"/> <!-- forge smelting time -->
<property name="UserHidden" value="true"/>
<property name="CraftingIngredientTime" value=".5"/>
<property name="CreativeMode" value="None"/>
</item>




materials.xml:
 

<material id="Mmythril">
<property name="damage_category" value="metal"/>
<property name="surface_category" value="metal"/>
<property name="forge_category" value="mythril"/>
<property name="Hardness" type="float" value="1"/>
<property name="stepsound" value="metal"/>
<property name="stability_glue" value="300"/>
<property name="Mass" type="int" value="1"/>
<property name="MaxDamage" value="300"/>
<property name="Experience" value="6"/>
</material>
<material id="MmythrilPowder">
<property name="damage_category" value="metal"/>
<property name="surface_category" value="metal"/>
<property name="forge_category" value="mythril"/>
<property name="Experience" value="6"/>
</material>
<material id="Madamantite">
<property name="damage_category" value="metal"/>
<property name="surface_category" value="metal"/>
<property name="forge_category" value="adamantite"/>
<property name="Hardness" type="float" value="1"/>
<property name="stepsound" value="metal"/>
<property name="stability_glue" value="300"/>
<property name="Mass" type="int" value="1"/>
<property name="MaxDamage" value="300"/>
<property name="Experience" value="6"/>
</material>
<material id="MadamantitePowder">
<property name="damage_category" value="metal"/>
<property name="surface_category" value="metal"/>
<property name="forge_category" value="adamantite"/>
<property name="Experience" value="6"/>
</material>




recipes.xml:

<!--Scrap recipes-->
<recipe name="resourceMythrilPowder" count="1" tooltip="ttScrapMetalBrass" always_unlocked="true" tags="salvageScrap"> <wildcard_forge_category /> </recipe>
<recipe name="resourceAdamantitePowder" count="1" tooltip="ttScrapMetalBrass" always_unlocked="true" tags="salvageScrap"> <wildcard_forge_category /> </recipe>
<!--Forge emptying recipes-->
<recipe name="resourceMythrilPowder" count="1" material_based="true" craft_area="forge" craft_time="1" craft_exp_gain="0" always_unlocked="true" use_ingredient_modifier="false">
<ingredient name="unit_mythril" count="1"/>
</recipe>
<recipe name="resourceAdamantitePowder" count="1" material_based="true" craft_area="forge" craft_time="1" craft_exp_gain="0" always_unlocked="true" use_ingredient_modifier="false">
<ingredient name="unit_adamantite" count="1"/>
</recipe>




blocks.xml:

<block name="masterForge">
<property name="Class" value="Forge"/>
<property name="UnlockedBy" value="masterForgeSchematic"/>
<property name="Material" value="Mstone_scrap"/>
<property name="MaxDamage" value="20000"/>
<property name="StabilitySupport" value="true"/>
<property name="Weight" value="0"/>
<property name="Shape" value="ModelEntity"/>
<property name="Path" value="solid"/>
<property name="Model" value="Entities/Crafting/forgePrefab"/>
<property name="CustomIcon" value="forge"/>
<property name="CustomIconTint" value="9E70BB"/>
<property name="CustomTint" value="9E70BB"/>
<property name="TintColor" value="158,112,187"/>
<property name="Place" value="TowardsPlacerInverted"/>
<property name="OnlySimpleRotations" value="true"/>
<property name="IsTerrainDecoration" value="true"/>
<property name="ParticleName" value="forge"/>
<property name="ParticleOffset" value="0.5,0,0.5"/>
<property name="ImposterDontBlock" value="true"/>
<property name="Stacknumber" value="1"/>
<property name="HeatMapStrength" value="6"/>
<property name="HeatMapTime" value="5000"/>
<property name="HeatMapFrequency" value="1000"/>
<property name="BuffsWhenWalkedOn" value="buffBurningEnvironment"/>
<property name="ActiveRadiusEffects" value="buffCampfireAOE(5)"/>
<property class="Workstation">
<property name="CraftingAreaRecipes" value="forge"/>
<property name="Modules" value="tools,output,fuel,material_input"/>
<property name="InputMaterials" value="iron,brass,lead,glass,stone,clay,mythril,adamantite"/>
</property>
<property name="WorkstationIcon" value="ui_game_symbol_forge"/>
<property name="OpenSound" value="forge_open"/>
<property name="CloseSound" value="forge_close"/>
<property name="CraftSound" value="forge_smelt_click"/>
<property name="CraftCompleteSound" value="forge_item_complete"/>
<property name="WorkstationJournalTip" value="forgeTip"/>
<property class="RepairItems">
<property name="resourceRockSmall" value="50"/>
<property name="resourceClayLump" value="60"/>
<property name="resourceLeather" value="20"/>
</property>
<drop event="Harvest" name="resourceRockSmall" count="40" tag="allHarvest"/>
<drop event="Harvest" name="resourceClayLump" count="20" tag="allHarvest"/>
<drop event="Harvest" name="resourceLeather" count="5" tag="allHarvest"/>
<drop event="Destroy" count="0"/>
<drop event="Fall" name="terrDestroyedStone" count="1" prob="0.75" stick_chance="1"/>
<property name="TakeDelay" value="15"/>
<property name="Group" value="Building,advBuilding"/>
<property name="DescriptionKey" value="forgeDesc"/>
<property name="EconomicValue" value="1000"/>
<property name="FilterTags" value="MC_playerBlocks,SC_decor"/>
<property name="SortOrder1" value="70i0"/>
</block>




windows.xml:
 

<window name="windowMasterForgeInput" width="228" height="204" panel="Right"
controller="WorkstationMaterialInputWindow" materials_accepted="iron,brass,lead,glass,stone,clay,mythril,adamantite" valid_materials_color="[green]" invalid_materials_color="[red]" cursor_area="true" >
<panel style="header.panel">
<sprite style="header.icon" sprite="ui_game_symbol_forge"/>
<label style="header.name" text="INPUT" text_key="xuiSmelting" />
</panel>

<sprite depth="2" name="backgroundMain" sprite="menu_empty3px" pos="0,-46" height="228" color="[black]" type="sliced" fillcenter="false" on_press="true" />
<rect name="content" depth="1" pos="0,-46" height="228">

<grid depth="7" rows="3" cols="1" pos="3,-3" cell_width="75" cell_height="75" controller="WorkstationMaterialInputGrid" repeat_content="true">
<item_stack name="0"/>
</grid>

</rect>

<rect name="content2" depth="0" pos="78, -49" width="147" height="223">
<sprite depth="1" color="[mediumGrey]" type="sliced" on_press="true"/>
<grid rows="8" cols="1" pos="3,-3" cell_width="147" cell_height="24" repeat_content="true">
<forge_material name="0"/>
</grid>
</rect>
</window>



Hi Taien

The error I see is in unit_mythril and unit_adamantite.
If you look at the example of my mod, the code is different, that's why the forge doesn't melt the material.
Regards

 
Hi Taien

The error I see is in unit_mythril and unit_adamantite.
If you look at the example of my mod, the code is different, that's why the forge doesn't melt the material.
Regards


Hey thanks for replying again. :)  So the reason mine is different for the units is instead of extending unit_iron (like you did) I just copied unit_iron's properties.  Are you saying I MUST extend unit_iron for it to work?  I will try that. :)

 
Hey thanks for replying again. :)  So the reason mine is different for the units is instead of extending unit_iron (like you did) I just copied unit_iron's properties.  Are you saying I MUST extend unit_iron for it to work?  I will try that. :)


That's right, you can try it and it has to work.

 
That's right, you can try it and it has to work.


Well...it didn't work...:'(  I am so frustrated at this point.

Mythril ? Wow. Is it somehow related to Thor or something ? 

@KhaineGB @SnowBee Are the experts in this. They might help you.
Honestly, I don't know.  It's been a staple metal in practically every game I've played since Final Fantasy 1, so I figured I'd use it. :p   But the true mythology of mythril isn't in my knowledge base.  It's in Lord of the Rings, too.

 
Here's my units now....still no work. :(

 

<item name="unit_mythril">
<property name="Extends" value="unit_iron"/>
<property name="CustomIcon" value="resourceCrushedSand"/>
<property name="CustomIconTint" value="64FDBA"/>
<property name="Material" value="Mmythril"/>
<property name="CreativeMode" value="None"/>
</item>
<item name="unit_adamantite">
<property name="Extends" value="unit_iron"/>
<property name="CustomIcon" value="resourceCrushedSand"/>
<property name="CustomIconTint" value="9E70BB"/>
<property name="Material" value="Madamantite"/>
<property name="CreativeMode" value="None"/>
</item>


Tried taking the custom tint out as well and it still didn't work.  Not that that should matter.  Ugh

 
Here's my units now....still no work. :(

 

<item name="unit_mythril">
<property name="Extends" value="unit_iron"/>
<property name="CustomIcon" value="resourceCrushedSand"/>
<property name="CustomIconTint" value="64FDBA"/>
<property name="Material" value="Mmythril"/>
<property name="CreativeMode" value="None"/>
</item>
<item name="unit_adamantite">
<property name="Extends" value="unit_iron"/>
<property name="CustomIcon" value="resourceCrushedSand"/>
<property name="CustomIconTint" value="9E70BB"/>
<property name="Material" value="Madamantite"/>
<property name="CreativeMode" value="None"/>
</item>


Tried taking the custom tint out as well and it still didn't work.  Not that that should matter.  Ugh


Hi Taien

Did you also add a new xui.xml?
Because in the windows.xml code that you posted the input is called "windowMasterForgeInput" and if you expect it to work with the normal forge input "windowForgeInput" won't work.
You need to change it to the new name you put.
Here is an example of the xui.xml that I have for my forge.

<append xpath="/xui/ruleset">
    
        <window_group name="workstation_Forge Clone" controller="XUiC_WorkstationWindowGroup" open_backpack_on_open="true" close_compass_on_open="true">
            <window name="windowCraftingList"/>
            <window name="craftingInfoPanel"/>
            <window name="windowCraftingQueue"/>
            <window name="windowToolsForge Clone"/>
            <window name="windowForge CloneInput" />
            <window name="windowOutputForge Clone" />
            <window name="windowNonPagingHeader"/>            
        </window_group>
        
    </append>

Regards

 
Yep I definitely updated the XUI as well, I wanted to make sure the problem wasn't that I was using the same window for both forges.  Thanks for checking though :)

 
Oh my god, I think I figured it out.  I think I had it right the WHOLE TIME, and that I just needed to pick up and place back down the masterForge because it had been placed before I added the other materials and thus didn't have whatever initialization happens on placement that creates the pools for mythril and adamantite.  This at least solved the problem in my single-player world.  Going to test it on the server now.

 
Yup, that was the problem.  I had the xml correct the whole time.  I just needed to pick up and place down the forge again.  EPIC SIGH OF EQUAL PARTS CONTENTMENT AND FRUSTRATION :)

 
Back
Top