Majesty Gold HD

Majesty Gold HD

Customize Majesty!
Create and upload new Quests and Mods for Majesty HD!
Dracoceros 11 2022 年 1 月 26 日 下午 3:02
How to force upgrade buildings for CPU?
I'm probably overlooking something, but I don't see an option for this?
< >
正在显示第 1 - 3 条,共 3 条留言
Enerril 16 2022 年 1 月 26 日 下午 5:42 
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 2022 年 1 月 29 日 下午 1:58 
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 2022 年 1 月 29 日 下午 6:27 
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
< >
正在显示第 1 - 3 条,共 3 条留言
每页显示数: 1530 50