• 🏆 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!

PVP

Status
Not open for further replies.
Level 6
Joined
Oct 25, 2018
Messages
108
I'm putting together a kind of battle royal where every now and then the heroes of the players in an arena face each other. How can I graph in a trigger that when they fight in the arena with each other (4 Players) Hero 1, Hero 2, Hero 3, Hero 4, when they die they appear in a cemetery (the unit revives instantly there) and the last unit stands about the region of the arena be the winner awarding 1000 golds? I want to emphasize that the player does not lose when his hero dies, and his hero respawneara in another area, called cemetery.
 
Level 4
Joined
Jan 18, 2019
Messages
71
You need to first define your hero’s as variables, so when a hero is chosen and created do this in a trigger:

Event: A unit enters region *. * being the region that selects a hero

Condition: triggering unit equal to=

Owning player of triggering unit equal to=

Action: set (unit variable) to last created unit

You need to have his happen for each hero.

Then in another trigger set up:

Event: a unit dies

Condition: dying unit equal to (unit variable)

Action:

Pan camera to (cemetery camera)

Display game message to (owner of dying unit): your hero has dies but is awaiting spawn in the cemetery.
 
Level 6
Joined
Oct 25, 2018
Messages
108
but that only makes my hero go directly to the cemetery after he dies. I already have this configured, what I do not have is that the event ends with having a single hero in X Region standing, giving a reward to the winning hero (the last one left in the arena, since the others will be sent to the cemetery region) and then end the event.
 
Level 4
Joined
Jan 18, 2019
Messages
71
Then you need to set one variable = to the # of hero’s competing in the arena.

Set another variable for (hero’s that died) equal to 0 and when a hero dies set increase that variable by +1. When your first variable (the # competing in the arena) is equal to (# of dead + 1), then you can run secondary “if then and else” actions to check each hero variable to determine which is alive or dead. I recommend having it checked each time a hero dies.


To give the rewards to single hero, you must have the check-hero-death trigger check which hero is alive.

To do this, you need to check each hero integer. When they die, set a separate integer variable to 0. For each hero death, do this.

Then in the check-hero-death trigger, do the condition “and” where your condition must have all zero integers and one 1 integer. You’ll have to do this for each hero, where their possibility of winning exists.
 
Last edited:
Status
Not open for further replies.
Top