| 12-19-2003, 05:33 AM | #1 |
I scanned the Conditions, but there is no Leaderboard condition, such as Leaderboard - If Player # has # Points/Kills/Etc... What trigger can I use to make it so if you get a certain amount of kills, you get better units? Plz help--thanks! |
| 12-19-2003, 10:15 AM | #2 |
Well, if I understand your first statement correctly, then I tend to agree with you. I often time find Events and Conditions very limiting in their options, forcing you to create a strange or sometimes even unrelated Event Scenario just to get your trigger to function. Oh well. Anyway, as for your question, there isn't a Leaderboard function as you described because Leaderboards don't actually hold any values such as Units, Kills, Players, etc. Those values can be displayed on a Leaderboard, but only because they exist already elsewhere in your triggers (as variables in most cases.) Therefore, to keep track of the total kills for any given player, and to fire off a massive upgrade for that player's units once they reach a certain point, I'd suggest something like this. It can be split into multiple triggers if you find the If confusing, but for this example it works fine. Code:
Events
Unit - A unit Dies
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
var_intPlayerKillCount[(Player number of (Owner of (Killing unit)))] Equal to 150
Then - Actions
Set var_intPlayerKillCount[(Player number of (Owner of (Killing unit)))] = (var_intPlayerKillCount[(Player number of (Owner of (Killing unit)))] + 1)
Unit Group - Pick every unit in (Units owned by (Owner of (Killing unit)) of type Footman) and do (Actions)
Loop - Actions
Unit - Replace (Picked unit) with a Knight using The old unit's relative life and mana
Else - Actions
Set var_intPlayerKillCount[(Player number of (Owner of (Killing unit)))] = (var_intPlayerKillCount[(Player number of (Owner of (Killing unit)))] + 1)Note that the only variable here is the var_intPlayerKillCount, which simply is an Integer array of 12 fields, designed to keep track of all total kills for all Players, and updates with this trigger based on whichever player owns the killing unit of whatever unit died. Additionally, once the kill count for any given player reaches 150 (arbitrary number, you can change it or set it to another integer variable to allow you to easily alter it later on), the trigger takes all the units of that Player of the type 'Footman' in this case, and replaces them (therefore, upgrades them) to 'Knights.' Again, both those are arbitrary units and can be changed or replaced with variables. Also, you can add additional If statements to accommodate for various upgrades, say at different numbers of total kills. If you wanted to do something else, like level up a hero once that kill number is reached, or add an ability or give an item or what not, you can simply replace the "Then - Actions" with anything you'd like, just don't forget to have the line that increments the kill total somewhere in there. Hope that helps, if not, please let me know and I'll do what I can to get you going. -GabeStah- |
| 12-19-2003, 05:51 PM | #3 |
Thanks, but is there a simpler way? The one thing I can't stand is that Starcraft had so many Leaderboard options (like the ones you listed)--HOW COULD BLIZZARD FORGET THAT!? Argh. Do those come with TFT or something? Anyway, is there a such trigger as: "If -Player #'s Kills- are -Equal to or Greater Than- -300-, Turn on -Trigger-" Is there a such trigger? And also, could I create a custom trigger like this using JASS? Atleast I THINK thats what JASS is...:bgrun: |
| 12-19-2003, 06:12 PM | #4 |
Well... You could create the trigger you asked for but you'll need an event to activate the checking trigger as well... It would most probably be whenever the player in question kills some unit, which would make the trigger: Code:
YourTrigger
Events
Unit - A unit owned by Player 2 (Blue) Dies
Unit - A unit owned by Player 3 (Teal) Dies
Unit - A unit owned by Player 4 (Purple) Dies
Unit - A unit owned by Player 5 (Yellow) Dies
Unit - A unit owned by Player 6 (Orange) Dies
Unit - A unit owned by Player 7 (Green) Dies
Unit - A unit owned by Player 8 (Pink) Dies
Conditions
(Owner of (Killing unit)) Equal to Player 1 (Red)
Actions
Set YourKillingIntegerVariableHere = (YourKillingIntegerVariableHere + 1)
If (YourKillingIntegerVariableHere Greater than or equal to 300) then do (Trigger - Turn on YourTriggerHere <gen>) else do (Do nothing)JASS is the custom script language which you'd use to write your triggers with... However, there is a simpler option. Use the GUI triggers. Do you know what a variable is? That is what I used... If you don't, I'll try to explain it to you. (Don't read tutorials on them, they usually mislead you and they're very very very hard to understand). Regards Dead-Inside |
| 01-23-2004, 06:12 PM | #5 |
Yes, I know how to use variables. I used the generic trigger saying" When a Unit Dies" then went on to if Player 1 Owns Killing Unit and so on...but now you've given me the answer to my problem--keeping people from killing themselves for points! Anyway, is there a such condition like: If Dying Unit Is Enemy of Player 1 = True, as to keep people from attacking their allies also? |
