Hey, I'm having trouble with this. I want it to be so, once a unit for Player 1 dies, Player 2 wins, but once a unit from Player 2 dies, Player 1 wins. And, at the beginning you have to pick your race, so once you pick it your hero spawns. How can I get it so once that hero dies, you lose. But if you kill the other ones first, you win. I can't figure out how to make the Trigger do that with a Spawn Unit.
Make a global variable (in the trigger list on the left) named "mainUnit" of type "unit" and make it an array of size 2. After you spawn each unit, set the mainUnit of that player to Last Created Unit.
mainUnit[0] = Unit that was created for player 1.
mainUnit[1] = Unit that was created for player 2.
If mainUnit[0] dies, player 2 wins
If mainUnit[1] dies, player 1 wins
Thank you, and will this make the two Heroes I spawn be the ones to activate this? It's hard to explain, but. . . Once your hero dies, you lost. But I can't set that with a Trigger because he is not on the map yet. If people get that. . . Thx. I think this will help though.
When you have no other unit dying on the map this trigger is already fine, if not vadremix is right and you will have to add a comparison using filter match or comparison for unit type of the units but then you would have to use an or in between.
Or you could add them to a global unit group asking in this trigger if the dying unit is in this unit group!
Ok, so this is based off of my map Melee - Survival Mode. The only one I can't figure out is the playergroupwinner = (Allies of Player Player) <Player Group> I can't figure out how to get the Highlighted.
Ok, so this is based off of my map Melee - Survival Mode. The only one I can't figure out is the playergroupwinner = (Allies of Player Player) <Player Group> I can't figure out how to get the Highlighted.
The function name is "Allies of Player". Make a local Player Group variable and set its default value to the said function.
No no no. I can't find either. I don't know how where to find it. I can't look in the Variables tab because it only shows player, not playergrouploser, or playergroupwinner.
You're trying to change the wrong one. You have to change (Active Players) in the line where it says "Pick each player in...." to your player group.
Just read it to yourself and it should make sense:
"I pick each player in my (player group) and then I do (some action) for each (picked player)"
What you were trying to do is this:
"I pick each player from my (active players) and then I do (some action) for each (player group)"
Now that sounds a little bit messed up, doesn't it?
GUI is always made to make sense in normal English.
I get what your saying, but when I try to change it, I can't find that Player Group anywhere. Not in Function, Preset, or Variable. I have no idea where it is. Or how to get to it. That's what I'm trying to say.
You could post the map so we can take a look at it... if it really isn't there then it's quite strange story.
Judging from that trigger pic everything is set-up OK.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Hey, I'm having trouble with this. I want it to be so, once a unit for Player 1 dies, Player 2 wins, but once a unit from Player 2 dies, Player 1 wins. And, at the beginning you have to pick your race, so once you pick it your hero spawns. How can I get it so once that hero dies, you lose. But if you kill the other ones first, you win. I can't figure out how to make the Trigger do that with a Spawn Unit.
Any help would be appreciated, Thx.
@WraithChaser: Go
Make a global variable (in the trigger list on the left) named "mainUnit" of type "unit" and make it an array of size 2. After you spawn each unit, set the mainUnit of that player to Last Created Unit.
mainUnit[0] = Unit that was created for player 1.
mainUnit[1] = Unit that was created for player 2.
If mainUnit[0] dies, player 2 wins
If mainUnit[1] dies, player 1 wins
@WraithChaser: Go
Events
Unit - Any Unit dies
Local Variables
player = (Owner of (Triggering unit)) <Integer>
playergroupwinner = (Allies of player player) <Player Group>
playergrouploser = (Enemies of player player) <Player Group>
Conditions
Actions
Player Group - Pick each player in playergrouploser and do (Actions)
Actions
Game - End game in Defeat for player (Picked player) (Show dialogs, Show score screen)
Player Group - Pick each player in playergroupwinner and do (Actions)
Actions
Game - End game in Victory for player (Picked player) (Show dialogs, Show score screen)
Someone make a picture, I don't get either of these. . .
@WraithChaser: Go
I hope it helps
Thank you, and will this make the two Heroes I spawn be the ones to activate this? It's hard to explain, but. . . Once your hero dies, you lost. But I can't set that with a Trigger because he is not on the map yet. If people get that. . . Thx. I think this will help though.
@WraithChaser: Go
Alright dude you need to make a condition, select 'Comparison' then Unit Filter Match = True. This is what it should look like:
((Triggering unit) is Required: Heroic; Excluded: Missile, Dead, Hidden for player x) == true
Make sure you give your heroes the 'Heroic' attribute or it won't work.
When you have no other unit dying on the map this trigger is already fine, if not vadremix is right and you will have to add a comparison using filter match or comparison for unit type of the units but then you would have to use an or in between. Or you could add them to a global unit group asking in this trigger if the dying unit is in this unit group!
Ok, so this is based off of my map Melee - Survival Mode. The only one I can't figure out is the playergroupwinner = (Allies of Player Player) <Player Group> I can't figure out how to get the Highlighted.
The function name is "Allies of Player". Make a local Player Group variable and set its default value to the said function.
Now I can't get the highlighted to show up in:
Player - Pick Each Player in playergrouploser and do (Actions)
Does anyone know?
@WraithChaser:
Same place you found playergroupwinner...
playergrouploser is a locally defined variable and you'll therefore find it in the variables section when selecting the player group for that action.
No no no. I can't find either. I don't know how where to find it. I can't look in the Variables tab because it only shows player, not playergrouploser, or playergroupwinner.
@WraithChaser: Go
Did you set the variable type to playergroup?
This is what it looks like, but I can't figure out how to change (Picked Player) to the correct one.
I get what your saying, but when I try to change it, I can't find that Player Group anywhere. Not in Function, Preset, or Variable. I have no idea where it is. Or how to get to it. That's what I'm trying to say.
Bump, I need some help.