Results 1 to 13 of 13

Thread: need help with making a new forge

  1. #1
    Zombie Hunter
    Join Date
    Sep 2014
    Posts
    477
    Rep Power
    0

    need help with making a new forge

    hi guys im trying to make a new forge for gold and silver have the items and recipes I know I need too add them to the forge. is there anything else I need to do? thank you all for the help.

  2. #2
    Survivor
    Join Date
    Jan 2019
    Location
    Canadian Eh
    Posts
    98
    Rep Power
    1
    I will take a crack at helping

    if you are using the resourceSilverNugget in items.xml
    in materials.xml you need to add to the MresourceSilverNugget

    Code:
    <property name="forge_category" value="silver"/>
    And then you need to add a material id for the gold as the item resourceGoldNugget does not have a MresourceGoldNugget in materials.xml
    look at how the code for the silvernugget differs from the goldnugget.

    Then in items.xml you need to make the unit version of the silver and gold that is defined in the forge_category
    Code:
    <item name="unit_silver">
        <property name="Extends" value="unit_iron"/>
        <property name="CustomIcon" value="resourceSilverNugget"/>
        <property name="Material" value="MresourceSilverNugget "/>
        <property name="CreativeMode" value="None" />
    </item>
    
    <item name="unit_gold">
        <property name="Extends" value="unit_iron"/>
        <property name="CustomIcon" value="resourceGoldNugget"/>
        <property name="Material" value="MresourceGoldNugget"/>
        <property name="CreativeMode" value="None" />
    </item>
    then you need to make the forge itself be able to have those values added in the windows.xml
    Code:
     <window name="windowSForgeInput" width="228" height="204" panel="Right" controller="WorkstationMaterialInputWindow" materials_accepted="iron,brass,lead,clay,silver,gold" valid_materials_color="[green]" invalid_materials_color="[red]" cursor_area="true" >
    You will have to figure out if there needs to be a change to the height attribute in that line and possibly in the <rect name="content2" line, as I have not tested changing the forge values yet but have been wanting to. Let me know if this helps.

  3. #3
    Zombie Hunter
    Join Date
    Sep 2014
    Posts
    477
    Rep Power
    0
    Quote Originally Posted by Drconfused View Post
    I will take a crack at helping

    if you are using the resourceSilverNugget in items.xml
    in materials.xml you need to add to the MresourceSilverNugget

    Code:
    <property name="forge_category" value="silver"/>
    And then you need to add a material id for the gold as the item resourceGoldNugget does not have a MresourceGoldNugget in materials.xml
    look at how the code for the silvernugget differs from the goldnugget.

    Then in items.xml you need to make the unit version of the silver and gold that is defined in the forge_category
    Code:
    <item name="unit_silver">
        <property name="Extends" value="unit_iron"/>
        <property name="CustomIcon" value="resourceSilverNugget"/>
        <property name="Material" value="MresourceSilverNugget "/>
        <property name="CreativeMode" value="None" />
    </item>
    
    <item name="unit_gold">
        <property name="Extends" value="unit_iron"/>
        <property name="CustomIcon" value="resourceGoldNugget"/>
        <property name="Material" value="MresourceGoldNugget"/>
        <property name="CreativeMode" value="None" />
    </item>
    then you need to make the forge itself be able to have those values added in the windows.xml
    Code:
     <window name="windowSForgeInput" width="228" height="204" panel="Right" controller="WorkstationMaterialInputWindow" materials_accepted="iron,brass,lead,clay,silver,gold" valid_materials_color="[green]" invalid_materials_color="[red]" cursor_area="true" >
    You will have to figure out if there needs to be a change to the height attribute in that line and possibly in the <rect name="content2" line, as I have not tested changing the forge values yet but have been wanting to. Let me know if this helps.
    do I need to make a new workstation for the new forge so it can have its own recipes? thank you.

  4. #4
    Hunter
    Join Date
    Jul 2015
    Posts
    138
    Rep Power
    0
    You need this property added to your workstation in blocks


    Code:
        <property class="Workstation">
            <property name="CraftingAreaRecipes" value="YOURNEWFORGE"/>

    Then in recipes add as many recipes as you want, just make sure to add craft_area="YOURNEWFORGE" to each one. Replace YOURNEWFORGE with your forge name of course.

    Example
    Code:
    <recipe name="resourceClayLump" count="1" craft_area="YOURNEWFORGE" material_based="true" craft_time="1" craft_exp_gain="0" always_unlocked="true">
        <ingredient name="unit_clay" count="5"/>
    </recipe>

  5. #5
    Zombie Hunter
    Join Date
    Sep 2014
    Posts
    477
    Rep Power
    0
    ok thank you

  6. #6
    Zombie Hunter
    Join Date
    Sep 2014
    Posts
    477
    Rep Power
    0
    hay guys could someone help me with this xpath

    <append xpath="/materials/material[@id='MresourceSilverNugget']/property[@name='surface_category']">
    <property name="forge_category" value="Silver" />
    </append>
    im trying to add this to MresourceSilverNugget .
    thanks all

  7. #7
    Tracker Ragsy 2145's Avatar
    Join Date
    Dec 2018
    Location
    In your past mind
    Posts
    235
    Rep Power
    1
    If you are just adding a property for forge_category with the value Silver to MresourceSilverNugget then


    Code:
    <append xpath="/materials/material[@id='MresourceSilverNugget']">
    	<property name="forge_category" value="Silver" />
    	</append>
    Append is basically just adding the extra code line to that particular block of code.

    Assuming you know this but just incase you dont and for other folks .... to check your change has applied you can check by typing in exportcurrentconfigs into console and going to the save location shown in the dialogue




    For my example the path is
    C:\Users\Ragsy\AppData\Roaming\7DaysToDie\Saves\Se ciza County\Ragsy Modded Servers\Configs

    you should see this when you check the modified xml .

    Code:
    <material id="MresourceSilverNugget">
    	<property name="damage_category" value="metal" />
    	<property name="surface_category" value="metal" />
    	<property name="Experience" value="160" />
    
    	<property name="forge_category" value="Silver"><!--Element appended by: "Ragsy_Test_Silver"--></property>
    	</material>
    Last edited by Ragsy 2145; 4 Weeks Ago at 06:00 PM. Reason: Add info update pic

  8. #8
    Zombie Hunter
    Join Date
    Sep 2014
    Posts
    477
    Rep Power
    0
    Quote Originally Posted by Ragsy 2145 View Post
    If you are just adding a property for forge_category with the value Silver to MresourceSilverNugget then


    Code:
    <append xpath="/materials/material[@id='MresourceSilverNugget']">
    	<property name="forge_category" value="Silver" />
    	</append>
    Append is basically just adding the extra code line to that particular block of code.

    Assuming you know this but just incase you dont and for other folks .... to check your change has applied you can check by typing in exportcurrentconfigs into console and going to the save location shown in the dialogue




    For my example the path is
    C:\Users\Ragsy\AppData\Roaming\7DaysToDie\Saves\Se ciza County\Ragsy Modded Servers\Configs

    you should see this when you check the modified xml .

    Code:
    <material id="MresourceSilverNugget">
    	<property name="damage_category" value="metal" />
    	<property name="surface_category" value="metal" />
    	<property name="Experience" value="160" />
    
    	<property name="forge_category" value="Silver"><!--Element appended by: "Ragsy_Test_Silver"--></property>
    	</material>
    does it matter if the code is at the top or bottom? I had it at the top and it will not work.

  9. #9
    Hunter
    Join Date
    Jul 2015
    Posts
    138
    Rep Power
    0
    It should not matter where the append is, make sure this append is not already within another append.

    You might try this which is almost the same way that Ragsy posted above.

    Code:
    <insertAfter xpath="/materials/material[@id='MresourceSilverNugget']">
    	<property name="forge_category" value="Silver" />
    </insertAfter>

  10. #10
    Zombie Hunter
    Join Date
    Sep 2014
    Posts
    477
    Rep Power
    0
    Quote Originally Posted by DukeW74 View Post
    It should not matter where the append is, make sure this append is not already within another append.

    You might try this which is almost the same way that Ragsy posted above.

    Code:
    <insertAfter xpath="/materials/material[@id='MresourceSilverNugget']">
    	<property name="forge_category" value="Silver" />
    </insertAfter>
    I had tried that it was the first one I used. it wouldn't work either.
    ill keep looking thanks anyway.

  11. #11
    Zombie Hunter
    Join Date
    Sep 2014
    Posts
    477
    Rep Power
    0
    so this is what I get when I start the game

    ERR XML loader: Loading and parsing 'items.xml' failed
    2019-04-23T22:44:32 160.051 EXC Attribute 'material' 'MresourceSilverNugget ' refers to not existing material in item 'unit_silver'
    Exception: Attribute 'material' 'MresourceSilverNugget ' refers to not existing material in item 'unit_silver'
    at ItemClassesFromXml.parseItem (System.Xml.XmlElement _node) [0x00000] in <filename unknown>:0
    at ItemClassesFromXml.CreateItems (.XmlFile _xmlFile) [0x00000] in <filename unknown>:0
    at WorldStaticData.LoadItems (.XmlFile _xmlFile) [0x00000] in <filename unknown>:0
    at WorldStaticData+<loadSingleXml>c__Iterator1.MoveNe xt () [0x00000] in <filename unknown>:0

    I get it with insertAfter or append. not sure how to fix it. I've tried deferent stuff but to no avail .
    Last edited by dragonslayer770; 4 Weeks Ago at 03:00 AM.

  12. #12
    Zombie Hunter Khulkhuum's Avatar
    Join Date
    Feb 2017
    Location
    Poland
    Posts
    483
    Rep Power
    1
    I don't have a look into the files at the moment, but i think you need to define "unit_silver" as a material somewhere else apart form items.xml file. Perhaps it's in materials.xml or some place other, maybe recipes.xml. I will be able to check that in a few hours. I remember seeing various "units" defined apart from item.xml file when i was checking the files some time ago.

  13. #13
    Zombie Hunter Khulkhuum's Avatar
    Join Date
    Feb 2017
    Location
    Poland
    Posts
    483
    Rep Power
    1
    I will make a new reply for this to be shown.

    There are quite a few consideration and things to link together, i hope i will be able to get all of this clear on how to put it together. I will be referencing what other people have already posted with additional connections shown on what is needed.

    1. In items.xml we have a definition of a unit of measurement for the resource to add:
    Code:
    <item name="unit_silver">
    	<property name="Extends" value="unit_iron"/>
    	<property name="CustomIcon" value="resourceSilverNugget"/>
    	<property name="Material" value="MresourceSilverNugget "/>
    	<property name="CreativeMode" value="None"/>
    </item>
    2. Also in items.xml we have a definition of the resource itself, something we have in inventory i presume. No change here to what we currently have, unless you want to change the stack number or something:
    Code:
    <item name="resourceSilverNugget">
    	<property name="HoldType" value="45"/>
    	<property name="Meshfile" value="Items/Misc/sackPrefab"/>
    	<property name="DropMeshfile" value="Items/Misc/sack_droppedPrefab"/>
    	<property name="Material" value="MresourceSilverNugget"/>
    	<property name="Stacknumber" value="250"/> <!-- STK loot -->
    	<property name="EconomicValue" value="250"/>
    	<property name="CraftingIngredientTime" value="15"/>
    	<property name="Group" value="Resources"/>
    	<property name="DescriptionKey" value="rareOresGroupDesc"/>
    </item>
    3. In materials.xml we have the definition of the resource itself and we only add "forge_category" entry as seen below:
    Code:
    <material id="MresourceSilverNugget">
    	<property name="damage_category" value="metal"/>
    	<property name="surface_category" value="metal"/>
    	<property name="forge_category" value="silver"/>
    	<property name="Experience" value="2"/>
    </material>
    4. Additional forge code in blocks.xml, inherited from the original forge, with the important properties substituted:
    Code:
    <block name="NEWFORGE">
    	<property name="Extends" value="forge" param1="DescriptionKey,CraftSound,CraftCompleteSound"/>
    	<property class="Workstation">
    		<property name="CraftingAreaRecipes" value="YOURNEWFORGE"/>
    		<property name="Modules" value="tools,output,fuel,material_input"/>
    		<property name="InputMaterials" value="silver,gold"/>
    	</property>
    </block>
    You could first update the files manually and open the game to see if everything works. Afterwards make update scripts for xpath for your modlet. Surely you may be missing one update or something.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •