Senzo Posted November 24, 2020 Share Posted November 24, 2020 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. Link to comment Share on other sites More sharing options...
Gouki Posted November 24, 2020 Share Posted November 24, 2020 1 hour ago, Senzo said: 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. 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 Link to comment Share on other sites More sharing options...
Senzo Posted November 24, 2020 Author Share Posted November 24, 2020 Yes, I looked everywhere to be able to correct the problem but unfortunately I did not find it. Think of a solution? Link to comment Share on other sites More sharing options...
Gouki Posted November 24, 2020 Share Posted November 24, 2020 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 Link to comment Share on other sites More sharing options...
Senzo Posted November 24, 2020 Author Share Posted November 24, 2020 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> Link to comment Share on other sites More sharing options...
Senzo Posted December 3, 2020 Author Share Posted December 3, 2020 On 11/24/2020 at 11:10 PM, 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" 😥 Link to comment Share on other sites More sharing options...
xyth Posted December 4, 2020 Share Posted December 4, 2020 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. Link to comment Share on other sites More sharing options...
KhaineGB Posted December 5, 2020 Share Posted December 5, 2020 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. Link to comment Share on other sites More sharing options...
Senzo Posted December 7, 2020 Author Share Posted December 7, 2020 +1, very happy to see that someone is interested! Do not hesitate to come back and inform me of your progress :) Link to comment Share on other sites More sharing options...
KhaineGB Posted December 8, 2020 Share Posted December 8, 2020 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. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.