• 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.

Looking for someway to upgrade units after time

Status
Not open for further replies.
Level 25
Joined
Mar 23, 2008
Messages
1,813
I have looked around a bit and cant find anything that like instantly upgrades my units that spawns every 10 seconds. I need a way to make my units better after time, so you dont go around one-hit all the units after like 30 minutes played. I were thinking of making upgrades, but cant find any trigger that gives the units the upgrade.
 
Level 2
Joined
May 17, 2009
Messages
18
What type of map are you making so i can get an idea of what you are trying to do? Is it like a game with two sides that sends units to attack? Well if so you can make like an upgrade button at like a castle of something and make the trigger to replace all the units with like level 2 units or whatever you want
 
Level 16
Joined
Jul 21, 2008
Messages
1,121
Create a custom upgrade. Set it's bonuses (Ability bonus, armor bonus, damage bonus etc...), then add last created upgrade to all units you want to be upgraded.

After that copy this trigger:
  • Upgrade
    • Events
      • Time - Every <X> seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • Player - Set the current research level of <Your Upgrade> to ((Current research level of <Your Upgrade> for (Player((Integer A)))) + 1) for (Player((Integer A)))
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
Just go to the object editor, go to the upgrade-page, add some upgrades like:
  • + Damage
  • + HP
  • + Mana
  • + Armor

Next, go to the unit page and give the creeps those upgrades.

Then go to the trigger editor and set the upgrades to the avarage level of the heroes, which will be better than time-based, since some people will level faster than others.


  • Tech Level
  • Events
    • Unit - A unit Gains a level
  • Conditions
  • Actions
    • -------- Sets the Unit Group, to remove leaks --------
    • Set Group = (Units in (Playable map area)(((Matching unit) is A Hero) Equal to True))
    • -------- Calculates the total level of the heroes --------
    • Unit Group - Pick every unit in Group and do (Actions)
      • Loop - Actions
        • For each (Integer A) from 1 to (Number of units in Group), do (Actions)
          • Loop - Actions
            • Set Integer = (Integer + (Hero level of (Picked unit)))
    • -------- Sets the tech level of the creeps --------
    • Player - Set the current research level of Iron Forged Swords to (Integer(((Real(Integer)) / (Real((Number of units in Group)))))) for Player 12 (Brown)
    • -------- This may seem strange: I have used "convert to real to integer" --------
    • -------- And after that, I have only used integers, so why did I use the real? --------
    • -------- Well, if the total amount of heroes is 10 and the total level is 45 (for example) --------
    • -------- The result would be '4.5', which is a real and we can't set real tech levels --------
    • -------- That is why we need to convert the real ('4.5' in this case) to an integer. --------


The trigger seems long because of the comments, but it isn't :p
(I use colors in my WE, so it looks better for me... but you can still read it).
 
Status
Not open for further replies.
Top