Jump to content

Custom forge, and workstation


VENOM2019

Recommended Posts

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.

Link to comment
Share on other sites

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...;))

Link to comment
Share on other sites

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>

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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".

Link to comment
Share on other sites

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....

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

https://imgur.com/Gn3OAz2

 

THAT'S ENOUGH... I ONLY WANTED A FORGE TYPE THING WITH MY OWN RECIPES.... AND THE GAME IS A SUCKER AND DONT LET ME DO IT.

I tried everything. And Im really angry now, so I will delete this block from the earth... you guys try to help me, but there is a game blocking all of the ideas, and nothing helps on it. I dont have patience for just stuck at ONE BLOCK.... ONE MINDBLOWIN' BLOCK THAT I HAVE TO TRY TO MAKE A CODE THAT "WORKS" FOR THAT CRAP

Im trying to make this crap about 3 days and my brain is out of patience completely... Patience now about -99999999999999 so I dont know what to do now....

 

The last thing I try to do is paste it in the original file, and if it works in that, I will knife myself in the balls

Link to comment
Share on other sites

Okay guys, the problem was at this part:

<property class="Workstation">

<property name="CraftingAreaRecipes" value="forge"/>

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

<property name="InputMaterials" value="iron,brass,lead,glass,stone,clay"/>

</property>

 

And the correct that I needed:

<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"/>

</property>

 

So that small "material_" caused all of my problems hooooollly mooooollly

my code now:

 

<block name="WoodBurningFurnace">

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

<property name="UnlockedBy" value="perkAdvancedEngineering,forgeSchematic"/>

<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="#@modfolder:Resources/Testfurnace.unity3d?Testfurnace" />

<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="lead,glass,stone,clay"/>

</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="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,advBuilding"/>

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

<property name="EconomicValue" value="1000"/>

<property name="FilterTags" value="fdecor,fother,ffurniture"/>

<property name="SortOrder1" value="70i0"/>

</block>

 

and it works in the original files....

 

https://imgur.com/atiRRSx

 

THANKS FOR HELP EVERYONE!!!

 

And I have a question.. how to position the smoke effect on the top? My furnace is 2 block high, and looks like this: https://skfb.ly/6Mpup I want to make the smoke come out of the chimney, and the light from the top and the bottom bars.(the smoke neccessary, but the light not. how is it possible?)

Link to comment
Share on other sites

So that small "material_" caused all of my problems hooooollly mooooollly

my code now:

hmm... it correctly was written in the screenshot...

 

Line:

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

located of particle effects (X,Y,Z relative to the block)

 

Unfortunately, integrated particle can not be divided into parts, and you can't use more than one.

Here you need a specially created particle for such a model.

Link to comment
Share on other sites

I will download the a18.2(b5) depot from steam, and I hope thenext alpha will have tha "same" coding as the a18.2 has, because the a18.2's coding almost the same if we compare to a17.4. Thanks for congrats, I was really upset to the game that not wanted to tell me what's wrong with my code.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...