Take a look at my arena system (complex)

Happy

Well-Known Member
Reaction score
71
Hey guys...

i need your help :D

i made an arena system for my map which should do the following :

-when the arena timer expires pause all units and make them invurnable
-choose one of 3 types of arena fighting
-move the heroes to the arena
-let them fight
-checking whether heroes/units die
-if all teams are finished or in arena type 3 one team of heroes died it should show a message and port every hero back and unpause all units and and make them invurnable again


here the triggers making problems:

Trigger:
  • arena creeps check
    • Events
      • Time - ArenaTimer expires
    • Conditions
      • Arena_Boolean Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Conditions
          • Arena_IntegerType Equal to 1
        • 'THEN'-Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • 'IF'-Conditions
              • (Arena_Heroes[1] is dead) Equal to True
            • 'THEN'-Actions
              • Set hero_died[1] = Arena_Heroes[1]
              • Set heaven_done = True
              • Spiel - Display to (All players) the text: Heaven's Hero died....
              • Set TempGroup = (Units in edge L <gen>)
              • Unit Group - Pick every unit in TempGroup and do (Actions)
                • Loop - Actions
                  • Unit - Remove (Picked unit) from the game
              • Custom script: call DestroyGroup(udg_TempGroup)
            • 'ELSE'-Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • 'IF'-Conditions
                  • heaven_done Equal to True
                • 'THEN'-Actions
                • 'ELSE'-Actions
                  • Set arena_heaven = edge L <gen>
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • 'IF'-Conditions
                      • (Number of units in (Units in arena_heaven owned by Neutral Hostile)) Greater than/Equal to 1
                    • 'THEN'-Actions
                      • Custom script: call RemoveRect (udg_arena_heaven)
                    • 'ELSE'-Actions
                      • Set heaven_done = True
                      • Game - Display to (All players) the text: Heaven finished all...
                      • Custom script: call RemoveRect (udg_arena_heaven)
                      • Game - Display to (All players) the text: (Each Player of Team Heaven got |cffFFC125 + ((String((500 x Creep_Number))) + |r Gold.))
                      • Player Group - Pick every player in (All allies of Spieler 1 (Rot)) and do (Actions)
                        • Loop - Actions
                          • Player - Add (500 x Creep_Number) to (Picked player) Gold
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • 'IF'-Conditions
              • (Arena_Heroes[2] is dead) Equal to True
            • 'THEN'-Actions
              • Set hero_died[2] = Arena_Heroes[2]
              • Set hell_done = True
              • Game - Display to (All players) the text: Hell's Hero died......
              • Set TempGroup = (Units in edge R <gen>)
              • Unit Group - Pick every unit in TempGroup and do (Actions)
                • Loop - Actions
                  • Unit - Remove (Picked unit) from the game
              • Custom script: call DestroyGroup(udg_TempGroup)
            • 'ELSE'-Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • 'IF'-Conditions
                  • hell_done Equal to True
                • 'THEN'-Actions
                • 'ELSE'-Actions
                  • Set arena_hell = edge R <gen>
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • 'IF'-Conditions
                      • (Number of units in (Units in arena_hell owned by Neutral Hostile)) Greater than/Equal to 1
                    • 'THEN'-Actions
                      • Custom script: call RemoveRect (udg_arena_hell)
                    • 'ELSE'-Actions
                      • Set hell_done = True
                      • Game - Display to (All players) the text: Hell finished all t...
                      • Custom script: call RemoveRect (udg_arena_hell)
                      • Game - Display to (All players) the text: (Each Player of Team Hell got |cffFFC125 + ((String((500 x Creep_Number))) + |r Gold.))
                      • Player Group - Pick every player in (All allies of Spieler 7 (Green)) and do (Actions)
                        • Loop - Actions
                          • Player - Add (500 x Creep_Number) to (Picked player) Gold
        • 'ELSE'-Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • 'IF'-Conditions
              • Arena_IntegerType Equal to 2
            • 'THEN'-Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • 'IF'-Conditions
                  • (Arena_Heroes[1] is dead) Equal to True
                • 'THEN'-Actions
                  • Set Arena_IntegerType2 = 1
                  • Set hero_died[Arena_IntegerType2] = Arena_Heroes[1]
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • 'IF'-Conditions
                      • (Arena_Heroes[2] is dead) Equal to True
                    • 'THEN'-Actions
                      • Set Arena_IntegerType2 = 2
                      • Set hero_died[Arena_IntegerType2] = Arena_Heroes[2]
                    • 'ELSE'-Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • 'IF'-Conditions
                      • Arena_IntegerType2 Equal to 1
                    • 'THEN'-Actions
                      • Game - Display to (All players) the text: A Hero of Team Heav...
                    • 'ELSE'-Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • 'IF'-Conditions
                          • Arena_IntegerType2 Equal to 2
                        • 'THEN'-Actions
                          • Game - Display to (All players) the text: Another Hero of Tea...
                          • Set heaven_done = True
                          • Set TempGroup = (Units in CreepsArenaHeavenTotal <gen>)
                          • Unit Group - Pick every unit in TempGroup and do (Actions)
                            • Loop - Actions
                              • Unit - Remove (Picked unit) from the game
                          • Custom script: call DestroyGroup(udg_TempGroup)
                        • 'ELSE'-Actions
                • 'ELSE'-Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • 'IF'-Conditions
                      • heaven_done Equal to True
                    • 'THEN'-Actions
                    • 'ELSE'-Actions
                      • Set arena_heaven = CreepsArenaHeavenTotal <gen>
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • 'IF'-Conditions
                          • (Number of units in (Units in arena_heaven owned by Neutral Hostile)) Greater than/Equal to 1
                        • 'THEN'-Actions
                          • Custom script: call RemoveRect (udg_arena_heaven)
                        • 'ELSE'-Actions
                          • Set heaven_done = True
                          • Game - Display to (All players) the text: Team Heaven finishe...
                          • Custom script: call RemoveRect (udg_arena_heaven)
                          • Game - Display to (All players) the text: (Each Player of Team Heaven got |cffFFC125 + ((String((250 x Creep_Number))) + |r Gold.))
                          • Player Group - Pick every player in (All allies of Spieler 1 (Red)) and do (Actions)
                            • Loop - Actions
                              • Player - Add (250 x Creep_Number) to (Picked player) Gold
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • 'IF'-Conditions
                  • (Arena_Heroes[3] is dead) Equal to True
                • 'THEN'-Actions
                  • Set Arena_IntegerType3 = 1
                  • Set hero_died[Arena_IntegerType3] = Arena_Heroes[3]
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • 'IF'-Conditions
                      • (Arena_Heroes[4] is dead) Equal to True
                    • 'THEN'-Actions
                      • Set Arena_IntegerType3 = 2
                      • Set hero_died[Arena_IntegerType3] = Arena_Heroes[4]
                    • 'ELSE'-Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • 'IF'-Conditions
                      • Arena_IntegerType3 Equal to 1
                    • 'THEN'-Actions
                      • Game - Display to (All players) the text: A Hero of Team Hell...
                    • 'ELSE'-Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • 'IF'-Conditions
                          • Arena_IntegerType3 Equal to 2
                        • 'THEN'-Actions
                          • Game - Display to (All players) the text: Another Hero of Tea...
                          • Set hell_done = True
                          • Set TempGroup = (Units in CreepsArenaHellTotal <gen>)
                          • Unit Group - Pick every unit in TempGroup and do (Actions)
                            • Loop - Actions
                              • Unit - Kill (Picked unit)
                          • Custom script: call DestroyGroup(udg_TempGroup)
                        • 'ELSE'-Actions
                • 'ELSE'-Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • 'IF'-Conditions
                      • hell_done Equal to True
                    • 'THEN'-Actions
                    • 'ELSE'-Actions
                      • Set arena_hell = CreepsArenaHellTotal <gen>
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • 'IF'-Conditions
                          • (Number of units in (Units in arena_hell owned by Neutral Hostile)) Greater than/Equal to 1
                        • 'THEN'-Actions
                          • Custom script: call RemoveRect (udg_arena_hell)
                        • 'ELSE'-Actions
                          • Set hell_done = True
                          • Game - Display to (All players) the text: Team Hell finished ...
                          • Custom script: call RemoveRect (udg_arena_hell)
                          • Game - Display to (All players) the text: (Each Player of Team Hell got |cffFFC125 + ((String((500 x Creep_Number))) + |r Gold.))
                          • Player Group - Pick every player in (All allies of Spieler 7 (Green)) and do (Actions)
                            • Loop - Actions
                              • Player - Add (500 x Creep_Number) to (Picked player) Gold
            • 'ELSE'-Actions
              • For each (Integer A) from 1 to Arena_HeroesFight, do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • 'IF'-Conditions
                      • (Arena_Heroes[(Integer A)] is dead) Equal to True
                    • 'THEN'-Actions
                      • Set hero_died[(Integer A)] = Arena_Heroes[(Integer A)]
                      • Game - Display to (All players) the text: A Hero of Team Heav...
                      • Unit Group - Remove Arena_Heroes[(Integer A)] from ArenaHeroFightsGroup[1]
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • 'IF'-Conditions
                          • (Number of units in ArenaHeroFightsGroup[1]) Greater than/Equal to Arena_HeroesFight
                        • 'THEN'-Actions
                        • 'ELSE'-Actions
                          • Unit Group - Remove all units from ArenaHeroFightsGroup[1]
                          • Unit Group - Remove all units from ArenaHeroFightsGroup[2]
                          • Set heaven_done = True
                          • Set hell_done = True
                          • Game - Display to (All players) the text: Team Hell won the d...
                          • Game - Display to (All players) the text: (Each Player of Team Hell got |cffFFC125 + ((String((1000 x Creep_Number))) + |r Gold.))
                          • Player Group - Pick every player in (All allies of Spieler 7 (Green)) and do (Actions)
                            • Loop - Actions
                              • Player - Add (1000 x Creep_Number) to (Picked player) Gold
                    • 'ELSE'-Actions
              • For each (Integer A) from (Arena_HeroesFight + 1) to (Arena_HeroesFight x 2), do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • 'IF'-Conditions
                      • (Arena_Heroes[(Integer A)] is dead) Equal to True
                    • 'THEN'-Actions
                      • Set hero_died[(Integer A)] = Arena_Heroes[(Integer A)]
                      • Game - Display to (All players) the text: A Hero of Team Hell...
                      • Unit Group - Remove Arena_Heroes[(Integer A)] from ArenaHeroFightsGroup[2]
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • 'IF'-Conditions
                          • (Number of units in ArenaHeroFightsGroup[2]) Greater than/Equal to Arena_HeroesFight
                        • 'THEN'-Actions
                        • 'ELSE'-Actions
                          • Unit Group - Remove all units from ArenaHeroFightsGroup[1]
                          • Unit Group - Remove all units from ArenaHeroFightsGroup[2]
                          • Set heaven_done = True
                          • Set hell_done = True
                          • Game - Display to (All players) the text: Team Heaven won the...
                          • Game - Display to (All players) the text: (Each Player of Team Heaven got |cffFFC125 + ((String((1000 x Creep_Number))) + |r Gold.))
                          • Player Group - Pick every player in (All allies of Spieler 1 (Red)) and do (Actions)
                            • Loop - Actions
                              • Player - Add (1000 x Creep_Number) to (Picked player) Gold
                    • 'ELSE'-Actions


Trigger:
  • finished
    • Events
      • Time - CreepsArena_Timer expires
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Conditions
          • And - All (Conditions) are true
            • Conditions
              • heaven_done Equal to True
              • hell_done Equal to True
        • 'THEN'-Actions
          • Trigger - Turn on arena trigger <gen>
          • Trigger - Turn on revival <gen>
          • Trigger - Run port back and unpause <gen> (ignoring conditions)
          • Set Arena_Boolean = False
        • 'ELSE'-Actions
          • Countdown-Timer - Start CreepsArena_Timer as a One-Shot timer that will expire in 0.10 seconds
          • Countdown-Timer - Start ArenaTimer as a One-Shot timer that will expire in 0.10 seconds


Trigger:
  • port back and unpause
    • Events
    • Conditions
    • Actions
      • Set Temp_Group = (Units in (Entire map))
      • Unit Group - Pick every unit in Temp_Group and do (Actions)
        • Loop - Actions
          • Unit - Unpause (Picked unit)
          • Unit - Make (Picked unit) Vurnable
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • Unit Group - Pick every unit in Temp_Group and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • 'IF'-Conditions
                  • (Picked unit) Equal to Arena_Heroes[(Integer A)]
                • 'THEN'-Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • 'IF'-Conditions
                      • (Arena_Heroes[(Integer A)] is dead) Equal to True
                    • 'THEN'-Actions
                      • Set Temp_Point = (Center of item fuse over rank 2 til rank 4 <gen>)
                      • Hero - Instantly revive Arena_Heroes[(Integer A)] at Temp_Point, Hide revival graphics
                      • Custom script: call RemoveLocation (udg_Temp_Point)
                    • 'ELSE'-Actions
                  • Unit - Move (Picked unit) instantly to player_positions[(Player number of (Owner of (Picked unit)))]
                  • Set Arena_Heroes[(Integer A)] = No Unit
                • 'ELSE'-Actions
      • Set heaven_done = False
      • Set hell_done = False
      • Custom script: call DestroyGroup (udg_Temp_Group)
      • Countdown-Timer - Start arena_timer as a One-Shot timer that will expire in 600.00 seconds
      • Countdown-Timer - Create a timer window for (Last started timer) with title Arena starts in...
      • Set timer_window = (Last created timer window)
      • Trigger - Turn off arena creeps check <gen>
      • Trigger - Turn off (This trigger)

so the problems are:

-the triggers do not see whether the fights are over
-all the stuff that should happen after that does not happen (porting back, giving gold etc)


hope someone can help me :D

thanks in advance

greetz happy
 

elpini0

New Member
Reaction score
1
ok listen... I think you messed up a little bit your triggers... I didn't read through the whole thing, but just to start with, i found this error:

Trigger:
  • arena creeps check
    • Events
      • Time - ArenaTimer expires
    • Conditions
      • Arena_Boolean Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • IF - Conditions
          • if Arena_IntegerType Equal to 1
        • THEN - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • IF - Conditions
              • if (Arena_Heroes[1] is dead) Equal to True
            • THEN - Actions
              • Set hero_died[1] = Arena_Heroes[1]
              • Set heaven_done = True
              • Game - Display to (All players) the text: Heaven's Hero died....
              • Set TempGroup = (Units in edge L <gen>)
              • Unit Group - Pick every unit in TempGroup and do (Actions)
                • Loop - Actions
                  • Unit - Remove (Picked unit) from the game
              • Custom script: call DestroyGroup(udg_TempGroup)
            • ELSE - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • IF - Conditions
                  • if heaven_done Equal to True
                • THEN - Actions
                • ELSE - Actions
                  • Set arena_heaven = edge L <gen>
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • IF - Conditions
                      • if (Number of units in (Units in arena_heaven owned by Neutral Hostile)) Greater than/Equal to 1
                    • THEN -Actions
                      • Custom script: call RemoveRect (udg_arena_heaven)
                    • ELSE -Actions
                      • Set heaven_done = True
                      • Game - Display to (All players) the text: Heaven finished all...
                      • Custom script: call RemoveRect (udg_arena_heaven)
                      • Game - Display to (All players) the text: (Each Player of Team Heaven got |cffFFC125 + ((String((500 x Creep_Number))) + |r Gold.))
                      • Player Group - Pick every player in (All allies of Spieler 1 (Rot)) and do (Actions)
                        • Loop - Actions
                          • Player - Add (500 x Creep_Number) to (Picked player) Gold


This is what happens...

When Arena_Timer expires, if Arena_Boolean is true, then:
*If ArenaIntegerType equals 1 then:(you didnt set ArenaIntegerType previously in this trigger...)
1) Check if Arena_Heroes[1] is dead:
.....if it is, then:
..........A)Set hero_died[1] = Arena_Heroes[1]
..........B)Set heaven_done = True <--- Check this out
..........C)Display to All players the text: Heaven's Hero died....
..........D)Remove all units in "edge"
.....if it is NOT, then: <----- This is what ELSE means
..........A)Check if heaven_done Equal to True <---- This is giving the problem
...............if it is, then:
....................*Do nothing
...............if it is NOT , then: <----- heaven_done will never be Equal to True (your fault).....
....................*Set arena_heaven = edge L <gen>
....................CHECK If (Number of units in (Units in arena_heaven owned by Neutral Hostile)) Greater than/Equal to 1.
.........................if it is, then
..............................Custom script: call RemoveRect (udg_arena_heaven)
.........................if it is NOT , then:
..............................Set heaven_done = True
..............................Game - Display to (All players) the text: Heaven finished all...
..............................Custom script: call RemoveRect (udg_arena_heaven)
..............................Display to (All players) the text: (Each Player of Team Heaven got |cffFFC125 + ((String((500 x Creep_Number))) + |r Gold.))
..............................Add (500 x Creep_Number) to All allies of Spieler 1 (Rot) Gold


I highly recommend that you write your trigger on paper with your own words, and try to think like the computer does. This trigger is very confusing, so try to put your ideas in order and then rewrite your trigger.

To make it clearer, i recommend that you use sub-triggers... This is, instead of writing what i did, use this:

Trigger:
  • arena creeps check
    • Events
      • Time - ArenaTimer expires
    • Conditions
      • Arena_Boolean Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • IF - Conditions
          • if Arena_IntegerType Equal to 1
        • THEN - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • IF - Conditions
              • if (Arena_Heroes[1] is dead) Equal to True
            • THEN - Actions
              • Trigger - Run ArenaDead &lt;gen&gt; (Checking conditions)
            • ELSE - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • IF - Conditions
                  • if heaven_done Equal to True
                • THEN - Actions
                • ELSE - Actions
                  • Run Subtrigger1


Trigger:
  • ArenaDead
    • Events
    • Conditions
    • Actions
      • Set hero_died[1] = Arena_Heroes[1]
      • Set heaven_done = True
      • Game - Display to (All players) the text: Heaven&#039;s Hero died....
      • Set TempGroup = (Units in edge L &lt;gen&gt;)
      • Unit Group - Pick every unit in TempGroup and do (Actions)
        • Loop - Actions
          • Unit - Remove (Picked unit) from the game
      • Custom script: call DestroyGroup(udg_TempGroup)


Trigger:
  • Subtrigger1
    • Events
    • Conditions
    • Actions
      • Set arena_heaven = edge L &lt;gen&gt;
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • IF - Conditions
        • if (Number of units in (Units in arena_heaven owned by Neutral Hostile)) Greater than/Equal to 1
      • THEN -Actions
        • Custom script: call RemoveRect (udg_arena_heaven)
      • ELSE -Actions
        • Set heaven_done = True
        • Game - Display to (All players) the text: Heaven finished all...
        • Custom script: call RemoveRect (udg_arena_heaven)
        • Game - Display to (All players) the text: (Each Player of Team Heaven got |cffFFC125 + ((String((500 x Creep_Number))) + |r Gold.))
        • Player Group - Pick every player in (All allies of Spieler 1 (Rot)) and do (Actions)
          • Loop - Actions
          • Player - Add (500 x Creep_Number) to (Picked player) Gold
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
you can use sub-triggers when first creating it, but when you are actually wrapping the map up pull the actions out to replace the Trigger - run Some Trigger <gen> because extra trigger calls means extra lag, but it is good to organize when you are still early in the map making process
 
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