So what i basically wanted to do here, when a unit dies, it checks if all others are dead, if they all are, then it selects the remaining unit, the game says its owner is the winner, then resets the death count, removes the units from the unit group, updates the leader board, and kills the remaining unit... [Ignore the dialog part]
Here's what i thought of, but it's a bit problematic... If you can find out what's wrong, or if you know a better solution, please tell me... And if he reads this, I thought of this map instantly when I read one of your posts Mozared, :P. It's.. very long... Kinda reminds me of trigger stairs.
So, first, what does actually happen? You only say, that it doesn't work, giving us no information to work with.
Did you try to print some text messages to see, which parts of the trigger actually execute? Did you print some important variables when you use them, like your death count?
Also, a few suggestions: Are you familiar with arrays? They could have saved you a ton of work here. You could cut the entire if/then/else part to determine the player and replace it with something like this:
Also, is there a specific reason, why you use real-time waits? Usually, it is recommended to always use game-time waits, because they factor in the game speed setting correctly.
Btw dead units get removed from a unit group automatically, if you didn't specify a death time in the data editor. Also, you can check the amount of units in a group, so you don't have to add an additional counter for that.
Well I am not very good At trigger debugging, but I think you should move the setting of variables out side of the pick each unit loop- and the leaderboard. Also put in the action display message at different parts of the trigger, to see if it is working. You can also do this for the variables EG:
Thanks crazy, it all works now, and i'll make a larger version of that image for you :),
EDIT: Unit still doesn't die ):.
Variable - Set CurrentPlayer = (Owner of (Killing unit))
Variable - Modify PlayerScore[CurrentPlayer]: + 1
Unit - Kill (Killing unit)
Unit Group - Remove (Killing unit) from NukeWarsGroup
Leaderboard - Set ScoreBoard item text at column 2 and row CurrentPlayer to (Text(PlayerScore[CurrentPlayer]))
Oh, the unit does not die, because your looking for "last created units" which does not exist in that trigger, you need to reference them, like pick each unit in entire map for player 1 or something ( I would try and use arrays)
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
So what i basically wanted to do here, when a unit dies, it checks if all others are dead, if they all are, then it selects the remaining unit, the game says its owner is the winner, then resets the death count, removes the units from the unit group, updates the leader board, and kills the remaining unit... [Ignore the dialog part]
Here's what i thought of, but it's a bit problematic... If you can find out what's wrong, or if you know a better solution, please tell me... And if he reads this, I thought of this map instantly when I read one of your posts Mozared, :P. It's.. very long... Kinda reminds me of trigger stairs.
So, first, what does actually happen? You only say, that it doesn't work, giving us no information to work with.
Did you try to print some text messages to see, which parts of the trigger actually execute? Did you print some important variables when you use them, like your death count?
Also, a few suggestions: Are you familiar with arrays? They could have saved you a ton of work here. You could cut the entire if/then/else part to determine the player and replace it with something like this:
Also, is there a specific reason, why you use real-time waits? Usually, it is recommended to always use game-time waits, because they factor in the game speed setting correctly.
Btw dead units get removed from a unit group automatically, if you didn't specify a death time in the data editor. Also, you can check the amount of units in a group, so you don't have to add an additional counter for that.
Well first of all, thanks to you [THANKYOUUU], I updated it to this,
But the problem is, the unit does not die, neither does the leader board score add up.
Well I am not very good At trigger debugging, but I think you should move the setting of variables out side of the pick each unit loop- and the leaderboard. Also put in the action display message at different parts of the trigger, to see if it is working. You can also do this for the variables EG:
Player Any player types message -check
Conditions: Game is in Test mode= True
Actions Display Message (PlayerScore)
Thanks crazy, it all works now, and i'll make a larger version of that image for you :),
EDIT: Unit still doesn't die ):.
Variable - Set CurrentPlayer = (Owner of (Killing unit)) Variable - Modify PlayerScore[CurrentPlayer]: + 1 Unit - Kill (Killing unit) Unit Group - Remove (Killing unit) from NukeWarsGroup Leaderboard - Set ScoreBoard item text at column 2 and row CurrentPlayer to (Text(PlayerScore[CurrentPlayer]))
Oh, the unit does not die, because your looking for "last created units" which does not exist in that trigger, you need to reference them, like pick each unit in entire map for player 1 or something ( I would try and use arrays)