• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

HOW TO MAKE Unit Rank System

Status
Not open for further replies.
Level 4
Joined
Oct 20, 2010
Messages
92
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: 441
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