QUOTE(Kenoli @ May 9 2006, 12:40 PM)
You could do it with triggers like this:
| Trigger |
| Players: |
| ¤ All Players. |
| Conditions: |
| ¤ Current Player kills exactly 1 Hero Unit. |
| Actions: |
¤ Create 1 Hero Unit at 'Location' for Current Player.
|
| ¤ (Don't Preserve) |
| Trigger |
| Players: |
| ¤ All Players. |
| Conditions: |
| ¤ Current Player kills exactly 2 Hero Unit. |
| Actions: |
¤ Create 1 Hero Unit at 'Location' for Current Player.
|
| ¤ (Don't Preserve) |
| Trigger |
| Players: |
| ¤ All Players. |
| Conditions: |
| ¤ Current Player kills exactly 3 Hero Unit. |
| Actions: |
¤ Create 1 Hero Unit at 'Location' for Current Player.
|
| ¤ (Don't Preserve) |
Etc.
Each time you kill the hero you will get one, and only one. The problem with this method is that you may need to make alot of triggers, depending on how often you plan on the hero unit being killed.
[right][snapback]482883[/snapback][/right]
Yeah I was thinking that. The thing is, if I was going to do that I would want each player to have an even number of chances to obtain the hero unit, so one player couldn't, for example, just kill off his own Hero unit 10 times and disable the trigger.
So what I was going to do is something like this:
-Check each player for a loss of one hero-unit. If they have one, set a "deceased" flag and decrement the loss counter to "0"
-Run through each player as you suggested above, checking for 1 kill, 2 kills, 3 kills, etc up to a predefined amount and if the condition is met, set a "kill" flag for that player
-Have a check that checks to see if both the deceased flag and the player's current kill flag is set...if so, clear both flags and give a hero unit to the player whose kill flag was set (preserved)
-Have a final check that checks if the deceased flag is set and NO kill flags are set (for cases where a player has killed the hero more than the triggers were written for), and in that case, reset the deceased flag and give the hero unit back to the computer player. (preserved)
I'm assuming all of these triggers run serially. It's kind of dependent on that, because if, say, player 1 kills player 2's hero-unit, it's possible that player 2's deceased trigger could be detected before player 1 sets his "kill flag" and the hero-unit could be given back to the computer player by mistake.
I was just going to run them for one player (a neutral player or the computer player) to avoid synchronization errors with flags getting set/not getting set in time to activate the proper triggers. I hope this is correct. If it works right, it should let a player acquire the hero by killing it up to the number of times I include the "kill flag" trigger, then for subsequent kills, give the unit back to the computer player. Does that sound like it will work? I'm not going to write out ALL the triggers because it'd be a lot, but you get the idea.
Of course, the other factor is Mind Control, so I have to put in some kind of trick to "punish" anyone who tries to get clever and control the hero-unit.
