Jump to content

Curious if there is a way to modify the forge...

Recommended Posts

I'm currently working on a balanced overhaul mod. I've been playing with my own personal mods for a while but just got into the realm of modding using the XML files (I was just stupidly editing the configs directly before). I want to make the game much more real by adding items and recipes WHICH I DO NOT NEED HELP WITH. What I'm wondering is if there is a way to add additional slots to the forge's 'tanks' for other items.


The specific idea that I have in mind is in regards to steel. Steel, very simply put, is just iron with a delicate balance of carbon imbued in it. As such, I'd like to incorporate my 'resourceCarbon' into the forge so that I could more accurately craft steel. I know I could make a custom recipe outside of the forge but it doesn't feel immersive enough to me. Likewise, I know I can make a custom recipe for the forge that includes my 'resourceCarbon' but without a 'tank' for the 'resourceCarbon' in the forge it's just another uncraftable entry on the crafting list.


I would even settle for a way to make a second forge, call it the foundry, and make it only take 'resourceCarbon' and 'scrapIron' to make ONLY steel.


If anyone has any ideas how to do this I would greatly appreciate the help and if I ever decide to publish I will credit you (not that it's a selling point at all).

Link to comment
Share on other sites

Thank you. I will review it when I get a chance.



Addendum: I've reviewed what you showed and that does fix the visual side of the problem but, unless I'm missing something, that code doesn't allow for new materials to be added to the "forgeable and tankable" list? Am I wrong?

Link to comment
Share on other sites

Okay, so here is what I'm running into:


I was having trouble using the <append xpath> code so I opted for doing the (I know more work) in the blocks.xml


<remove xpath="/blocks/block[@name='forge']"></remove>


Followed by


<append xpath="/blocks">

<block name="forge">
<property name="Class" value="Forge"/>
<property name="Material" value="Mstone_scrap"/>
<property name="MaxDamage" value="800"/>
<property name="StabilitySupport" value="true"/>
<property name="Shape" value="ModelEntity"/>
<property name="Path" value="solid"/>
<property name="Model" value="Entities/Crafting/forgePrefab"/>
<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="1.5"/>
<property name="HeatMapTime" value="1200"/>
<property name="HeatMapFrequency" value="25"/>
<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,[color="#FF0000"]carbon[/color]"/>
<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"/>
<drop event="Harvest" name="resourceRockSmall" count="30" tag="allHarvest"/>
<drop event="Harvest" name="terrStone" count="0" tool_category="Disassemble"/>
<drop event="Harvest" name="resourceRockSmall" count="20" tag="salvageHarvest"/>
<drop event="Harvest" name="resourceClayLump" count="20" tag="salvageHarvest"/>
<drop event="Harvest" name="resourceLeather" count="5" tag="salvageHarvest"/>
<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"/>
<property name="DescriptionKey" value="forgeDesc"/>
<property name="EconomicValue" value="214"/>
<property name="FilterTags" value="fdecor,fother,ffurniture"/>
<property name="SortOrder1" value="70i0"/>



And I also created, in the items.xml


<item name="unit_carbon">
<property name="Extends" value="unit_iron"/>
<property name="CustomIcon" value="resourceRockSmall"/>
<property name="Material" value="Mstone"/>
<property name="CreativeMode" value="None"/>


This is the first and only configuration of files that I was able to get a reaction out of. When I enable all these parts I get a weird error. Half of the forgeUI is gone when I access it and then my console fills with "IndexoutofRangeException:Arrayindex isoutofrange." I know I have to adjust the UI and I'm not going to tackle that until one of two things happens: 1.It is determined that the UI not being fixed is the cause of the problem Or 2. I get the programming done to make it work and all that is left is to make it look pretty.


Now I'm at the end of my know how and Google as well as this forum don't shed too much light on the situation (The only reference I've seen is to a problem with cobblestoneRamp back from alpha 12).


Any ideas would be appreciated.


Edit: I have an idea on what went wrong and I'll test it after I get the rest of my mod working as I'd like. Maybe a day or two out and I'll let you guys know how it goes.

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...