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

How to create a unit that can level up

Level 15
Joined
Sep 6, 2015
Messages
576
How to create a unit that can level up

This is a detailed tutorial on how to create a unit that can level up based on a hero. It will look and behave just like a real unit, except that it will have the level-up system and attributes. There's a screenshot hereinafter at the end of this post for you to see how it will look.


*If you really want to create a unit that can level up based on a unit, although it's much more complicated, then take a look at this: Unit levelup System???

First step: Creating a custom unit

Open the Object Editor and pick a hero on which you want to base your unit. It is recommended to pick a campaign hero, because there are less things to be changed in the unit properties later. Next, right click the hero and create a "New Custom Unit..." Change its name if you want, be sure the icon of the hero is selected, and click "OK". You now have a custom hero that will be the base of your unit that levels up.​

Second step: Changing the unit's properties


Now that you have your new unit selected, it's time to tweak its unit properties in the Object Editor:
- Remove everything under "Abilities - Hero"
- Remove "Inventory (Hero)" from "Abilities - Normal" if you don't want your unit to have inventory
- Add any ability that you want your unit to possess under "Abilities - Normal"
- Change the "Art - Model File" to any unit model you want your unit to look like
- Change the "Art - Icon - Game Interface" to the icon of your model and remove the "Art - Icon - Score Screen"
- Change the "Combat - Attack 1 - Attack Type" and "Combat - Defense Type" from hero to something else you want
- Change "Stats - Hero - Hide Hero Death Message", "Stats - Hero - Hide Hero Interface Icon", "Stats - Hero - Hide Hero Minimap Display" all to True
- Change "Text - Name" and "Text - Proper Names" both to the name of your unit and remove the extra names, and set "Text - Proper Names Used" to 1
- Remove "Text - Tooltip - Awaken" and "Text - Tooltip - Revive", unless you want your unit to revive
- Change the "Text - Tooltip - Basic", so it doesn't say "Summon (Hero)", but "Train (Unit)" or something else, and "Text - Tooltip - Extended" to whatever you want
- Set "Techtree - Hero Revival Locations" to some random building that isn't used in-game if you don't want your unit to revive
If you leave this field empty, the hero will be able to revive at any building which has "Techtree - Revives Dead Heros" set to True in its Object Editor properties. If you set it to (a) certain building(s), the hero will be able to revive at it if it has "Techtree - Revives Dead Heros" set to True.
- If your unit is based on a campaign hero set "Editor - Categorization - Campaign" to False, and possibly also "Editor - Categorization - Special" to False if it is True
- If your unit is based on a melee hero then you'll need to remove all of its "Techtree - Requirements..." and set "Techtree - Requirements - Tiers Used" to 0
- Change anything else you want, like attack, defense, mana, health, stats, stats per level, build time, build cost, defense and attack upgrade bonuses, upgrades used, the race of the unit, et cetera, and your unit is ready.​

Third step: Additional tweaks (optional)


Now that you have your unit set up, you can also change some additional things which affect it.
Note: Changing these things will affect all hero-based units and heroes.

Navigate to the "Advanced" drop-down menu in the menu bar of your World Editor, click it, and then click "Gameplay Constants..." Here, you can do various things:
- If you want your custom units to level up to a certain level that is different from the default max level (level 10), change "Hero Maximum Level" to the value you want, but don't overdo it, as values over 500 or 1000 can cause problems
- If you want to change the amount of experience needed for each level, change "Hero XP Required - Table" (base experience needed to reach level 2) and "Hero XP Required - Level Factor" (additional experience added to the base experience with each level)
- If you want your elite units to gain experience from destroying buildings, in addition to killing units, change "Hero XP - Building Kills Grant XP" to True
- And there are many more things you can set here...

Navigate to the "Advanced" drop-down menu in the menu bar of your World Editor, click it, and then click "Game Interface..." Here, you can change the interface messages regarding your custom elite units and various other interface aspects:
- If you want to change the interface message for targetting elite units and heroes with an ability that can't target them, change "Text - Message - 'Unable to Target Heroes'"
- Et cetera...

And, finally, in the Object Editor, you can change all spells that have "Stats - Duration - Hero" different from the unit duration so that they are the same, and check if spells can target heroes (which also goes for the elite units) in "Stats - Targets Allowed"; and that's it!

The end result should look something like this:
8RdXEzV.jpg

Enjoy!
 
Last edited:
Level 22
Joined
Aug 27, 2013
Messages
3,973
This is a simple yet useful tutorial for beginners.
Just a question though.
Navigate to the "Advanced" drop-down menu in the menu bar of your World Editor, click it, and then click "Gameplay Constants..." Here, you can do various things:
- If you want your custom units to level up to a certain level that is different from the default max level (level 10), change "Hero Maximum Level" to the value you want
- If you want to change the amount of experience needed for each level, change "Hero XP Required - Table" (base experience needed to reach level 2) and "Hero XP Required - Level Factor" (additional experience added to the base experience with each level)
- If you want your elite units to gain experience from destroying buildings, in addition to killing units, change "Hero XP - Building Kills Grant XP" to True
- And there are many more things you can set here...

And, finally, navigate to the "Advanced" drop-down menu in the menu bar of your World Editor, click it, and then click "Game Interface..." Here, you can change interface messages regarding your custom elite units and various other interface aspects:
- If you want to change the interface message for targetting elite units and heroes with an ability that can't target them, change "Text - Message - 'Unable to Target Heroes'"
Won't this affect all heroes? Including the normal ones?
 
Level 19
Joined
Jul 2, 2011
Messages
2,162
Question

Won't having millions of heroes bug the game?

I noticed when I ran a similar project in the past for a tower defence game. Having over 300 heroes crashes the game.

do you use some sort of trig to prevent this?
 
Level 15
Joined
Sep 6, 2015
Messages
576
Question

Won't having millions of heroes bug the game?

I noticed when I ran a similar project in the past for a tower defence game. Having over 300 heroes crashes the game.

do you use some sort of trig to prevent this?
Well, even if you have 12 players on a map, and each hero/elite unit costing 4 food (they usually cost 5 as heroes), you can have a maximum of 300 heroes, and that is if you have no other units or workers except heroes filling all 100 food for each player.
I've never heard of that bug. Are you sure it happened because of the heroes?
I guess that can be solved by a trigger limiting the number of heroes/elite units that can be trained, though, if such a bug really exists.

Edit: I've just tested it with 1000 heroes on the map and some enemies for killing, and it didn't crash. That crash must have been caused by something else.
 
Last edited:
Level 19
Joined
Jul 2, 2011
Messages
2,162
Well, even if you have 12 players on a map, and each hero/elite unit costing 4 food (they usually cost 5 as heroes), you can have a maximum of 300 heroes, and that is if you have no other units or workers except heroes filling all 100 food for each player.
I've never heard of that bug. Are you sure it happened because of the heroes?
I guess that can be solved by a trigger limiting the number of heroes/elite units that can be trained, though, if such a bug really exists.

Edit: I've just tested it with 1000 heroes on the map and some enemies for killing, and it didn't crash. That crash must have been caused by something else.
Are you sure?

I'm pretty confident on this point.

I believe it has something to do with the fact that the computer has to save up and remember the attributes of so many heroes.
I'll make a similar system on a default map and level up the units, kill and revive them to see if this is the cause


____


Ok I've tested it, no problems what so ever...

I think you forgot to add that you should remove two aspects of the hero though

stats hero - hide hero interface icon : True
Stats hero - hide hero Minimap Display: True


I tried my best to break this system.
I killed and revived the heroes 1000000000 times
I changed their attributes randomly
I also sent large groups to war with each other

No problems

Approved
 
Last edited:
Level 15
Joined
Sep 6, 2015
Messages
576
I think you forgot to add that you should remove too aspects of the hero though

stats hero - hide hero interface icon : True
Stats hero - hid hero Minimap Display: True
It's there already:
- Change "Stats - Hero - Hide Hero Death Message", "Stats - Hero - Hide Hero Interface Icon", "Stats - Hero - Hide Hero Minimap Display" all to True
 
Top