• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Rank System Based on Unit Group Deaths

Status
Not open for further replies.
Level 8
Joined
Feb 17, 2007
Messages
368
How do I make it so that each time a unit dies in a specified unit group, the rank for the whole unit group/team goes down 1 notch?

Here are the ranks in order from highest to lowest:

S
A
B
C
D
F

This is what I have so far:

  • Ranks
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Dying unit) is in Hero_Selected_Unit_Group) Equal to True
    • Actions
I'm not sure how to decrease the rank each time a player dies.
 
  • Events
    • Unit - A unit Dies
  • Conditions
  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • ((Triggering unit) is in S) Equal to True
      • Then - Actions
        • Unit Group - Add all units of S to A
      • Else - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • ((Triggering unit) is in A) Equal to True
          • Then - Actions
            • Unit Group - Add all units of A to B
          • Else - Actions
            • .....................................
Will this do?
 
What about the Picked Unit actions ?
The (Pick every units in (Playable map area)) ?
Does it requires the custom script ?
Maybe :D

If you want to use unit group later then we don't use set bj...!

But Pick every unit will probably be set as variable so we can easily move trough trigger actions, if not then we use set bj... to remove it :D

Now this sounded fu ^^
 
Level 8
Joined
Feb 17, 2007
Messages
368
Ok so this is correct right?:

  • Ranks
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) is in SRank) Equal to True
        • Then - Actions
          • Unit Group - Add all units of Hero_Selected_Unit_Group to ARank
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) is in ARank) Equal to True
        • Then - Actions
          • Unit Group - Add all units of Hero_Selected_Unit_Group to BRank
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Triggering unit) is in BRank) Equal to True
            • Then - Actions
              • Unit Group - Add all units of Hero_Selected_Unit_Group to CRank
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Triggering unit) is in CRank) Equal to True
                • Then - Actions
                  • Unit Group - Add all units of Hero_Selected_Unit_Group to DRank
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ((Triggering unit) is in DRank) Equal to True
                    • Then - Actions
                      • Unit Group - Add all units of Hero_Selected_Unit_Group to FRank
                    • Else - Actions
And this is the part where I'm not sure what to do:

  • Final form Frieza dies
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Dying unit) Equal to FriezaFinal
    • Actions
      • Game - Display to (All players) for 3.00 seconds the text: |cff9932ccFrieza|r:...
      • Item - Create Frieza's Orb at (Position of (Dying unit))
      • Custom script: call RemoveLocation(udg_FriezaUltCenter)
      • Trigger - Turn off Frieza Timer <gen>
      • Trigger - Turn off FreezaFinalManaGain <gen>
      • Trigger - Turn off FreezaSkill 3 <gen>
      • Trigger - Turn off FreezaSkill4 <gen>
      • Trigger - Turn off FriezaSkill4 Mana Gain <gen>
      • Trigger - Turn off Frieza Final Ult <gen>
      • Trigger - Turn off FreezaSkill2 <gen>
      • Trigger - Turn off Frieza Final Form Energy Update <gen>
      • Trigger - Turn off Frieza Final form Life <gen>
      • Trigger - Turn off Counter For Goku 1 <gen>
      • Trigger - Turn off Counter For Sakura 1 <gen>
      • Trigger - Turn off Counter For Vegeta 1 <gen>
      • Sound - Stop FriezaArenaMusic After fading
      • Wait 4.00 seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Difficulty Equal to Very Easy
          • (Players_Heroes[(Player number of (Triggering player))] is in SRank) Equal to True
        • Then - Actions
          • Player - Add 60 to Player 1 (Red) Current gold
          • Player - Add 60 to Player 2 (Blue) Current gold
          • Player - Add 60 to Player 3 (Teal) Current gold
          • Player - Add 60 to Player 4 (Purple) Current gold
          • Player - Add 60 to Player 5 (Yellow) Current gold
          • Player - Add 60 to Player 6 (Orange) Current gold
          • Player - Add 60 to Player 7 (Green) Current gold
          • Player - Add 40 to Player 8 (Pink) Current gold
          • Player - Add 1 to Player 1 (Red) Current lumber
          • Player - Add 1 to Player 2 (Blue) Current lumber
          • Player - Add 1 to Player 3 (Teal) Current lumber
          • Player - Add 1 to Player 4 (Purple) Current lumber
          • Player - Add 1 to Player 5 (Yellow) Current lumber
          • Player - Add 1 to Player 6 (Orange) Current lumber
          • Player - Add 1 to Player 7 (Green) Current lumber
          • Player - Add 1 to Player 8 (Pink) Current lumber
          • Game - Display to Hero_Selected_Group for 6.00 seconds the text: You have earned 60 ...
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Difficulty Equal to Very Easy
              • ((Triggering unit) is in ARank) Equal to True
            • Then - Actions
              • Player - Add 55 to Player 1 (Red) Current gold
              • Player - Add 55 to Player 2 (Blue) Current gold
              • Player - Add 55 to Player 3 (Teal) Current gold
              • Player - Add 55 to Player 4 (Purple) Current gold
              • Player - Add 55 to Player 5 (Yellow) Current gold
              • Player - Add 55 to Player 6 (Orange) Current gold
              • Player - Add 55 to Player 7 (Green) Current gold
              • Player - Add 55 to Player 8 (Pink) Current gold
              • Player - Add 1 to Player 1 (Red) Current lumber
              • Player - Add 1 to Player 2 (Blue) Current lumber
              • Player - Add 1 to Player 3 (Teal) Current lumber
              • Player - Add 1 to Player 4 (Purple) Current lumber
              • Player - Add 1 to Player 5 (Yellow) Current lumber
              • Player - Add 1 to Player 6 (Orange) Current lumber
              • Player - Add 1 to Player 7 (Green) Current lumber
              • Player - Add 1 to Player 8 (Pink) Current lumber
              • Game - Display to Hero_Selected_Group for 6.00 seconds the text: You have earned 55 ...
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Difficulty Equal to Very Easy
                  • Rank Equal to B
                • Then - Actions
                  • Player - Add 45 to Player 1 (Red) Current gold
                  • Player - Add 45 to Player 2 (Blue) Current gold
                  • Player - Add 45 to Player 3 (Teal) Current gold
                  • Player - Add 45 to Player 4 (Purple) Current gold
                  • Player - Add 45 to Player 5 (Yellow) Current gold
                  • Player - Add 45 to Player 6 (Orange) Current gold
                  • Player - Add 45 to Player 7 (Green) Current gold
                  • Player - Add 45 to Player 8 (Pink) Current gold
                  • Player - Add 1 to Player 1 (Red) Current lumber
                  • Player - Add 1 to Player 2 (Blue) Current lumber
                  • Player - Add 1 to Player 3 (Teal) Current lumber
                  • Player - Add 1 to Player 4 (Purple) Current lumber
                  • Player - Add 1 to Player 5 (Yellow) Current lumber
                  • Player - Add 1 to Player 6 (Orange) Current lumber
                  • Player - Add 1 to Player 7 (Green) Current lumber
                  • Player - Add 1 to Player 8 (Pink) Current lumber
                  • Game - Display to (All players) for 6.00 seconds the text: You have earned 45 ...
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Difficulty Equal to Very Easy
                      • Rank Equal to C
                    • Then - Actions
                      • Player - Add 40 to Player 1 (Red) Current gold
                      • Player - Add 40 to Player 2 (Blue) Current gold
                      • Player - Add 40 to Player 3 (Teal) Current gold
                      • Player - Add 40 to Player 4 (Purple) Current gold
                      • Player - Add 40 to Player 5 (Yellow) Current gold
                      • Player - Add 40 to Player 6 (Orange) Current gold
                      • Player - Add 40 to Player 7 (Green) Current gold
                      • Player - Add 40 to Player 8 (Pink) Current gold
                      • Player - Add 1 to Player 1 (Red) Current lumber
                      • Player - Add 1 to Player 2 (Blue) Current lumber
                      • Player - Add 1 to Player 3 (Teal) Current lumber
                      • Player - Add 1 to Player 4 (Purple) Current lumber
                      • Player - Add 1 to Player 5 (Yellow) Current lumber
                      • Player - Add 1 to Player 6 (Orange) Current lumber
                      • Player - Add 1 to Player 7 (Green) Current lumber
                      • Player - Add 1 to Player 8 (Pink) Current lumber
                      • Game - Display to Hero_Selected_Group for 6.00 seconds the text: You have earned 40 ...
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • Difficulty Equal to Very Easy
                          • Rank Equal to D
                        • Then - Actions
                          • Player - Add 35 to Player 1 (Red) Current gold
                          • Player - Add 35 to Player 2 (Blue) Current gold
                          • Player - Add 35 to Player 3 (Teal) Current gold
                          • Player - Add 35 to Player 4 (Purple) Current gold
                          • Player - Add 35 to Player 5 (Yellow) Current gold
                          • Player - Add 35 to Player 6 (Orange) Current gold
                          • Player - Add 35 to Player 7 (Green) Current gold
                          • Player - Add 35 to Player 8 (Pink) Current gold
                          • Player - Add 1 to Player 1 (Red) Current lumber
                          • Player - Add 1 to Player 2 (Blue) Current lumber
                          • Player - Add 1 to Player 3 (Teal) Current lumber
                          • Player - Add 1 to Player 4 (Purple) Current lumber
                          • Player - Add 1 to Player 5 (Yellow) Current lumber
                          • Player - Add 1 to Player 6 (Orange) Current lumber
                          • Player - Add 1 to Player 7 (Green) Current lumber
                          • Player - Add 1 to Player 8 (Pink) Current lumber
                          • Game - Display to Hero_Selected_Group for 6.00 seconds the text: You have earned 35 ...
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • Difficulty Equal to Very Easy
                              • Rank Equal to F
                            • Then - Actions
                              • Player - Add 20 to Player 1 (Red) Current gold
                              • Player - Add 20 to Player 2 (Blue) Current gold
                              • Player - Add 20 to Player 3 (Teal) Current gold
                              • Player - Add 20 to Player 4 (Purple) Current gold
                              • Player - Add 20 to Player 5 (Yellow) Current gold
                              • Player - Add 20 to Player 6 (Orange) Current gold
                              • Player - Add 20 to Player 7 (Green) Current gold
                              • Player - Add 20 to Player 8 (Pink) Current gold
                              • Player - Add 1 to Player 1 (Red) Current lumber
                              • Player - Add 1 to Player 2 (Blue) Current lumber
                              • Player - Add 1 to Player 3 (Teal) Current lumber
                              • Player - Add 1 to Player 4 (Purple) Current lumber
                              • Player - Add 1 to Player 5 (Yellow) Current lumber
                              • Player - Add 1 to Player 6 (Orange) Current lumber
                              • Player - Add 1 to Player 7 (Green) Current lumber
                              • Player - Add 1 to Player 8 (Pink) Current lumber
                              • Game - Display to Hero_Selected_Group for 6.00 seconds the text: You have earned 20 ...
                            • Else - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • Difficulty Equal to Easy
                                  • Rank Equal to S
                                • Then - Actions
                                  • Player - Add 55 to Player 1 (Red) Current gold
                                  • Player - Add 55 to Player 2 (Blue) Current gold
                                  • Player - Add 55 to Player 3 (Teal) Current gold
                                  • Player - Add 55 to Player 4 (Purple) Current gold
                                  • Player - Add 55 to Player 5 (Yellow) Current gold
                                  • Player - Add 55 to Player 6 (Orange) Current gold
                                  • Player - Add 55 to Player 7 (Green) Current gold
                                  • Player - Add 55 to Player 8 (Pink) Current gold
                                  • Player - Add 1 to Player 1 (Red) Current lumber
                                  • Player - Add 1 to Player 2 (Blue) Current lumber
                                  • Player - Add 1 to Player 3 (Teal) Current lumber
                                  • Player - Add 1 to Player 4 (Purple) Current lumber
                                  • Player - Add 1 to Player 5 (Yellow) Current lumber
                                  • Player - Add 1 to Player 6 (Orange) Current lumber
                                  • Player - Add 1 to Player 7 (Green) Current lumber
                                  • Player - Add 1 to Player 8 (Pink) Current lumber
                                  • Game - Display to Hero_Selected_Group for 6.00 seconds the text: You have earned 55 ...
                                • Else - Actions
                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • (Players_Heroes[(Player number of (Triggering player))] is in ARank) Equal to True
                                      • Difficulty Equal to Easy
                                      • Rank Equal to A
                                    • Then - Actions
                                      • Player - Add 50 to Player 1 (Red) Current gold
                                      • Player - Add 50 to Player 2 (Blue) Current gold
                                      • Player - Add 50 to Player 3 (Teal) Current gold
                                      • Player - Add 50 to Player 4 (Purple) Current gold
                                      • Player - Add 50 to Player 5 (Yellow) Current gold
                                      • Player - Add 50 to Player 6 (Orange) Current gold
                                      • Player - Add 50 to Player 7 (Green) Current gold
                                      • Player - Add 50 to Player 8 (Pink) Current gold
                                      • Player - Add 1 to Player 1 (Red) Current lumber
                                      • Player - Add 1 to Player 2 (Blue) Current lumber
                                      • Player - Add 1 to Player 3 (Teal) Current lumber
                                      • Player - Add 1 to Player 4 (Purple) Current lumber
                                      • Player - Add 1 to Player 5 (Yellow) Current lumber
                                      • Player - Add 1 to Player 6 (Orange) Current lumber
                                      • Player - Add 1 to Player 7 (Green) Current lumber
                                      • Player - Add 1 to Player 8 (Pink) Current lumber
                                      • Game - Display to Hero_Selected_Group for 6.00 seconds the text: You have earned 50 ...
                                    • Else - Actions
                                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                        • If - Conditions
                                          • (Players_Heroes[(Player number of (Triggering player))] is in BRank) Equal to True
                                          • Difficulty Equal to Easy
                                          • Rank Equal to B
                                        • Then - Actions
                                          • Player - Add 42 to Player 1 (Red) Current gold
                                          • Player - Add 42 to Player 2 (Blue) Current gold
                                          • Player - Add 42 to Player 3 (Teal) Current gold
                                          • Player - Add 42 to Player 4 (Purple) Current gold
                                          • Player - Add 42 to Player 5 (Yellow) Current gold
                                          • Player - Add 42 to Player 6 (Orange) Current gold
                                          • Player - Add 42 to Player 7 (Green) Current gold
                                          • Player - Add 42 to Player 8 (Pink) Current gold
                                          • Player - Add 1 to Player 1 (Red) Current lumber
                                          • Player - Add 1 to Player 2 (Blue) Current lumber
                                          • Player - Add 1 to Player 3 (Teal) Current lumber
                                          • Player - Add 1 to Player 4 (Purple) Current lumber
                                          • Player - Add 1 to Player 5 (Yellow) Current lumber
                                          • Player - Add 1 to Player 6 (Orange) Current lumber
                                          • Player - Add 1 to Player 7 (Green) Current lumber
                                          • Player - Add 1 to Player 8 (Pink) Current lumber
                                          • Game - Display to (All players) for 6.00 seconds the text: You have earned 42 ...
                                        • Else - Actions
      • Item - Pick every item in Region 015 <gen> and do (Item - Move (Picked item) to (Center of StartingRegion))
      • Unit Group - Pick every unit in Hero_Selected_Unit_Group and do (Unit - Move (Picked unit) instantly to (Center of StartingRegion))
      • Unit Group - Pick every unit in Hero_Selected_Unit_Group and do (Hero - Instantly revive Players_Heroes[(Player number of (Triggering player))] at (Center of StartingRegion), Hide revival graphics)
      • Trigger - Turn on Cell Timer <gen>
      • Trigger - Turn on Cell Energy Update <gen>
      • Sound - Play ClanInvitation <gen>
      • Set item = (0 + loopcounter)
      • Neutral Building - Add (Item-type of weponitems[item]) to Boss Loot 0021 <gen> with 1 in stock and a max stock of 1
      • Set item = (1 + loopcounter)
      • Neutral Building - Add (Item-type of weponitems[item]) to Boss Loot 0021 <gen> with 1 in stock and a max stock of 1
      • Set item = (0 + loopcounter)
      • Neutral Building - Add (Item-type of charmitems[item]) to Boss Loot 0021 <gen> with 1 in stock and a max stock of 1
      • Set item = (0 + loopcounter)
      • Neutral Building - Add (Item-type of armoritems[item]) to Boss Loot 0021 <gen> with 1 in stock and a max stock of 1
      • Set loopcounter = (1 + loopcounter)
      • Countdown Timer - Start Cell_Countdown as a One-shot timer that will expire in 15.00 seconds
      • Wait 7.00 seconds
      • Sound - Play ArrangedTeamInvitation <gen>
      • Game - Display to (All players) for 10.00 seconds the text: |cff0080FFDamage Do...
      • Custom script: call PrintDamage(8)
As you can see I tried multiple ways, haha. None of them work. I want the rank to be given after the boss dies based on the amount of times the units in the Hero Selected Group died. The Rank variable is a string and I tried to set it to change in the trigger that I posted first as well, but that didn't appear to work.
 
First off, in order to remove that big if/then/else statement, you can do this instead:
  • Trigger
  • Events
    • Map Initialization
  • Conditions
  • Actions
    • Set RankGroups[1] = S
    • Set RankGroups[2] = A
    • Set RankGroups[3] = B
    • Set RankGroups[4] = C
    • Set RankGroups[5] = D
    • Set RankGroups[6] = E
    • Set RankGroups[7] = F
RankGroups[] is a Unit Group variable with array, while S/A/B/C/D/E/F are also Unit Group variables.
  • Trigger2
  • Events
    • Unit - A unit dies
  • Conditions
  • Actions
    • Set Integer = 0
    • For each (Integer A) from 1 to 6, do (Actions)
      • Loop - Actions
        • If (All conditions are true) then do (Actions) else do (Actions)
          • If - Conditions
            • ((Triggering unit) is in RankGroups[(IntegerA)]) Equal to True
          • Then - Actions
            • Set Integer = Integer + 1
          • Else - Actions
    • Unit Group - Add all units of RankGroups[Integer] to RankGroups[(Integer + 1)]
    • Unit Group - Remove all units from RankGroups[Integer]
 
Level 6
Joined
Dec 9, 2007
Messages
208
Just spotted that in your S Rank reward trigger, Pink only gets 40 gold while the rest get 60 gold.
Not sure if it's just a missclick on THW, but IF it's a copy then you should check it :)
 
Level 8
Joined
Feb 17, 2007
Messages
368
Haha, thanks for that spot Sinizi. =D Ok so Pharaoh, I'm still not sure what condition I put in the long trigger. I implemented both the triggers you posted, but what should the condition be? The event is the boss dying so I'm not sure what condition to put. I have the amount of gold dictated by difficulty setting as you can see.
 
Status
Not open for further replies.
Top