HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Detection Problems

06-27-2005, 08:48 PM#1
Setreal
For a certain trigger I need to detect a few things and I'm unsure how.

- If there is a certain amount of heros in a rect ( Eg. Is there 3-6 heros in the rect? True or False ) I know this is doable by # of heros in rect = 3 or # of heros in rect - 4 ect. but that can make for a fairly long trigger.

- If the detected heros in the above case are of a certain level ( Eg. Are the 3-6 heros in the rect lvls 4-8? True or False )
06-27-2005, 09:27 PM#2
Anitarf
Just do "More than 2 and less than 7"?

Loop through all the heroes, if you find one that's outside the level limit, return false, at the end of loop, return true.
06-27-2005, 09:29 PM#3
Therin
Quote:
Originally Posted by Setreal
For a certain trigger I need to detect a few things and I'm unsure how.

- If there is a certain amount of heros in a rect ( Eg. Is there 3-6 heros in the rect? True or False ) I know this is doable by # of heros in rect = 3 or # of heros in rect - 4 ect. but that can make for a fairly long trigger.

I think this should work for that one...

Code:
Set HEROES = (Number of units in (Units in REGION(((Matching unit) is A Hero) Equal to True)))

You could then use the HEROES variable in an IF function...

Quote:
Originally Posted by Setreal
- If the detected heros in the above case are of a certain level ( Eg. Are the 3-6 heros in the rect lvls 4-8? True or False )


and this for that one....

Code:
Set HEROESLVL = (Number of units in (Units in REGION((((Matching unit) is A Hero) Equal to True) and (((Level of (Matching unit)) Greater than or equal to 4) and ((Level of (Matching unit)) Less than or equal to 8)))))

I'm not sure what you're going to use them for, maybe you only need to latter one, depending on if you need both these values separetly.

In that case you could compare the HEROES and HEROESLVL variable, to see if they match to return a true or false from that...



Or you could just use the above unit counting directly in an IF function if you don't intend to use the values alot.
06-27-2005, 09:35 PM#4
Setreal
Can't believe I looked over something so simple as the solution to the first problem but as for you description to solve the second I don't quite understand. I'm not that familiar with loops so if you could state the exact triggers I'd be greatly appreciative.

Edit : New post helped me. Thanks both of you.