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

[General] Allowing unit training by the level of hero

Status
Not open for further replies.
Level 3
Joined
Mar 5, 2015
Messages
21
Hi, I am trying to make my map to Warcraft III (obviously) and I have a little problem. :grin:

What I need to do is: I have a hero, let's just call him "Hero" and a building, let's call it "Barracks". I want to train units in Barracks, but allow training of only those units, that Hero has enough level to train.

:fp: For example, I have let's say "Soldier", who can be trained on Hero level 1, and then "Archer", who can be trained on level 2. I need the training of Archer to be disabled until Hero reaches level 2.

I hope y'all understand what I am trying to say, and I will always love you if you could help me with this. I litteraly have no idea how to make this work. :eekani:

Thank you, if just for reading, and thank you more for suggestions! :wink:
 
Make as event that (your) hero levels up.
You can check the hero's level via "Integer Comparison".
As action there is a function that can enable/disable training:

  • Player - Make <UnitType> available for training/construction by Player 1 (Red)

At map start you can disable training for certain units, so they are deactivated by default.
 
Level 25
Joined
May 11, 2007
Messages
4,651
A more visible but with a bit more work:
Create a dummy unit named "Hero level 2" with locust and no vision and tree of life upgrade art as it's model.
Set it to be the required tech for the Archer unit.

Then create a trigger that checks for when your hero gains a level, check which level it is, if it's level 2 then create the dummy unit in your map.

Same for level 3 and so on.

This allows the players to see which levels give which units.
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
There is this nice method that you can do something nice.
What IcemanBo said works but I am not a fan of no visuals.

What I would do is make a new unittype and name the unit "Level 2", "Level 3", etc.
When a hero reaches level 2, create "Level 2" for leveled hero. Do that for every level.
The units must be locust and have no model, food cost, etc.

Then you can go to your "Soldier" and make a new requirement in the object editor.
As requirement, the player must have a unit of "Level 2".

That way, you are able to see what unit types you can unlock and when you unlock them.

EDIT:
omg LordDz couldn't you wait 1 minute???
 
Status
Not open for further replies.
Top