Majesty Gold HD

Majesty Gold HD

Customize Majesty!
Create and upload new Quests and Mods for Majesty HD!
How to force upgrade buildings for CPU?
I'm probably overlooking something, but I don't see an option for this?
< >
Showing 1-3 of 3 comments
Enerril 16 26 Jan, 2022 @ 5:42pm 
if by CPU you mean computer player then upgrading is manual for every building through $building_upgraded (thisagent) function

You can see examples of this in RandomEE or StandAlone AI workshop mods.

if(b's"Title"=="MarketPlace")

if(b's"level"==1 && $GetAttribute(b, #ATTRIB_CurrentStageBuilt) == 1)
begin
$ChangeUnitType (b, "Marketplace2");
$AdjustAttribute (b, #ATTRIB_MaxHP, 50);
(b, #ATTRIB_CurrentStageBuilt, 0);
$building_upgraded (b);
$AdjustPlayerData (b, "gold", -1000);

end
Dracoceros 11 29 Jan, 2022 @ 1:58pm 
So why doesn't this work with buildings that don't have a level greater than 1 to begin with? I mean, I can use the script, but it only shows "Level 1" in the building stats.
Enerril 16 29 Jan, 2022 @ 6:27pm 
Why should computer upgrade building that doesn't have upgrade option? Or you mean spawning building in the first place? Or you mean that after you upgrade building you see in the debugger that building's level is still 1?

Buildings change their level when player change their title name by hand or script. Titles are stored in the building_data.dat file. level is tied to building title.

Again, subscribe to randomEE workshop quest. Look up the code in its directory. VikisRule did great job commenting his code. Its clean and easy to read. You can learn >90% AI functionality from there. Mine extends that functionality but far less readable
< >
Showing 1-3 of 3 comments
Per page: 1530 50