(part2)
ZitatAlles anzeigenNow we still need to create the button in the construction's menu. We have to go back to the id's (guids.txt).
Because we want our own button, it is not possible to use a button's id already existing.
So I am taking the id 80000 because it doesn't exist.
I write at the end of the guids.txt: 80000=Big Harbor
I also have to edit the assets.xml.
To do so we have to open the file addon/patch0/addondata/config/game/properties.xml. This is the build menu.
And we can find in all that tangle... there is again the id's.
So it has we can find whatever preexisting building we are looking for.
Let's found out the Lumberjack's Hut.
Like before, we search the Lumberjack's Hut in the guids.txt, after you find its id, we can search the id in the properties.xml.
Nous scrollons le fichier un petit peu jusqu'à voir le texte <BuildingConstructionSettings>. Henceforth from top to bottom is the occidental build menu, right under the orient tab which begins with <FactionBuildingConstructionSettings>.
Let's go back to the lumberjack's hut. As you can see, there are severals id's. Take a look in the guids.txt to what refers these buildings.
Let's copy these sectons:
<Item>
<BuildingGUID>35100</BuildingGUID>
<BuildButtonTooltip>125018</BuildButtonTooltip>
</Item>
And we paste directly under itself and then we modify its GUID (the id):
<Item>
<BuildingGUID>80000</BuildingGUID>
<BuildButtonTooltip>125018</BuildButtonTooltip>
</Item>
Theoretically you can already build the harbour, but it has no icon and no tooltip.
Let's just care for the icon right now... hurry.
We open the file addon/patch0/addondata/config/game/icon.xml.
Let's find out the harbor's icon with its id.
We copy the text:
<i>
<GUID>39020</GUID>
<Icons>
<i>
<IconFileID>116</IconFileID>
<IconIndex>120</IconIndex>
</i>
</Icons>
</i>
Let's paste it right under it and modify its id :
<i>
<GUID>80000</GUID>
<Icons>
<i>
<IconFileID>116</IconFileID>
<IconIndex>120</IconIndex>
</i>
</Icons>
</i>
Now we also have our button in the construction menu.
Only the tooltip remains...
This one is also controled by an id. Because there is no similar construction, we have to create our own tooltip.
First of all let's open the next 3 files:
maindata/patch2/data/loca/eng/txt/tt_normal.txt tooltip file when the construction is available.
maindata/patch2/data/loca/eng/txt/tt_pressed.txt tooltip file when the construction button is pressed.
maindata/patch2/data/loca/eng/txt/tt_disabled.txt tooltip file when the construction is unavailable.
In the construction menu in the properties.xml right under the building-id is located the tooltip id. After found out what was the id, we will have to search it in the tt_normal.txt.
We can note that there is 2 more digits on the left of the tooltip id. These 2 digits are there for a reason, else the game wouldn't be able to know when trigger the tooltip.
10125018=[TTTTOOLTIP_TITLED][TTT TOOLTIP_TITLED_HEADER][AUTOSIZE_ICONGUID] [GUIDNAME][TTT TOOLTIP_TITLED_BODY]
[BUILDING_COSTS][CR] [CR]Erweitert den Baubereich für Produktionsstätten.[CR]Entsendet einen Marktkarren zur Warenabholung.
Now we have to copy the line and paste it right under it.
Reminder: the new tooltip must have a new unique id.
10400000=[TTT TOOLTIP_TITLED][TTT TOOLTIP_TITLED_HEADER][AUTOSIZE_ICONGUID] [GUIDNAME][TTT TOOLTIP_TITLED_BODY][BUILDING_COSTS][CR] [CR]Erweitert die Lagerkapazität auf der Insel um 50 Tonnen.
Now we do the same han before but with the files tt_disabled.txt and der tt_pressed.txt
And now modify the id in the construction's menu in properties.xml.
<Item>
<BuildingGUID>80000</BuildingGUID>
<BuildButtonTooltip>125018</BuildButtonTooltip>
</Item>
<Item>
<BuildingGUID>80000</BuildingGUID>
<BuildButtonTooltip>400000</BuildButtonTooltip>
</Item>
It's almost finished, we need to repack the modified files in the .rda archives and we are good to go.
Start a new game and in the construction's menu it is supposed to have a new button, this one is not locked but when you will make one, don't forget to also create it for the locked state.
When you put your mouse on the button, it is supposed to indicate the construction's materials required to build it.
If it isn't the case, you did something wrong :grins:
I hope I explained properly. Have fun tinkering.