• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[AI] Upgrade Unit

Status
Not open for further replies.
Level 22
Joined
Feb 3, 2009
Messages
3,292
So In my map I have buildings that upgrade to better buildings

In my map Fortress upgrades to Lords Fortress

So here is the problem, I 1st of all Order a worker to build a Fortress and after it's complete I order it Upgraded to Lords Fortress.
And then the AI start's to build a new Fortress, as he doesn't have one anymore (because the old one is now Lords Fortress)

And that is the problem, I want to make the AI know that Lords Fortress if a better than Fortress, I don't want him to have both, as it's waste of space and gold and lumber.

How do I do that?

I'm actually very good with AIs, but I never managed to figure this out.
 
Run an upgrade once you upgrade your fortress (detect it with Unit - A unit finishes an upgrade) and then, whenever you want to build a fortress, just make an Integer Comparison
  • (Current research level of Iron Forged Swords for Player 1 (Red)) Not equal to 0
and then order the unit to build a Lords Fortress.

Action to run the upgrade: Player - Set the current research level of Iron Forged Swords to 1 for Player 1 (Red)
 
Level 10
Joined
Oct 31, 2009
Messages
352
Is your lord's fortress properly defined as the 4th tier in your maps gameplay constants?

/concur (though I think it'd be the second tier the way he's describing it)

Setting it as the next tier should tell the AI that it is part of a chain of upgrades of the same structure and ergo it will not construct a new building. I haven't done much work with the AI editor but that would be my first guess.
 
Status
Not open for further replies.
Top