- Joined
- Jul 14, 2014
- Messages
- 115
[Solved] How to categorize multiple buildings as one
So I'm working on an AI. Now I want the AI to always keep a certain amount of builders. Here's the trigger (It's very crude):
Now all would be fine if the capital wouldn't have any upgrades, but it does. So when upgrading I still want this trigger to work instead of checking if the AI has upgraded, then making another trigger, etc. etc. etc.
Now I've figured that I could assign all of the capital's upgrades to some kind of category and then pick all units of this category and order them to train a worker etc. Is that possible?
So I'm working on an AI. Now I want the AI to always keep a certain amount of builders. Here's the trigger (It's very crude):
-
Events
-
Time - Every 10.00 seconds of game time
-
-
Conditions
-
(Number of units in (Units owned by Player 1 (Red) of type Worker)) less than 2
-
-
Actions
-
Unit Group - Pick every unit in (Units owned by Player 1 (Red) of type Capital) and do (Actions)
-
Loop - Actions
-
Unit - Order (Picked unit) to train/upgrade to a Worker
-
-
-
Now all would be fine if the capital wouldn't have any upgrades, but it does. So when upgrading I still want this trigger to work instead of checking if the AI has upgraded, then making another trigger, etc. etc. etc.
Now I've figured that I could assign all of the capital's upgrades to some kind of category and then pick all units of this category and order them to train a worker etc. Is that possible?
Last edited: