Stealthed Units.

DonMushroom

Member
Reaction score
4
Hi :)

I i am looking to add a condition to this trigger so that permanently cloaked units don't activate it.

Events
Timer - Every 1.0 seconds of Game Time
Local Variables
P = 0 <Integer>
Conditions
Actions
General - For each integer P from 1 to 8 with increment 1, do (Actions)
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
(Number of Living units in (Any units in Region 001 G owned by player P matching Excluded: Structure, Missile, Dead, Hidden, with at most Any Amount)) > 0
Then
Player - Modify player P Vespene: Add 5
Else


How would i go about this? :)
 

Dave312

Censored for your safe viewing
Reaction score
269
You can use the Unit Filter Match function to check if a unit is cloaked:
Trigger:
  • ((Triggering unit) is Required: Cloaked for player (Triggering player)) == True


However this won't work if you want to only check for permanently cloaked units. Instead you might be better off checking for specific unit types which are permanently cloaked:
Trigger:
  • Or
    • Conditions
      • (Unit type of (Triggering unit)) == Dark Templar
      • (Unit type of (Triggering unit)) == Observer
      • etc
 

DonMushroom

Member
Reaction score
4
The bottom does not seem to work with the event. :(

How would i go about changing it so if any unit is cloaked it does not activate? :)
 

Siretu

Starcraft 2 Editor Moderator
Reaction score
293
Unfortunately, you can't just set it as a condition since there's no triggering unit. You could however change the "Number of Units in Unit Group" to arithmetic and take the number of living units and subtract all the dark templars and observers.

If you are okay with it only checking cloaked unit(even those who are only temporarily cloaked), it's very easy. Just change the filter in the "Number of Units in Unit Group" action and set cloaked to excluded.
 

DonMushroom

Member
Reaction score
4
If you are okay with it only checking cloaked unit(even those who are only temporarily cloaked), it's very easy. Just change the filter in the "Number of Units in Unit Group" action and set cloaked to required.

This sounds spot on. How do i do this? :p
 

Siretu

Starcraft 2 Editor Moderator
Reaction score
293
I accidently said it wrong. It's supposed to be set to excluded, not required. Anyway, here's what you do:

You have the condition "(Number of Living units in (Any units in Region 001 G owned by player P matching Excluded: Structure, Missile, Dead, Hidden, with at most Any Amount)) > 0"

There's a filter in there(that's the part with "Excluded: Structure, Missile, Dead, Hidden"). Open up the filter and find "Cloaked" in the list and double-click it until it is "excluded" instead of "Allowed".
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top