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

Mold in the forge

Senzo

New member
Hello,
I am currently developing a small mod.

The goal is to be able to have molds in the forge to be able to melt resources, as with the crucible.

I managed to make my molds and also to make sure that the forge is the locations.

But there is a problem!
When I place a new forge it duplicates the elements of the "last" open forge!
Except the 3 1st mold.

Someone may be where it may come from.

Thank you.

 

forge.png

 
Hello,
I am currently developing a small mod.

The goal is to be able to have molds in the forge to be able to melt resources, as with the crucible.

I managed to make my molds and also to make sure that the forge is the locations.

But there is a problem!
When I place a new forge it duplicates the elements of the "last" open forge!
Except the 3 1st mold.

Someone may be where it may come from.

Thank you.

 

View attachment 16977


Hi Senzo

If I understood you correctly, your forge accepts all the molds that appear in your image (14 molds = 14 slots), I can assume that it would be a kind of bug what happens, there are too many slots for the tools.
Regards

 
Yes, I looked everywhere to be able to correct the problem but unfortunately I did not find it.
Think of a solution?

 
My forge has 4 slots for tools, I added a mold to make bricks, but it would not let me put the mold (only the 4 tools that are shown in the slots), the solution was to edit this part that is in windows.xml, I assume your mod has it and it also has windowToolsX, so edit this:

required_tools_only = "true"

Change it to "false"

With this, the forge allows you to put any tool or mold, but you will have to change them every time you want to make one thing or another.
Regards

 
Hello, thank you for your answer.

I also tested this method.

But I would really like to have the 14 slots dedicated to a mold, and also being able to leave them all in the forge.

Currently its working very well, the only concern is that when I place a new forge it duplicates the last forge that I opened.
Basically all the molds present in the last open forge are reproduced in the last. "Except the three 1st"

😥

here is my code used.     

   <window name="windowToolsForge" width="228" height="280" 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="3" cols="5" pos="3,-3" cell_width="75" cell_height="75" controller="WorkstationToolGrid" repeat_content="true"
                required_tools="mouleLingotFer,mouleLingotAcier,moulePlomb,mouleBallePlomb,mouleDouilleBalle,mouleDouilleRoquette,moulePointeRoquette,mouleClou,mouleFlecheFer,mouleFlecheAcier,mouleDart,toolBellows,toolAnvil,toolForgeCrucible," required_tools_only="true">
                    <required_item_stack name="0"/>
                </grid>
            </rect>

 
Last edited by a moderator:
Senzo said:
Hello, thank you for your answer.

I also tested this method.

But I would really like to have the 14 slots dedicated to a mold, and also being able to leave them all in the forge.

Currently its working very well, the only concern is that when I place a new forge it duplicates the last forge that I opened.
Basically all the molds present in the last open forge are reproduced in the last. "Except the three 1st"

😥

 
The game usually uses arrays of a predefined size to store things like number of tool slots.  Unless you use code to edit those values to increase the array size the game wont manage the changes to those slots between instances and sessions.

 
Last edited by a moderator:
What xyth said.

The forge is coded to have no more than 3 slots for it's "tools" section. Anything more than that causes duplication.

I need to get back to my DMT mod to see if I can fix that.

 
+1, very happy to see that someone is interested! Do not hesitate to come back and inform me of your progress :)

 
It's a pain because I need to resize the array before it's created.

But to do that, I have to patch the constructor. The game does not like you messing with the constructor.

 
Back
Top