HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

If Region contains Unit type=(Knights) then do (Action) else do (Action) HOW TO DO?

07-27-2003, 09:41 PM#1
Valoris
If Region contains Unit type=(Knights) then do (Action) else do (Action)
Is this statement possible?
How do I do it?
07-27-2003, 09:45 PM#2
hodi
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Whatever Region <gen> contains (Random unit from (Units of type Knight))) Equal to True
Then - Actions
Else - Actions
07-28-2003, 04:01 PM#3
dataangel
That's a bad solution. If there's one knight inside the region and one outside, it could select the one outside randomly, and it would return false.
07-28-2003, 05:33 PM#4
DaKaN
Pick every unit in unit group (units in region (the region)) matching condition (type of picked unit == knight) and do action
07-28-2003, 05:57 PM#5
Raptor--
of course, since u have to run a loop when u do pick every unit, u may want to just put a boolean switch inside the pick all, and then have an if statement afterwards that checks the bool and runs the action, assuming u wanna run the action only once and not for every knight in the area