I have a 2v2v2v2 custom where one player on a team can die (lose all their shit), their teammate can eliminate everyone else, and the dead player on his team still receives a win in his match history. This, combined with wanting to allow people to stay in the game and watch, even when dead, is posing a MASSIVE problem for me.
The way I thought it would work, was to have a pair of boolean[8] arrays, player_is_dead, and player_has_lost. Then I would have certain events reading and modifying these arrays. I'll put these in semi pseudo-code, 'cause Python's awesome damnit.
#Player leaves
kill all (of player's units 'n' buildings)
mark player dead
if teammate dead:
end game in loss for player
mark loss for teammate
(also need to end game in loss for teammate if teammate's left)
#player dies
kill all
mark player dead
if teammate dead:
mark loss for player
mark loss for teammate
if one team left:
-> someone won
#someone won
for i in player has lost:
if player has lost[i]:
end game in loss for player (i+1) (arrays are 0th, Players are 1th)
else:
end game in victory for player (i+1)
However this combination of stuff only works for losers leaving.
This has had be completely stuck for about a month, (on and off), so any help would be greatly appreciated.
There are several tiny mistakes in this, but to be clear... Blizzard will not release a way to change your win/loss history...
Making this project impossible... Now, if you don't know how to make a 2v2v2v2 map, just use the Player Properties, and click on Teams Advanced, and use that...
I'm gonna sorry bout this, but until Blizzard release's Blizzard Dota I fear we may never be able to do this... Blizzard Dota can be a huge step forward in the editor...
And if blizzard wants the Editor to be able to make anything... They better put a model editor in it... Not the 3D's Max crap....
To put it simple: you are trying to allow "dead" players to stay in game and watch the game and still be able to win, if his / her teammate wins? Is that right?
If so then, Then how about this concept:
You should not set up the win / loose condition right at the beginning. If a player looses all of his units he is still allowed to stay in the game by default - as long as he is not matching any loosing condition. If he leaves a game without a winning condition it is a lose by default as far as i know. So there is no point in checking for that (in theory).
So I would try to create a trigger that marks the end of a game. There you can check which player is alive and give him and his ally a win, everyone else looses, since it is an elimination game.
Only have a player marked dead upon leaving, then run the "player death" actions as an action definition. This will make leaving and death essentially the same thing. When a player dies and is still in the game, run the same "player death" actions. Doing this should make it easier to detect the problem.
btw, if you select your triggers and right click, then choose "Copy As Text" you can paste them in here as-is. Use the Code button (The gears to the left of "Markup Type".)
I like the "wait until win" idea, but you can mark a win/loss for someone who's left. Try it on ladder, for instance. Go into a 2v2, and leave. Have your ally then win, and check your match history before and after.
@BasharTeg:
The player dying and leaving had to be in different code blocks, because a dead player can watch. A left player has to have their match history updated. (At least I'm fairly sure it does. There was a reason I did them like this this time round.) Either way, I'm going to try out nThrX's idea first, thank you.
The player dying and leaving had to be in different code blocks, because a dead player can watch.A left player has to have their match history updated.(At least I'm fairly sure it does.There was a reason I did them like this this time round.)Either way, I'm going to try out nThrX's idea first, thank you.
By "player death" actions I basically mean setting the "death" switch to ON, which would be checked at the end to see who was left to claim victory.
But anyway, you can add each player to a player group representing their team, then run a For Each Player in Player Group loop to check if, at the end of the game, any players are left alive in that team. If true, pick each player in that team and end in victory, then pick each player in the non-winning teams and end the game in defeat for them.
I was originally trying to do that, but it was much too complicated for me to figure out which players belonged in which teams inherently, (linking array to array), as it seemed very dynamic, so I'm shying away from that.
I have a 2v2v2v2 custom where one player on a team can die (lose all their shit), their teammate can eliminate everyone else, and the dead player on his team still receives a win in his match history. This, combined with wanting to allow people to stay in the game and watch, even when dead, is posing a MASSIVE problem for me.
The way I thought it would work, was to have a pair of boolean[8] arrays, player_is_dead, and player_has_lost. Then I would have certain events reading and modifying these arrays. I'll put these in semi pseudo-code, 'cause Python's awesome damnit.
#Player leaves
kill all (of player's units 'n' buildings)
mark player dead
if teammate dead:
end game in loss for player
mark loss for teammate
(also need to end game in loss for teammate if teammate's left)
#player dies
kill all
mark player dead
if teammate dead:
mark loss for player
mark loss for teammate
if one team left:
-> someone won
#someone won
for i in player has lost:
if player has lost[i]:
end game in loss for player (i+1) (arrays are 0th, Players are 1th)
else:
end game in victory for player (i+1)
However this combination of stuff only works for losers leaving.
This has had be completely stuck for about a month, (on and off), so any help would be greatly appreciated.
There are several tiny mistakes in this, but to be clear... Blizzard will not release a way to change your win/loss history... Making this project impossible... Now, if you don't know how to make a 2v2v2v2 map, just use the Player Properties, and click on Teams Advanced, and use that... I'm gonna sorry bout this, but until Blizzard release's Blizzard Dota I fear we may never be able to do this... Blizzard Dota can be a huge step forward in the editor... And if blizzard wants the Editor to be able to make anything... They better put a model editor in it... Not the 3D's Max crap....
@SnyderGuy:
Step one: Read my post
Step two: Understand my post
Step three: Post.
You only did one, man.
@Asday: Go
To put it simple: you are trying to allow "dead" players to stay in game and watch the game and still be able to win, if his / her teammate wins? Is that right?
If so then, Then how about this concept:
You should not set up the win / loose condition right at the beginning. If a player looses all of his units he is still allowed to stay in the game by default - as long as he is not matching any loosing condition. If he leaves a game without a winning condition it is a lose by default as far as i know. So there is no point in checking for that (in theory).
So I would try to create a trigger that marks the end of a game. There you can check which player is alive and give him and his ally a win, everyone else looses, since it is an elimination game.
If I missed something, please tell me.
Only have a player marked dead upon leaving, then run the "player death" actions as an action definition. This will make leaving and death essentially the same thing. When a player dies and is still in the game, run the same "player death" actions. Doing this should make it easier to detect the problem.
btw, if you select your triggers and right click, then choose "Copy As Text" you can paste them in here as-is. Use the Code button (The gears to the left of "Markup Type".)
@nThrX:
I like the "wait until win" idea, but you can mark a win/loss for someone who's left. Try it on ladder, for instance. Go into a 2v2, and leave. Have your ally then win, and check your match history before and after.
@BasharTeg:
The player dying and leaving had to be in different code blocks, because a dead player can watch. A left player has to have their match history updated. (At least I'm fairly sure it does. There was a reason I did them like this this time round.) Either way, I'm going to try out nThrX's idea first, thank you.
@Asday: Go
I suppose it should work with custom maps the same then? Does it? Could somebody try out, leaving a custom game and let your partner win it?
@nThrX:
I had 5 people come help me test it out. When I implement your method, I'll see if I can regather them, and that'll be one of the things I test.
If you're on EU, you can come help too, speed the process along.
By "player death" actions I basically mean setting the "death" switch to ON, which would be checked at the end to see who was left to claim victory. But anyway, you can add each player to a player group representing their team, then run a For Each Player in Player Group loop to check if, at the end of the game, any players are left alive in that team. If true, pick each player in that team and end in victory, then pick each player in the non-winning teams and end the game in defeat for them.
@BasharTeg:
I was originally trying to do that, but it was much too complicated for me to figure out which players belonged in which teams inherently, (linking array to array), as it seemed very dynamic, so I'm shying away from that.
If you're still having trouble try pasting your triggers here so I can take a look. You might be overlooking an error somewhere.
@BasharTeg:
Haven't rewritten them to match your idea yet, though if they don't work then, I'll be sure to do so.