View Full Version : Check for Unit TYPE in region
Ramza
11-29-2010, 03:57 PM
How to do this?
I'm guessing it's a boolean condition, but I can't find it (only unit in region).
EDIT:
http://www.mani.de/ivolume/gfx/SolvedStamp.png
Maker
11-29-2010, 04:33 PM
Like this, unit type comparison? Or do you mean a check to detect that are there any units of type x in a region?
1:
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Playable map area) contains (Triggering unit)) Equal to True
(Unit-type of (Triggering unit)) Equal to Footman
Then - Actions
Else - Actions
2:
Untitled Trigger 001
Events
Player - Player 1 (Red) skips a cinematic sequence
Conditions
Actions
Set boolean = False
Custom script: set bj_wantDestroyGroup = true
Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Unit-type of (Picked unit)) Equal to Footman
Then - Actions
Set boolean = True
Skip remaining actions
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
boolean Equal to True
Then - Actions
Game - Display to Player Group - Player 1 (Red) the text: True
Else - Actions
Ramza
11-29-2010, 04:42 PM
Yeah, exactly. I was looking for something like number 2, because the unit isn't triggering or doing anything.
Thanks!
Edit: Wait, what if there are multiple unit-types in the region? It will only set the boolean to true if all picked units are Footmen, right? Because I need to check if there is any unit of a type in the region.
Raven0
11-29-2010, 05:40 PM
Edit: Wait, what if there are multiple unit-types in the region? It will only set the boolean to true if all picked units are Footmen, right? Because I need to check if there is any unit of a type in the region.
The above posted trigger will set the boolean to true if there is atleast 1 footman in the region. If there are other unit types it will still set it to true as long as there is atleast 1 footman.
Ramza
11-29-2010, 09:41 PM
Ah, alright. Then everything is cool. :)
Maker
11-30-2010, 08:39 AM
You could also do it like this:
Untitled Trigger 001 Copy
Events
Player - Player 1 (Red) skips a cinematic sequence
Conditions
Actions
Custom script: set bj_wantDestroyGroup = true
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Number of units in (Units in (Playable map area) matching ((((Matching unit) is alive) Equal to True) and ((Unit-type of (Matching unit)) Equal to Footman)))) Greater than 0
Then - Actions
Game - Display to Player Group - Player 1 (Red) the text: There's at least on...
Else - Actions
Ramza
11-30-2010, 11:57 AM
Yes, even better. It seems like it's actually really simple, so I don't know why I couldn't come up with this.
Thanks again.
vBulletin® v3.8.7, Copyright ©2000-2013, vBulletin Solutions, Inc.
Search Engine Optimization by
vBSEO 3.5.1 PL2