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

Custom forge, and workstation

VENOM2019

Refugee
Hello everyone!

I have an important question for you guys, which is: How is it possible to make a block act like a forge or a campfire, or a workbench, because I made a furnace and I made a gui for it, it works until then press E on it,because I press E and nothing pop up as an inventory or other gui thing, that have to appear. Please help me with that, because I want to make a big modlet (new guns,ammos,and blocks) and if I'll be ready with that, I will publish that for you. the only thing thats gonna be the worst in my mod, that I can't animate.

Please help make this furnace.

 
I can't tell you anything...but...maybe....show your custom code from the block.xml, xui.xml....

(unfortunately if this "modlet" code - i pass, do not understand anything about it, but maybe others will help you... but, you start by at least showing the code... ;) )

 
Last edited by a moderator:
blocks.xml's code:

<configs>

<append xpath="/blocks">

<block name="WoodBurningFurnace">

<property name="Class" value="Campfire" />

<property class="Workstation"/>

<property name="Material" value="MstoneNoGlue" />

<property name="Shape" value="ModelEntity" />

<property name="Model" value="#@modfolder:Resources/Testfurnace.unity3d?Testfurnace" />

<property name="IsTerrainDecoration" value="true" />

<property name="ParticleName" value="campfire" />

<property name="ParticleOffset" value="0.5,0,0.5" />

<property name="HeatMapStrength" value="2"/>

<property name="HeatMapTime" value="1200"/>

<property name="HeatMapFrequency" value="25"/>

<property name="BuffsWhenWalkedOn" value="burningSmall"/>

<property name="ActiveRadiusEffects" value="+heatSource(3)"/>

<drop event="Destroy" name="FarmersCampfire" count="1" />

<drop event="Fall" name="FarmersCampfire" count="1" />

<property name="Group" value="Food/Cooking,Basics" />

<drop event="Destroy" name="[recipe]" count="0" />

<property class="Workstation">

<property name="Modules" value="tools,output,fuel,input"/>

</property>

<property name="DescriptionKey" value="campfireDesc"/>

</block>

</append>

</configs>

xui.xml's code:

<configs>

<append xpath="/xui">

<window_group name="WoodBurningFurnace" controller="XUiC_WorkstationWindowGroup">

<window name="windowCraftingList"/>

<window name="craftingInfoPanel"/>

<window name="windowCraftingQueue"/>

<window name="windowToolsCampfireFarmer" />

<window name="windowFuel" />

<window name="windowOutput" />

<window name="windowNonPagingHeader" />

</window_group>

</append>

</configs>

windows.xml's code:

<configs>

<append xpath="/windows">

<window name="WoodBurningFurnace" width="228" height="121" panel="Right" cursor_area="true" >

<!--#$-IGS END.-$#-->

<panel style="header.panel">

<sprite style="header.icon" sprite="ui_game_symbol_wrench"/>

<label style="header.name" text="TOOLS" text_key="xuiTools" />

</panel>

<rect name="content" depth="0" pos="0,-46" height="75" disablefallthrough="true">

<grid name="inventory" rows="1" cols="3" pos="3,-3" cell_width="75" cell_height="75" controller="WorkstationToolGrid" repeat_content="true" allow_sort_order="false"

required_tools="toolAnvil,toolForgeCrucible,toolBellows" required_tools_only="true">

<required_item_stack name="0"/>

</grid>

</rect>

</window>

</append>

</configs>

 
If the block loads but cant be interacted with, it is probably an issue with the xui entry. Is there any red text when the world loads?

I would try to copy the forge xui code and change the name to your new workstation. Once you get it working, change one line at a time until you get a working result or an error.

 
The block is there, I see it, can't go through it and I have to push the E button to interact with it, but when I press E, nothing happens. I copied the forge's xui and windows, and changed the name. And there is no red error while loading

 
Take a closer look at the name of the group of windows in xui - they start with "workstation_

Maybe it's just that.

 
Last edited by a moderator:
My codes are now:

xui.xml:

<configs>

<append xpath="/xui">

<window_group name="workstation_WoodBurningFurnace" controller="XUiC_WorkstationWindowGroup">

<window name="windowCraftingList"/>

<window name="craftingInfoPanel"/>

<window name="windowCraftingQueue"/>

<window name="windowToolsForge" />

<window name="windowFuel" />

<window name="windowForgeInput" />

<window name="windowOutput" />

<window name="windowNonPagingHeader" />

</window_group>

</append>

</configs>

windows.xml:

<configs>

<append xpath="/windows">

<window name="windowToolsWoodBurningFurnace" width="228" height="121" panel="Right" cursor_area="true" >

<!--#$-IGS END.-$#-->

<panel style="header.panel">

<sprite style="header.icon" sprite="ui_game_symbol_wrench"/>

<label style="header.name" text="TOOLS" text_key="xuiTools" />

</panel>

<rect name="content" depth="0" pos="0,-46" height="75" disablefallthrough="true">

<grid name="inventory" rows="1" cols="3" pos="3,-3" cell_width="75" cell_height="75" controller="WorkstationToolGrid" repeat_content="true" allow_sort_order="false"

required_tools="toolAnvil,toolForgeCrucible,toolBellows" required_tools_only="true">

<required_item_stack name="0"/>

</grid>

</rect>

</window>

</append>

</configs>

And nothing happens, so I don't know what to do with this.

 
Last edited by a moderator:
Without being at a computer, I would have to guess that the problem might be related to using the campfire class with a set of windows designed for a forge. It might work or it might not depending on what arguments the windows are asking the class for.

I always have to do all this trial and error before I get anything working - I spent the better part of a day debugging a simple loot container issue.

Keep posting, we will get it straightened out

 
If it is to integrate without "xpath" - it's working (not quite right because of the campfire class), but the workplace opens up.

In addition to what already convergent said :

Remember, the principle of melting materials inside the workstation is only related to the forge class.

Why did you choose the campfire class? most likely, the best fit - class forge...

By the way, you didn't use your custom tool window "windowToolsWoodBurningFurnace".

Substitute it instead <window name="windowToolsForge" />


(but i didn't check your window "windowToolsWoodBurningFurnace"!)

Do not use "xpath" until you debug your code - later make via "xpath".

 
Last edited by a moderator:
okay guys, I moved my xpathed code from the mod file to the original ones, and its working with that, but when I xpath it, just make the block itself and the forge too to can't use that. Why is that happening?

WTF IS THIS GAME XPATH NOT WORKING IN A18 WITH XUI AND WINDOWS???

and when i get it work, it just not smelt iron and other things... FUUUUUUUU....

 
Last edited by a moderator:
I wanted to post a screenshot, but the 7dtd forum's server is not accepting that, so I can't smelt any item in my furnace that I can in the forge

 
I use imgur.com to post screenshots.

Have you switched to the forge class?

 
Last edited by a moderator:
okay guys, I moved my xpathed code from the mod file to the original ones, and its working with that, but when I xpath it, just make the block itself and the forge too to can't use that. Why is that happening?WTF IS THIS GAME XPATH NOT WORKING IN A18 WITH XUI AND WINDOWS???

and when i get it work, it just not smelt iron and other things... FUUUUUUUU....
XPath certainly works. Check your Player.log to see if there are warnings where your xpath changes did not apply. If you don't see any warnings, make a change that breaks the file, and verify its loading.

 
On the screen, it looks functional....

Do not forget that after each edit - take from the creative every time again.

Previously installed block (work station) - may have old properties.

 
Everything is loaded perfectly from my mod. there was no problem at all only when I stop the fire the game says "Cannot play disabled audio source", but the function of my furnace is not working as it should be.

here is the screenshot of it

https://imgur.com/Fkop9lT

 
I restarted the game, replaced the block, and still nothing works in it. I put some scrap iron in there, and some coal as fuel, and the iron don't want to be smelted.

 
Again, on phone so cant parse xml, but looking back at your code it doesn't look like forge code. There is a line in the block code that lists which resources will melt in the forge. I know it works as I have a custom forge that will only melt stone and glass.

I HIGHLY recommend that you start with clean code, copy the vanilla forge and its dependent xui code and just change the name. Get a working copy. Then just change one thing at a time. Remember that the xml is available to mod, but not really written in a way that makes it easy. That will come later. Once you have figured out how everything works you can make nice path code that extends current code and can be shared. I think at the moment you are starting from the middle.

 
Thanks for your tips, and I will try that, but it will take me a few days. And the problem is that the block itself need to be in an xpathed blocks.xml because the game is push meg some fuuuuuu.... errors.

 
Last edited by a moderator:
Back
Top