• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] Arena

Status
Not open for further replies.
Level 4
Joined
Sep 23, 2010
Messages
90
I want to make arena, but i don't know how, there are 4 teams, 2 players per team minimum. And how can i make that when a team (1-4) wins the duel when opossite teams players are all dead? Thanks.
 
Level 11
Joined
Sep 12, 2008
Messages
657
its not really wrong..
hes original question was this:

how can i make that when a team (1-4) wins the duel when opossite teams players are all dead?

this is how:

  • Team Win
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Set BooleanArray[(Player number of (Triggering player))] = True
      • -------- Below this line there are Team 1 actions --------
      • For each (Integer A) from 1 to 4, do (Actions)
        • Loop - Actions
          • -------- change 1 - 4 to amount of players in team 1. --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • BooleanArray[(Integer A)] Equal to True
            • Then - Actions
              • Set Integer = (Integer + 1)
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integer Equal to 4
        • Then - Actions
          • -------- Team 2 won actions! --------
        • Else - Actions
      • -------- Below this line there are Team 2 actions --------
      • For each (Integer B) from 5 to 8, do (Actions)
        • Loop - Actions
          • -------- change 5 - 8 to amount of players in team 2. --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • BooleanArray[(Integer B)] Equal to True
            • Then - Actions
              • Set Integer = (Integer + 1)
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integer Equal to 4
        • Then - Actions
          • -------- Team 1 won actions! --------
        • Else - Actions
ofcourse that code is very simple.. and might not do w/e you need.. but still,
i guess its better then nothing.
 
Level 8
Joined
Apr 8, 2009
Messages
499
its not really wrong..
hes original question was this:

how can i make that when a team (1-4) wins the duel when opossite teams players are all dead?


lol, it actually is wrong, as it says in this sections guidelines. (Am i one of the few to read?)

and double posting is wrong too, although i guess it was a accidental one here.
 
Level 4
Joined
Sep 23, 2010
Messages
90
How did you make set booleanArray[(........ = true? and others with boolean? i haven't used these kind of triggers you use.
 
Level 11
Joined
Sep 12, 2008
Messages
657
oh dam.. my inet is kind of.. erroring lately, so i press sumbit button twice, and i guess i should stop now >_> (1 time, then refresh, and another.. lol)

anyways, press ctrl + b inside the trigger editor.
and press the green button call it any name you want,
go thru the list untill you find boolean (its arranged by a-b-c)
and check the array box below, and press okay.
then you got you'r self a variable you can use in coding.

edit: lol if you meant the IntegerB in the editor its:
For loop integer A.
For loop integer B.
 
Level 11
Joined
Sep 12, 2008
Messages
657
hmm.. not so much.. but ill give it a try..

basicly, if a unit dies,
it sets the boolean(player number of the owner of the dying unit)
to true,
then if all players 1 - 4(red, blue, teal, purple) are dead aswell,
it will say that team 2 won,

but if all players 5 - 8 (yellow, orange, green, pink) are dead,
it will say team 1 won.

just edit where the comments are.

-------- Team 2 won actions! --------
below that put the actions of what happends when team 2 wins

-------- Team 1 won actions! --------
and below that put the actions of what happends when team 1 wins.

you can go to tutorials section and look for variables tutorial.
im sure there are plenty of those..
 
Level 4
Joined
Sep 23, 2010
Messages
90
oh, but i need 4 diferent teams, and this is only 2 teams, i have made that if team 4 or team 3 for example is not playing then it doesnt need to count them as alive...next, at start teams have variables and it is 0, when arena starts, teams gets variables per player, so if hero dies when arena variable is 1, dying hero's team variable looses 1 point if all exept team 1 points are 0 than team 1 wins, and i made 4 different pages of different team winnings, but it doesnt work somehow...
 
Level 4
Joined
Sep 23, 2010
Messages
90
Here it is:
  • Arena
    • Events
      • Unit - A unit Dies
    • Conditions
      • ArenaTime Equal to 1
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Team2AP Equal to 0
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Team3AP Equal to 0
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Team4AP Equal to 0
                • Then - Actions
                  • Set Team1Win = 1
                • Else - Actions
            • Else - Actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Team1Win Equal to 1
        • Then - Actions
          • Game - Display to (All players) the text: Team 1 wins the Are...
        • Else - Actions
So what could be wrong?
 
Last edited:
Level 11
Joined
Sep 12, 2008
Messages
657
what is "Arena Time"?
why do you do it when a unit dies?
why do you do so much if then else? =[
theres the "and" condition..
(if X = true and Y = true and Z = true) then do actions
..
just use it instead of massive loop.. it could make it all in 1 code if you do so..
 
Level 4
Joined
Sep 23, 2010
Messages
90
Arena Time is var. which is equal 1 when arena timer ends, because my map is survival and heroes can die when monsters kill them, and when should i do the actions then? :p
 
Level 4
Joined
Sep 23, 2010
Messages
90
I think i fixed it myself :) Your triggers haven't worked like i wanted, but made my work easier and faster to make, thanks for the help :)
 
Status
Not open for further replies.
Top