Hi, Im currently working on a 2vs2 hero arena map and I need some help with triggers, specifically I need triggers that when one of the team loses(their heroes die) the other teams wins the match and they get the victory screen and the team who lost gets the defeat screen, does anyone know how to do this:P?
Create a new variable of type "Unit" and make it an array. When the heros are created you store them in the array for the according player number. You might want to read some tutorials about basic triggering first.
thanks daara87, if its not too much to ask:P could anyone make a map where they make the triggers and variables and stuff and then maybe upload it here on the website so I could download it and take a look myself because its a lot easier for me to understand what you guys mean that way hehe:P
oh okay, but its like it doesnt know that both players has to be dead before displaying the message, it displays the message when i just kill one of the players, I want it to display only when both players are dead
I think you can also add both of the heroes to a group (Hero_1, Hero_2 into the group variable HeroTeam1), when a unit dies, use a condition to check wether HeroTeam1/2 is empty or not.
@Wampsie: Go That's strange, it works for me and it also should for you. The units aren't spawning to close to each other so they could kill each other? If so, change them to something that cannot attack.
well I alrdy have a hero picker and it creates a hero for me when I choose one of the heroes on the hero picker so I tried to use ur triggers with my hero picker so maybe thats why its not working:P hehe
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Hi, Im currently working on a 2vs2 hero arena map and I need some help with triggers, specifically I need triggers that when one of the team loses(their heroes die) the other teams wins the match and they get the victory screen and the team who lost gets the defeat screen, does anyone know how to do this:P?
Store the heroes in a unit variabable and when a hero dies, check all unit variables to see if there dead.
@Exaken: Go
thanks for the reply=), the problem is that im rly new to triggers and stuff so I dont rly know how to store units in variables and stuff like that:P
@Wampsie: Go
Create a new variable of type "Unit" and make it an array. When the heros are created you store them in the array for the according player number. You might want to read some tutorials about basic triggering first.
Try this tutorial: beginners-guide-to-triggers-variables-arrays-constants
thanks guys=)
@Wampsie: Go
Create a Unit Variable with an Array Index of 4.
In your trigger that creates hero adds this after it creates units for each player.
Depending on how you create heroes you can do it multiple ways. If you create all at once then you can do this.
Set Variable - Hero Variable[picked player] = last created unit.
If you do it individually you can do it this way.
Set Variable - Hero Variable[0] = last created unit.
Set Variable - Hero Variable[1] = last created unit.
Set Variable - Hero Variable[2] = last created unit.
Set Variable - Hero Variable[3] = last created unit.
Then to check if a team is dead just check if 0 and 1 are dead, or if 2 and 3 are dead.
thanks daara87, if its not too much to ask:P could anyone make a map where they make the triggers and variables and stuff and then maybe upload it here on the website so I could download it and take a look myself because its a lot easier for me to understand what you guys mean that way hehe:P
Here you go. Some debug commands are: showmap and deathunit.
wow thanks a lot m8=)
edit: hmm strange, now when I kill player 3 it says I have killed all heroes on team 2?
That could be because there is no unit stored in index 4 yet, meaning it's not dead nor alive.
oh okay, but its like it doesnt know that both players has to be dead before displaying the message, it displays the message when i just kill one of the players, I want it to display only when both players are dead
I think you uploaded the same map m8 there isnt anything different with the other map, atleast what I can see:D
Doh><.
thanks=) unfortunately tho it didnt work for some reason, the message shows up even if I only kill one of the players on the other team:P
I think you can also add both of the heroes to a group (Hero_1, Hero_2 into the group variable HeroTeam1), when a unit dies, use a condition to check wether HeroTeam1/2 is empty or not.
@Wampsie: Go That's strange, it works for me and it also should for you. The units aren't spawning to close to each other so they could kill each other? If so, change them to something that cannot attack.
well I alrdy have a hero picker and it creates a hero for me when I choose one of the heroes on the hero picker so I tried to use ur triggers with my hero picker so maybe thats why its not working:P hehe