• 🏆 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!

Unit levelup System???

Status
Not open for further replies.
Level 7
Joined
Feb 9, 2010
Messages
298
(All right, first of all hello and thanks to anyone who read this thread, hope solving this thread's problem will help to others too.)
Is there a way to make normal units to level up and let's say change unit type or just improve their skills like heroes. But I don't want them to be heroes themselves just that they can level up 3-4 levels not more.
IF YES! Then I have two suggestions:

1) by making them somehow getting experience without them being heroes

2) by increasing their level gaining no exp. at all let's say just have to kill for lvl 1 - 3 units (doesn't matter creep or player/strong or weak) for lvl 2 - 5 units; lvl 3 - 7 units... and so on!

Can anyone help please? (I'm sure it's possible to made with triggers)
 
You can make a custom experience system, but you will primarily need something like this:
  • L1
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Killing unit) is A Hero) Equal to False
    • Actions
      • Custom script: local timer t
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Key level) is stored as a Integer of (Key (Killing unit)) in Hash) Equal to False
        • Then - Actions
          • Custom script: set t = CreateTimer()
          • Custom script: call TimerStart (t, 0.05, true, null)
          • Hashtable - Save 1 as (Key level) of (Key (Killing unit)) in Hash
          • Hashtable - Save 1 as (Key units) of (Key (Killing unit)) in Hash
          • Floating Text - Create floating text that reads (Level: + 0) above (Killing unit) with Z offset 120.00, using font size 8.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
          • Hashtable - Save Handle Of(Last created floating text) as (Key leveld) of (Key (Killing unit)) in Hash
          • Custom script: call SaveUnitHandle (udg_Hash, GetHandleId (t), StringHash("unit"), GetKillingUnit())
          • Custom script: call TriggerRegisterTimerExpireEvent (gg_trg_L2, t)
        • Else - Actions
          • Set UnitsKilled = (Load (Key units) of (Key (Killing unit)) from Hash)
          • Set Level = (Load (Key level) of (Key (Killing unit)) from Hash)
          • Set UnitsKilledFormula = ((2 x Level) + 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • UnitsKilled Greater than or equal to UnitsKilledFormula
            • Then - Actions
              • Set TextLoad = (Load (Key leveld) of (Key (Killing unit)) in HashIf the label is not found, this function returns NULL.)
              • Hashtable - Save 0 as (Key units) of (Key (Killing unit)) in Hash
              • Hashtable - Save (Level + 1) as (Key level) of (Key (Killing unit)) in Hash
              • Floating Text - Change text of TextLoad to (Level: + (String(Level))) using font size 8.00
            • Else - Actions
              • Hashtable - Save (UnitsKilled + 1) as (Key units) of (Key (Killing unit)) in Hash
      • Custom script: set t= null
  • L2
    • Events
    • Conditions
    • Actions
      • Custom script: local timer t = GetExpiredTimer()
      • Custom script: local unit u = LoadUnitHandle (udg_Hash, GetHandleId (t), StringHash("unit"))
      • Custom script: local real x = GetUnitX (u)
      • Custom script: local real y = GetUnitY (u)
      • Custom script: call SetTextTagPos (LoadTextTagHandle (udg_Hash, GetHandleId (u), StringHash("leveld")), x, y, 120)
      • Custom script: set t = null
The system I made works with the number of units killed. The level increases, after killing a unit yourself, not like a normal experience system. First level requires 3 units to kill, second level 5 units to kill, third level 7 units, and so on (you can control that via the "UnitsKilledFormula" variable. "Level" is the current level of the unit, while "UnitsKilled" is how many units the unit has killed (a counter, to check when the new level will be applied). Here is a test map:
 

Attachments

  • Unit Level Up System.w3x
    21.8 KB · Views: 345
Level 7
Joined
Feb 9, 2010
Messages
298
Wooohooooo!

Thanks Pharaoh_ as always you are the man with the best solutions! Thank you a lot for that! + rep / and you will be in one of the first 3 places in the credits of my campaign! :grin: :thumbs_up:
(now I only have to read enough about working with triggers :at:)
 
Level 7
Joined
Feb 9, 2010
Messages
298
Dear Pharaoh I've got just though that this exp. system is good but I don't know how to connect it to the unit increasing its stats and/or abilities, could you be so kind and help me a little bit more?
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
Maybe you can "replace" the unit with a unit same model, same attack animation, same current spell from last level, but different attack damage range, different attack speed, maybe new spells ?
This, is what I'm talking about:
  • Unit - Replace *TheUnit* with a *TheUnitLevel2* using The old unit's relative life and mana
 
Level 7
Joined
Feb 9, 2010
Messages
298
Do I have to do this for every single unit I make level up? :vw_wtf:
Other than that thanks your help is useful to me! +rep for that. :thumbs_up:
 
Status
Not open for further replies.
Top