Moving to region trigger not working

tachiKC

New Member
Reaction score
3
Im making a hero arena and the event will eventually be every x seconds, but to test it I did it like this. The trigger does not work however for whatever reason. Thanks.

Code:
Test
    Events
        Player - Player 2 (Blue) types a chat message containing -test as An exact match
    Conditions
    Actions
        Unit Group - Pick every unit in (Units in (Playable map area) matching (((Picked unit) is A Hero) Equal to True)) and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Owner of (Picked unit)) Equal to Player 2 (Blue)
                        (Owner of (Picked unit)) Equal to Player 3 (Teal)
                        (Owner of (Picked unit)) Equal to Player 4 (Purple)
                        (Owner of (Picked unit)) Equal to Player 5 (Yellow)
                        (Owner of (Picked unit)) Equal to Player 6 (Orange)
                    Then - Actions
                        Unit - Move (Picked unit) instantly to (Random point in Good Arena <gen>)
                    Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Owner of (Picked unit)) Equal to Player 8 (Pink)
                        (Owner of (Picked unit)) Equal to Player 9 (Gray)
                        (Owner of (Picked unit)) Equal to Player 10 (Light Blue)
                        (Owner of (Picked unit)) Equal to Player 11 (Dark Green)
                        (Owner of (Picked unit)) Equal to Player 12 (Brown)
                    Then - Actions
                        Unit - Move (Picked unit) instantly to (Random point in Evil Arena <gen>)
                    Else - Actions
 

HG-Bonfire

New Member
Reaction score
22
Missing an Or function in your conditions, so the trigger is checking to see if the unit is controlled by players 2, 3, 4, 5, and 6. Since a unit cannot be owned by more than one player at once, its always going to be false, and the trigger isn't going to run.

The condition you're looking for is at the bottom of the list of conditions. I believe it reads: "Or (Multiple Conditions)" or something similar.
 

tachiKC

New Member
Reaction score
3
Thanks, this is what I have, and its still not working.
Code:
Test
    Events
        Player - Player 2 (Blue) types a chat message containing -test as An exact match
    Conditions
    Actions
        Unit Group - Pick every unit in (Units in (Playable map area) matching (((Picked unit) is A Hero) Equal to True)) and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        Or - Any (Conditions) are true
                            Conditions
                                (Owner of (Picked unit)) Equal to Player 2 (Blue)
                                (Owner of (Picked unit)) Equal to Player 3 (Teal)
                                (Owner of (Picked unit)) Equal to Player 4 (Purple)
                                (Owner of (Picked unit)) Equal to Player 5 (Yellow)
                                (Owner of (Picked unit)) Equal to Player 6 (Orange)
                    Then - Actions
                        Unit - Move (Picked unit) instantly to (Random point in Good Arena <gen>)
                    Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        Or - Any (Conditions) are true
                            Conditions
                                (Owner of (Picked unit)) Equal to Player 8 (Pink)
                                (Owner of (Picked unit)) Equal to Player 9 (Gray)
                                (Owner of (Picked unit)) Equal to Player 10 (Light Blue)
                                (Owner of (Picked unit)) Equal to Player 11 (Dark Green)
                                (Owner of (Picked unit)) Equal to Player 12 (Brown)
                    Then - Actions
                        Unit - Move (Picked unit) instantly to (Random point in Evil Arena <gen>)
                    Else - Actions
 

Exide

I am amazingly focused right now!
Reaction score
448
Are you Player 2 (Blue)?
Your trigger leaks two unit groups and two points.
 

tachiKC

New Member
Reaction score
3
Yeah Im Blue. And yeah leaks I can fix easily, I just want to get the darned thing working first.
 

Exide

I am amazingly focused right now!
Reaction score
448
It's easier to read and fix when you fix the leak to begin with.

Change this:
Code:
(Units in (Playable map area) matching ((([COLOR="Red"]Picked unit[/COLOR]) is A Hero)

to:
Code:
(Units in (Playable map area) matching ((([COLOR="Red"]Matching unit[/COLOR]) is A Hero)
 

tachiKC

New Member
Reaction score
3
Thanks, this works. I knew it had to be some small thing that I was missing. This trigger has been bugging me for some time. Now I know that when I use the Unit Group command to use "matching" and not picked.

Thanks again, +rep.
Code:
Test
    Events
        Player - Player 2 (Blue) types a chat message containing -test as An exact match
    Conditions
    Actions
        Set Temp_Unit_Group = (Units in (Playable map area) matching (((Matching unit) is A Hero) Equal to True))
        Set Temp_Point_A = (Random point in Good Arena <gen>)
        Set Temp_Point_B = (Random point in Evil Arena <gen>)
        Unit Group - Pick every unit in Temp_Unit_Group and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        Or - Any (Conditions) are true
                            Conditions
                                (Owner of (Picked unit)) Equal to Player 2 (Blue)
                                (Owner of (Picked unit)) Equal to Player 3 (Teal)
                                (Owner of (Picked unit)) Equal to Player 4 (Purple)
                                (Owner of (Picked unit)) Equal to Player 5 (Yellow)
                                (Owner of (Picked unit)) Equal to Player 6 (Orange)
                    Then - Actions
                        Unit - Move (Picked unit) instantly to Temp_Point_A
                        Custom script:   call RemoveLocation (udg_Temp_Point_A)
                    Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        Or - Any (Conditions) are true
                            Conditions
                                (Owner of (Picked unit)) Equal to Player 8 (Pink)
                                (Owner of (Picked unit)) Equal to Player 9 (Gray)
                                (Owner of (Picked unit)) Equal to Player 10 (Light Blue)
                                (Owner of (Picked unit)) Equal to Player 11 (Dark Green)
                                (Owner of (Picked unit)) Equal to Player 12 (Brown)
                    Then - Actions
                        Unit - Move (Picked unit) instantly to Temp_Point_B
                        Custom script:   call RemoveLocation (udg_Temp_Point_B)
                    Else - Actions
        Custom script:   call DestroyGroup (udg_Temp_Unit_Group)
 

Exide

I am amazingly focused right now!
Reaction score
448
You should move all three custom scripts to the end of the trigger.
As of now, you set two points, but only use and clean one of them.
Either move the call remove location custom scripts, or move the 'set Temp_Point' variable inside the unit group -loop.
This way you will get random points for all Heroes, instead of them all ending up at the same random point.

EDIT: You should also remove the second If / Then / Else, and use 'Else' in the first, and use *Player is an ally of ...* -condition Like this:

Code:
Test
    Events
        Player - Player 2 (Blue) types a chat message containing -test as An exact match
    Conditions
    Actions
        Set Temp_Unit_Group = (Units in (Playable map area) matching (((Matching unit) is A Hero) Equal to True))
        Unit Group - Pick every unit in Temp_Unit_Group and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Owner of (Picked unit)) is an Ally of Player 2 (Blue)
                    Then - Actions
                        Set Temp_Point_A = (Random point in Good Arena <gen>)
                        Unit - Move (Picked unit) instantly to Temp_Point_A
                        Custom script:   call RemoveLocation (udg_Temp_Point_A)
                    Else - Actions
                        Set Temp_Point_A = (Random point in Evil Arena <gen>)
                        Unit - Move (Picked unit) instantly to Temp_Point_A
                        Custom script:   call RemoveLocation (udg_Temp_Point_A)
        Custom script:   call DestroyGroup (udg_Temp_Unit_Group)

-Should work. :p
 
General chit-chat
Help Users

      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