• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

[Solved] AI not Rebuilding

Level 4
Joined
Aug 3, 2025
Messages
27
so for some reason despite the previous fix that i received for the AI that did actually make them rebuild their lost buildings now iam using the same code and they don't rebuild anymore for some reason, and i am not sure what causes it exactly.

Not to mention that one of my AI Scripts was causing the game to crash for some reason the fix i found for it was to change the
call SetBuildUpgrEx(1, 1, 2, CENTAUR_STRONGHOLD)
call SetBuildUpgrEx(1, 1, 2, CENTAUR_FORTRESS)
to
call SetBuildUnitEx(1, 1, 2, CENTAUR_STRONGHOLD)
call SetBuildUnitEx(1, 1, 2, CENTAUR_FORTRESS)
i am quite confused on hos this even works to be honest, for now though what i mainly need is to understand what caused my AI to not function right again
 

Attachments

Last edited:
honestly im not the best one to tackle AI problem, im lowkey learning it as well, but dont you need to use either ID of this custom building (for example H001) or base it on name of building you are basing it on (for example ORC_STRONGHOLD, if you are basing it on orc stronghold that is xd). If i were you i would download AI file from random campaign map and work on it instead of creating new one from the scratch.
 
honestly im not the best one to tackle AI problem, im lowkey learning it as well, but dont you need to use either ID of this custom building (for example H001) or base it on name of building you are basing it on (for example ORC_STRONGHOLD, if you are basing it on orc stronghold that is xd). If i were you i would download AI file from random campaign map and work on it instead of creating new one from the scratch.
I am not sure what you mean, i am using the ID of my custom buildings and it did work previously, the AI does upgrade it's great hall to a stronghold and fortress but that is about it for the builds.
 
Last edited:
eh apparently it seems to be something i did that even when i remove it from the code it ends up ruining it somehow, a code that i placed for the AI to build a great hall when they don't have one, which when i try it doesn't work and ruins the AI and even when i remove it, it basically ruins it completely apparently not sure exactly how but this is how i see it.
if ( GetUnitCountDone(CENTAUR_GREATHALL) = 0 and GetUnitCountDone(CENTAUR_STRONGHOLD) = 0 and GetUnitCountDone(CENTAUR_FORTRESS) = 0 ) then
call SetBuildUnitEx(1, 1, 1, CENTAUR_GREATHALL)
endif
call SetBuildUpgrEx(1, 1, 1, CENTAUR_STRONGHOLD)
call SetBuildUpgrEx(1, 1, 1, CENTAUR_FORTRESS)
this is the code btw
 
i have no idea anymore
Yea it is a mess sometimes i don't realize the issue until it is too late, like i just found out today that one of my raw codes was wrong for one of my buildings, i have like 3 different altar types and i accidently used the wrong raw code for one of them for the wrong race, so yea removing that made the AI function better, and now the AI works perfectly fine for now, ended up having to overwrite an existing AI but least the issue is resolved for now.
 
Back
Top