-------- This variable would initially be set to however many players there are. --------
Set herosLeft = (herosLeft - 1)
In my game there can be 2 - 4 players, if I set the variable to 4 and then there are only 2 players playing, will that cause any problems?
Kabel said:
-------- This variable would initially be set to however many players there are. --------
Set herosLeft = (herosLeft - 1)
In my game there can be 2 - 4 players, if I set the variable to 4 and then there are only 2 players playing, will that cause any problems?
Since the "Check for winner" trigger checks for "herosLeft" to be 1, that will be no problem.
HeroDies
Events
Unit - A unit Dies
Conditions
((Triggering unit) is A Hero) Equal to True
Actions
-------- You can replace this with any other form of defeat. --------
Game - Defeat (Owner of (Triggering unit)) with the message: Whatever
-------- This variable would initially be set to however many players there are. --------
Set herosLeft = (herosLeft - 1)
-------- This player group would contain all of the players who are playing. --------
Player Group - Remove (Owner of (Triggering unit)) from remainingPlayers
-------- This activates the trigger that checks to see if someone wins yet. --------
Trigger - Run Check For Winner <gen> (checking conditions)
Events
Conditions
herosLeft Equal to 1
Actions
-------- This takes the player who hasn't lost yet and makes them win. --------
Player Group - Pick every player in remainingPlayers and do (Actions)
Loop - Actions
Game - Victory (Picked player) (Show dialogs, Show scores)
Add this to your Map Initialization:
For Integer a 1-12
If
Player(Integer A) is playing
Then
Set (Variable) herosLeft = herosLeft + 1
If you didnt understand i will make the
tag.[/QUOTE]