Does this boolean exist? If so, how can I use it in my map?

LoveTD's

New Member
Reaction score
34
If any unit from unit group is in region ... equal to true

Is it possible to do that? because the only thing I saw @ booleans is the boolean:

If ALL units from unit group are in region ... equal to true
 

ShadowInTheD

Active Member
Reaction score
12
I don't know, and I really don't want to check, but if it's not, you can easily do it by creating a loop and getting the positions of all the units in a unit group, and check if the points are in a region or within the range of a point.
 

LoveTD's

New Member
Reaction score
34
that's quite smart, I havent thought of that :p thank you. I will try it right away... if it works you will get +rep :D

1 problem though: I have no Idea how I would make a loop that checks the points of a unit ^^
 

Dinowc

don't expect anything, prepare for everything
Reaction score
223
set bool_group = units in <region> matching (matching unit is in <your_group>)
if number of units in bool_group greater than 0....
 

ShadowInTheD

Active Member
Reaction score
12
You just make a unit group, if you want, (it could be more complicated), or you can in some way manipulate it to be in an integer loop. But either way, you have to set a point to the position of each unit in the group, like TempPoint[integer+1] for each unit in the group. Then, to actually check it, do a loop, if then else, and do for each (number you started with) - number of units in group and then do if TempPoint is in region / within range of point then do your actions, if else, don't do your actions.

EDIT: Sorry, when you do the unit loop with TempPoint[integer +1], you have to set integer = to integer +1 as well.
 

LoveTD's

New Member
Reaction score
34
set bool_group = units in <region> matching (matching unit is in <your_group>)
if number of units in bool_group greater than 0....
<--- This solved my problem, thank you! <3

Nevermind, strange enough it didnt work, what I am trying to do is that whenever any unit from a unit group is in the same region as any unit from a different unit group a boolean has to turn on true...

so it should turn false when:
there's only 1 unit in the region
there are more units of the same group in the region
there is no unit in the region
there are not 2 (or more) units from different unit groups in the region
 

Dinowc

don't expect anything, prepare for everything
Reaction score
223
uhm that's a complicated one...
try this:

Code:
set group1 = units in <region> matching (matching unit is in <first_group>)
set group2 = units in <region> matching (matching unit is in <second_group>)

if then else
   if number of units in group1 equal to 1 and number of units in group2 equal to 1
     then
       ....do whatever actions
     else
 

LoveTD's

New Member
Reaction score
34
I already tryed that and it didnt work :S I'll post the triggers as soon as I get home, the thing is: I'm working on a king of the hill system and everything worked when it was a free-for-all game... the teamplay game however changed the triggers a bit which means it doesnt work for team 2 and pausing the timer while 2 different teams are in the same region also doesnt work :S
 

LoveTD's

New Member
Reaction score
34
Here are the triggers, as I said in the post above:

this one is the timer for the players in team 1:
Code:
Team 1 timer
    Events
        Time - Every 0.70 seconds of game time
    Conditions
    Actions
        Unit Group - Pick every unit in Raiders_Units and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (King of the hill <gen> contains (Picked unit)) Equal to False
                    Then - Actions
                        Countdown Timer - Pause King_timer[1]
                        Countdown Timer - Hide King_timer_window[1] for Player 1 (Red)
                        Countdown Timer - Hide King_timer_window[1] for Player 2 (Blue)
                        Countdown Timer - Hide King_timer_window[1] for Player 3 (Teal)
                        Countdown Timer - Hide King_timer_window[1] for Player 4 (Purple)
                        Countdown Timer - Hide King_timer_window[1] for Player 5 (Yellow)
                    Else - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                ((Unit-type of (Picked unit)) Not equal to |cffFFCC00Space Orc Elite|r) and (((Unit-type of (Picked unit)) Not equal to |cffFFCC00Space Orc Pyromaniac|r) and (((Unit-type of (Picked unit)) Not equal to |cffFFCC00Space Orc Sniper|r) and ((Unit-type of (Picked unit)) Not equal to |cffFFCC00Space Orc Task Force|r)))
                            Then - Actions
                                Countdown Timer - Pause King_timer[1]
                                Countdown Timer - Hide King_timer_window[1] for Player 1 (Red)
                                Countdown Timer - Hide King_timer_window[1] for Player 2 (Blue)
                                Countdown Timer - Hide King_timer_window[1] for Player 3 (Teal)
                                Countdown Timer - Hide King_timer_window[1] for Player 4 (Purple)
                                Countdown Timer - Hide King_timer_window[1] for Player 5 (Yellow)
                            Else - Actions
                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    If - Conditions
                                        More_then_one_in_rect Equal to True
                                    Then - Actions
                                        Countdown Timer - Pause King_timer[1]
                                    Else - Actions
                                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                            If - Conditions
                                                Has_already_been_in_region[1] Equal to True
                                            Then - Actions
                                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                    If - Conditions
                                                        Timer_is_dead[1] Equal to False
                                                    Then - Actions
                                                        Countdown Timer - Resume King_timer[1]
                                                        Countdown Timer - Show King_timer_window[1] for Player 1 (Red)
                                                        Countdown Timer - Show King_timer_window[1] for Player 2 (Blue)
                                                        Countdown Timer - Show King_timer_window[1] for Player 3 (Teal)
                                                        Countdown Timer - Show King_timer_window[1] for Player 4 (Purple)
                                                        Countdown Timer - Show King_timer_window[1] for Player 5 (Yellow)
                                                    Else - Actions
                                                        Do nothing
                                            Else - Actions
                                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                    If - Conditions
                                                        Timer_is_dead[1] Equal to False
                                                    Then - Actions
                                                        Countdown Timer - Start King_timer[1] as a One-shot timer that will expire in 60.00 seconds
                                                        Countdown Timer - Create a timer window for King_timer[1] with title King of the hill:
                                                        Set King_timer_window[1] = (Last created timer window)
                                                        Countdown Timer - Show King_timer_window[1] for Player 1 (Red)
                                                        Countdown Timer - Show King_timer_window[1] for Player 2 (Blue)
                                                        Countdown Timer - Show King_timer_window[1] for Player 3 (Teal)
                                                        Countdown Timer - Show King_timer_window[1] for Player 4 (Purple)
                                                        Countdown Timer - Show King_timer_window[1] for Player 5 (Yellow)
                                                        Countdown Timer - Hide King_timer_window[1] for Player 6 (Orange)
                                                        Countdown Timer - Hide King_timer_window[1] for Player 7 (Green)
                                                        Countdown Timer - Hide King_timer_window[1] for Player 8 (Pink)
                                                        Countdown Timer - Hide King_timer_window[1] for Player 9 (Gray)
                                                        Countdown Timer - Hide King_timer_window[1] for Player 10 (Light Blue)
                                                        Set Has_already_been_in_region[1] = True
                                                    Else - Actions
                                                        Do nothing

this one is the timer for the players in team 2:

Code:
Team 2 timer
    Events
        Time - Every 0.70 seconds of game time
    Conditions
    Actions
        Unit Group - Pick every unit in Stompeak_Units 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)) Not equal to |cffFFCC00Space Orc Elite|r) and (((Unit-type of (Picked unit)) Not equal to |cffFFCC00Space Orc Pyromaniac|r) and (((Unit-type of (Picked unit)) Not equal to |cffFFCC00Space Orc Sniper|r) and ((Unit-type of (Picked unit)) Not equal to |cffFFCC00Space Orc Task Force|r)))
                    Then - Actions
                        Countdown Timer - Pause King_timer[2]
                        Countdown Timer - Hide King_timer_window[2] for Player 1 (Red)
                        Countdown Timer - Hide King_timer_window[2] for Player 2 (Blue)
                        Countdown Timer - Hide King_timer_window[2] for Player 3 (Teal)
                        Countdown Timer - Hide King_timer_window[2] for Player 4 (Purple)
                        Countdown Timer - Hide King_timer_window[2] for Player 5 (Yellow)
                    Else - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                (King of the hill <gen> contains (Picked unit)) Equal to False
                            Then - Actions
                                Countdown Timer - Pause King_timer[2]
                                Countdown Timer - Hide King_timer_window[2] for Player 1 (Red)
                                Countdown Timer - Hide King_timer_window[2] for Player 2 (Blue)
                                Countdown Timer - Hide King_timer_window[2] for Player 3 (Teal)
                                Countdown Timer - Hide King_timer_window[2] for Player 4 (Purple)
                                Countdown Timer - Hide King_timer_window[2] for Player 5 (Yellow)
                            Else - Actions
                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    If - Conditions
                                        More_then_one_in_rect Equal to True
                                    Then - Actions
                                        Countdown Timer - Pause King_timer[2]
                                    Else - Actions
                                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                            If - Conditions
                                                Has_already_been_in_region[2] Equal to True
                                            Then - Actions
                                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                    If - Conditions
                                                        Timer_is_dead[2] Equal to False
                                                    Then - Actions
                                                        Countdown Timer - Resume King_timer[2]
                                                        Countdown Timer - Show King_timer_window[2] for Player 6 (Orange)
                                                        Countdown Timer - Show King_timer_window[2] for Player 7 (Green)
                                                        Countdown Timer - Show King_timer_window[2] for Player 8 (Pink)
                                                        Countdown Timer - Show King_timer_window[2] for Player 9 (Gray)
                                                        Countdown Timer - Show King_timer_window[2] for Player 10 (Light Blue)
                                                    Else - Actions
                                                        Do nothing
                                            Else - Actions
                                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                    If - Conditions
                                                        Timer_is_dead[2] Equal to False
                                                    Then - Actions
                                                        Countdown Timer - Start King_timer[2] as a One-shot timer that will expire in 60.00 seconds
                                                        Countdown Timer - Create a timer window for King_timer[2] with title King of the hill:
                                                        Set King_timer_window[2] = (Last created timer window)
                                                        Countdown Timer - Hide King_timer_window[2] for Player 1 (Red)
                                                        Countdown Timer - Hide King_timer_window[2] for Player 2 (Blue)
                                                        Countdown Timer - Hide King_timer_window[2] for Player 3 (Teal)
                                                        Countdown Timer - Hide King_timer_window[2] for Player 4 (Purple)
                                                        Countdown Timer - Hide King_timer_window[2] for Player 5 (Yellow)
                                                        Countdown Timer - Show King_timer_window[2] for Player 6 (Orange)
                                                        Countdown Timer - Show King_timer_window[2] for Player 7 (Green)
                                                        Countdown Timer - Show King_timer_window[2] for Player 8 (Pink)
                                                        Countdown Timer - Show King_timer_window[2] for Player 9 (Gray)
                                                        Countdown Timer - Show King_timer_window[2] for Player 10 (Light Blue)
                                                        Set Has_already_been_in_region[2] = True
                                                    Else - Actions
                                                        Do nothing

This one is for checking if there are 2 units or more from different teams in the same region:

Code:
Check units in region
    Events
        Time - Every 0.10 seconds of game time
    Conditions
    Actions
        Set Raider_Units_Bool_group = (Units in King of the hill <gen> matching (((Matching unit) is in Raiders_Units) Equal to True))
        Set Stompeak_Units_Bool_group = (Units in King of the hill <gen> matching (((Matching unit) is in Stompeak_Units) Equal to True))
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                ((Number of units in Raider_Units_Bool_group) Equal to 0) and ((Number of units in Stompeak_Units_Bool_group) Equal to 0)
            Then - Actions
                Set More_then_one_in_rect = False
            Else - Actions
                If (((Number of units in Stompeak_Units_Bool_group) Greater than or equal to 1) and ((Number of units in Raider_Units_Bool_group) Greater than or equal to 1)) then do (Set More_then_one_in_rect = True) else do (Do nothing)

This one is for that when team 1 wins the king of the hill:

Code:
Win for team 1
    Events
        Time - King_timer[1] expires
    Conditions
    Actions
        Set Timer_is_dead[1] = True
        Countdown Timer - Destroy King_timer_window[1]
        Game - Display to (All players) the text: (The Raiders +  Have won king of the hill!)
        Trigger - Turn off show all times <gen>

And this one is for team 2 to win:

Code:
Win for team 2
    Events
        Time - King_timer[2] expires
    Conditions
    Actions
        Set Timer_is_dead[2] = True
        Countdown Timer - Destroy King_timer_window[2]
        Game - Display to (All players) the text: (Stompeak +  Have won king of the hill!)
        Trigger - Turn off show all times <gen>

now these are the problems I have: team 1 timer works, but does not stop when a player of the other team is in the hill with a player of team 1.
Team 2 timer doesnt show which means: it does show the timer window with the title, but no timer in it. If I can fix these 2 things then these triggers should work.

Anyone who can find the solution to this will get +rep :D
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top