• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

HOW TO MAKE Unit Rank System

Status
Not open for further replies.
Level 5
Joined
Oct 20, 2010
Messages
101
Hey guys is it possible to give unit a ranking system when they kill units they got few bonus? and change their rank?... like if they start as Infantry they can become sergent , lieutnant , General.. Ect...:goblin_jawdrop: any idee how to do it heres a exemple to helping you Helping me :ogre_haosis:
 

Attachments

  • Cap RAnk1.PNG
    Cap RAnk1.PNG
    387.5 KB · Views: 447
Level 21
Joined
Mar 27, 2012
Messages
3,232
Hey guys is it possible to give unit a ranking system when they kill units they got few bonus? and change their rank?... like if they start as Infantry they can become sergent , lieutnant , General.. Ect...:goblin_jawdrop: any idee how to do it heres a exemple to helping you Helping me :ogre_haosis:

Luckily it's quite simple.

Generic unit - Unit dies
Increase level of ability(UnitXP) for killing unit.

UnitXP is the ability that gives bonuses.
 
Level 5
Joined
Jan 12, 2010
Messages
132
1) Create a hashtable special for rank use.
2)Create some abilities u wish u use as your rank lvl and add them into a variable array.
3)Create some conditions u want to use like "every 100 kills or whatever"
4)Rest of your imagination.
Exemple
  • Rank set
    • Events
      • Map initialization
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 10, do (Actions)
        • Loop - Actions
          • Set Rank_lvl[(Integer A)] = (10 x (Integer A))
      • -------- Do this with all your rank abilities --------
      • Set Rank_abilities[1] = Acid Bomb
      • Hashtable - Create a hashtable
      • Set Rank_hash = (Last created hashtable)
  • Rank event
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is an illusion) Equal to False
      • ((Killing unit) is an illusion) Equal to False
      • ((Owner of (Killing unit)) is an enemy of (Owner of (Triggering unit))) Equal to True
    • Actions
      • Set Temp_integer = ((Load 1 of (Key (Killing unit)) from Rank_hash) + 1)
      • Hashtable - Save Temp_integer as 1 of (Key (Killing unit)) in Rank_hash
      • For each (Integer A) from 1 to 10, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Temp_integer Greater than or equal to Rank_lvl[(Integer A)]
            • Then - Actions
              • Unit - Remove Rank_abilities[((Integer A) - 1)] from (Killing unit)
              • Unit - Add Rank_abilities[(Integer A)] to (Killing unit)
            • Else - Actions
 
Status
Not open for further replies.
Top