• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Battle Royal. Help!

Status
Not open for further replies.
Level 6
Joined
Oct 25, 2018
Messages
108
Hi, I'm creating a sand map where every four minutes the four players (it's a small map for four people) will face their heroes in a battle royal. How can I develop a trigger that when only one of the Heroes remains in the arena alive ends in event? Each hero is with its unit type variable (Hero1, Hero 2, Hero 3, Hero 4)
 
Level 5
Joined
Apr 7, 2018
Messages
69
  • Melee Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set heroes = 4
  • Trggrr
    • Events
      • Unit - A unit Dies
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Triggering unit) Equal to Hero1
          • (Triggering unit) Equal to Hero2
          • (Triggering unit) Equal to Hero3
          • (Triggering unit) Equal to Hero4
    • Actions
      • Set heroes = (heroes - 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • heroes Equal to 1
        • Then - Actions
          • Set heroes = 4
          • -------- Do Stuff --------
        • Else - Actions
 
Level 6
Joined
Oct 25, 2018
Messages
108
:O thank you. What kind of variable is heroes (where it says heroes = 4)
  • Melee Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set heroes = 4
  • Trggrr
    • Events
      • Unit - A unit Dies
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Triggering unit) Equal to Hero1
          • (Triggering unit) Equal to Hero2
          • (Triggering unit) Equal to Hero3
          • (Triggering unit) Equal to Hero4
    • Actions
      • Set heroes = (heroes - 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • heroes Equal to 1
        • Then - Actions
          • Set heroes = 4
          • -------- Do Stuff --------
        • Else - Actions
 
Level 6
Joined
Oct 25, 2018
Messages
108
  • Melee Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set heroes = 4
  • Trggrr
    • Events
      • Unit - A unit Dies
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Triggering unit) Equal to Hero1
          • (Triggering unit) Equal to Hero2
          • (Triggering unit) Equal to Hero3
          • (Triggering unit) Equal to Hero4
    • Actions
      • Set heroes = (heroes - 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • heroes Equal to 1
        • Then - Actions
          • Set heroes = 4
          • -------- Do Stuff --------
        • Else - Actions
Hi. I wanted to tell you that the trigger you gave me worked! thank you. By the way, how can I give a reward (gold) to the player who won that battleroyal?
 
Level 5
Joined
Apr 7, 2018
Messages
69
  • If ((Hero1 is alive) Equal to True) then do (Set Winner = Hero1) else do (Do nothing)
  • If ((Hero2 is alive) Equal to True) then do (Set Winner = Hero2) else do (Do nothing)
  • If ((Hero3 is alive) Equal to True) then do (Set Winner = Hero3) else do (Do nothing)
  • If ((Hero4 is alive) Equal to True) then do (Set Winner = Hero4) else do (Do nothing)
  • Player - Add 1000 to (Owner of Winner) Current gold
 
Level 6
Joined
Oct 25, 2018
Messages
108
  • Melee Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set heroes = 4
  • Trggrr
    • Events
      • Unit - A unit Dies
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Triggering unit) Equal to Hero1
          • (Triggering unit) Equal to Hero2
          • (Triggering unit) Equal to Hero3
          • (Triggering unit) Equal to Hero4
    • Actions
      • Set heroes = (heroes - 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • heroes Equal to 1
        • Then - Actions
          • Set heroes = 4
          • -------- Do Stuff --------
        • Else - Actions

I discovered a problem with this trigger ... it happens that if there are 4 players the trigger starts well because heroes = 4 and each time one dies, 1 is subtracted. But if I start a game with 3 players or 2, they do not complete the result of the subtraction that has to be 1. I would stay in 2 or 3 ... so the trigger does not run there ... I just passed in a test with 3 people. How I correct it
 
Level 5
Joined
Apr 7, 2018
Messages
69
  • Players
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players controlled by a User player) and do (Actions)
        • Loop - Actions
          • Set Players_in_game = (Players_in_game + 1)
    • Set heroes = Players_in_game
  • Leaves
    • Events
      • Player - Player 1 (Red) leaves the game
      • Player - Player 2 (Blue) leaves the game
      • Player - Player 3 (Teal) leaves the game
      • Player - Player 4 (Purple) leaves the game
    • Conditions
    • Actions
      • Set Players_in_game = (Players_in_game - 1)
      • If ((Triggering player) Equal to Player 1 (Red)) then do (Unit - Kill Hero1) else do (Do nothing)
      • If ((Triggering player) Equal to Player 2 (Blue)) then do (Unit - Kill Hero2) else do (Do nothing)
      • If ((Triggering player) Equal to Player 3 (Teal)) then do (Unit - Kill Hero3) else do (Do nothing)
      • If ((Triggering player) Equal to Player 4 (Purple)) then do (Unit - Kill Hero4) else do (Do nothing)
and dont forget to replace "Set heroes = 4" with "Set heroes = Players_in_game"

Let me know if it works without problems
 
Level 6
Joined
Oct 25, 2018
Messages
108
  • Players
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players controlled by a User player) and do (Actions)
        • Loop - Actions
          • Set Players_in_game = (Players_in_game + 1)
    • Set heroes = Players_in_game
  • Leaves
    • Events
      • Player - Player 1 (Red) leaves the game
      • Player - Player 2 (Blue) leaves the game
      • Player - Player 3 (Teal) leaves the game
      • Player - Player 4 (Purple) leaves the game
    • Conditions
    • Actions
      • Set Players_in_game = (Players_in_game - 1)
      • If ((Triggering player) Equal to Player 1 (Red)) then do (Unit - Kill Hero1) else do (Do nothing)
      • If ((Triggering player) Equal to Player 2 (Blue)) then do (Unit - Kill Hero2) else do (Do nothing)
      • If ((Triggering player) Equal to Player 3 (Teal)) then do (Unit - Kill Hero3) else do (Do nothing)
      • If ((Triggering player) Equal to Player 4 (Purple)) then do (Unit - Kill Hero4) else do (Do nothing)
and dont forget to replace "Set heroes = 4" with "Set heroes = Players_in_game"

Let me know if it works without problems
It did not work It happens that after the battleroyal, the heroes do not really leave the game but revive immediately in another region that acts as a cemetery. I would like to make a trigger that starts the battle royal, another that when that unit dies (or leaves the arena of combat) appears in the cemetery and that the winner (last unit standing in the arena) is awarded 1000 gold .. but it does not work the way it appears there
 
Level 6
Joined
Oct 25, 2018
Messages
108
I am not sure what is wrong, did that gold part worked? Did you implemented it correctly?
the error is that you have put as event Player 1 leaves the Game, Player 2 leaves the Game ... etc. when the battle royal is a periodic event and the Player who leaves the arena does not lose the game, his hero revives in the cemetery region to wait for the next battle royal time. In itself when the hero dies in the sand leaves the region, does not really die (Revive instantaneously in the cemetery) but I do not know how to place the event that when only 1 Hero is in the Arena is the winner, and he is given the prize
 
Level 6
Joined
Oct 25, 2018
Messages
108
Make heroes respawn at same time after it ends or check for hero in area at the end.

But what is the event that I must do so that when the hero is the last to stay in the area, be the winner? Taking into account that I can not put Number of Units in Region = 1, since it is probable that he finds invocations of other players or of the same hero in the area (Feral Spirits, Water Elementals, etc ...) and that when he wins Give him 1,000 golds. I can not think of how to put all that in a trigger ... At first I thought about adding Hero 1, Hero 2, Hero 3 and Hero 4 to the unit group "Heroes Group", where Heroes Group = Number of units in the "Battle Royal" region, then when Hero 1, Hero 2, Hero 3 or Hero 4 die, transport to region "Cemetery" and the last unit standing in Battle Royal would be the winner. Event: Unit enters region "Cemetery" - Condition - Number of units in "Group of Heroes = 1" (remembering which group of heroes contains the four heroes within the battle royal region) Action: Add 1000 gold to the owner of Winner unit (winner of the event, variant that you advised me to use) But it does not help when I put it that way.

Pero cual es el evento que debo hacer para que cuando el heroe sea el ultimo en quedar en el area, sea el vencedor? Tomando en cuenta de que no puedo poner Number of Units in Region = 1, ya que es probable que halla invocaciones de otros jugadores o del mismo heroe en el area (Feral Spirits, Water Elementals, etc...) y que al vencer se le otorguen 1000 oros. No se me ocurre como colocar todo eso en un trigger... Al principio pense en agregar Heroe 1, Heroe 2, Heroe 3 y Heroe 4 al grupo de unidades "Grupo de Heroes", donde Grupo de Heroes= Numero de unidades en la region de "Battle Royal", entonces cuando muere Heroe 1, Heroe 2, Heroe 3 o Heroe 4, transportar a region "Cementerio" y la ultima unidad en pie en Battle Royal seria el vencedor. Evento: Unidad entra en region "Cementerio" - Condicion - Numero de unidades en "Grupo de Heroes =1" (recordando que grupo de heroes contiene a los cuatro heroes dentro de la region battle royal) Accion: Agregar 1000 de oro al propietario de unidad Winner (vencedor del evento, variante que me aconsejaste usar) Pero no me sirve cuando lo coloco de esa manera.
 
Level 6
Joined
Oct 25, 2018
Messages
108
Arena = Region where the Battle Royal is generated Cemetery = Region where spawnean the fallen heroes

I thought that would work like that but it does not work either ... since there are bugs that are invocations that are still on the map that if they are when the last hero is killed they do not generate the event ... and I can not restrict the use of those invocations in sand since they are a main part of the confrontation.

  • INICIO
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set HeroeP1U = Paladin 0032 <gen>
      • Set HeroeP2U = Archmage 0034 <gen>
      • Set HeroeP3U = Mountain King 0035 <gen>
      • Set HeroeP4U = Blood Mage 0036 <gen>
      • Unit Group - Add HeroeP1U to GrupoHeroes
      • Unit Group - Add HeroeP2U to GrupoHeroes
      • Unit Group - Add HeroeP3U to GrupoHeroes
      • Unit Group - Add HeroeP4U to GrupoHeroes
      • Set GrupoHeroes = (Units in Arena <gen>)
  • Muertes Battle Royal 1
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Hero - Instantly revive (Dying unit) at (Center of Cementerio <gen>), Hide revival graphics
      • Unit - Make (Dying unit) Invulnerable
  • Cementerio P1
    • Events
      • Unit - A unit enters Cementerio <gen>
    • Conditions
      • (Entering unit) Equal to HeroeP1U
    • Actions
      • Unit Group - Pick every unit in (Units in Arena <gen> owned by (Owner of HeroeP1U)) and do (Unit - Remove (Triggering unit) from the game)
  • Cementerio P2
    • Events
      • Unit - A unit enters Cementerio <gen>
    • Conditions
      • (Entering unit) Equal to HeroeP2U
    • Actions
      • Unit Group - Pick every unit in (Units in Arena <gen> owned by (Owner of HeroeP2U)) and do (Unit - Remove (Triggering unit) from the game)
  • Cementerio P3
    • Events
      • Unit - A unit enters Cementerio <gen>
    • Conditions
      • (Entering unit) Equal to HeroeP3U
    • Actions
      • Unit Group - Pick every unit in (Units in Arena <gen> owned by (Owner of HeroeP3U)) and do (Unit - Remove (Triggering unit) from the game)
  • Cementerio P4
    • Events
      • Unit - A unit enters Cementerio <gen>
    • Conditions
      • (Entering unit) Equal to HeroeP4U
    • Actions
      • Unit Group - Pick every unit in (Units in Arena <gen> owned by (Owner of HeroeP4U)) and do (Unit - Remove (Triggering unit) from the game)
  • Final Battle Royal 1
    • Events
      • Unit - A unit enters Cementerio <gen>
    • Conditions
      • (Number of units in GrupoHeroes) Equal to 1
    • Actions
      • Game - Display to (All players) the text: El primer encuentro...
      • If ((Arena <gen> contains HeroeP1U) Equal to True) then do (Set HeroeP1U = Winner) else do (Do nothing)
      • If ((Arena <gen> contains HeroeP2U) Equal to True) then do (Set HeroeP2U = Winner) else do (Do nothing)
      • If ((Arena <gen> contains HeroeP3U) Equal to True) then do (Set HeroeP3U = Winner) else do (Do nothing)
      • If ((Arena <gen> contains HeroeP4U) Equal to True) then do (Set HeroeP4U = Winner) else do (Do nothing)
      • If ((Arena <gen> contains HeroeP5U) Equal to True) then do (Set HeroeP5U = Winner) else do (Do nothing)
      • If ((Arena <gen> contains HeroeP6U) Equal to True) then do (Set HeroeP6U = Winner) else do (Do nothing)
      • If ((Arena <gen> contains HeroeP7U) Equal to True) then do (Set HeroeP7U = Winner) else do (Do nothing)
      • If ((Arena <gen> contains HeroeP8U) Equal to True) then do (Set HeroeP8U = Winner) else do (Do nothing)
      • Player - Add 1000 to (Owner of Winner) Current gold
      • Game - Display to (All players) the text: (Name of (Owner of Winner))
      • Game - Display to (All players) the text: A sido el vencedor ...
      • Special Effect - Create a special effect attached to the origin of Winner using Units\NightElf\Wisp\WispExplode.mdl
      • Trigger - Turn off (This trigger)
      • Trigger - Turn off Muertes Battle Royal 1 <gen>
  • [trigger]
 
Status
Not open for further replies.
Top