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

unit spell level

Status
Not open for further replies.
Level 39
Joined
Feb 27, 2007
Messages
5,034
Are the levels of the spells chosen like a hero chooses spells (but can’t choose without the correct upgrade for the level), or are they unit abilities that should be automatically leveled up when the research is finished?
 
Level 9
Joined
Jul 30, 2018
Messages
445
On the Object Editor, there are Techtree - Requirements and Techtree - Requirements - Levels. You can put the other research on the other research's requirements and then put the levels on. For example: if something would require Mithril Forged Swords, you put Iron Forged Swords as the requirement (because that's the base name of the research), but then at the levels field you would put integer 3.
 
Level 9
Joined
Jul 30, 2018
Messages
445
Oh right, spells don't have requirements for each level. Is it a hero ability?

One way to achieve this is to manually increase the level of the ability when the research is researched. This can be done with a simple trigger:
  • Events
    • Unit - A unit Finishes research
  • Conditions
    • (Researched tech-type) Equal to Iron Forged Swords
  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Current research level of Iron Forged Swords for (Triggering player)) Equal to 1
      • Then - Actions
        • Unit - Add Storm Bolt to Hero
      • Else - Actions
    • Unit - Set level of Storm Bolt for Hero to (Current research level of Iron Forged Swords for (Owner of Hero))
If it's a hero and you want to mimic the actual requirements, you have to make copies of the hero ability so that the copies are not hero abilities and there is one for each level. And each ability representing each level have their own requirements. Then you can make a trigger like this:
  • Events
    • Unit - A unit Learns a skill
  • Conditions
    • (Learned Hero Skill) Equal to Holy Light
  • Actions
    • Unit - For (Triggering unit), Ability Holy Light, Disable ability: True, Hide UI: True
    • Unit - Remove Holy Light (Unit Ability Level 1) from (Triggering unit)
    • Unit - Remove Holy Light (Unit Ability Level 2) from (Triggering unit)
    • Unit - Remove Holy Light (Unit Ability Level 3) from (Triggering unit)
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Level of Holy Light for (Triggering unit)) Equal to 1
      • Then - Actions
        • Unit - Add Holy Light (Unit Ability Level 1) to (Triggering unit)
      • Else - Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Level of Holy Light for (Triggering unit)) Equal to 2
      • Then - Actions
        • Unit - Add Holy Light (Unit Ability Level 2) to (Triggering unit)
      • Else - Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Level of Holy Light for (Triggering unit)) Equal to 3
      • Then - Actions
        • Unit - Add Holy Light (Unit Ability Level 3) to (Triggering unit)
      • Else - Actions
Edit: Had wrong event in the first example. It's "A unit Finishes research" not upgrade. Also added an example map with an example to both approaches.
 

Attachments

  • AbilityLevelRequirements.w3x
    18.4 KB · Views: 14
Last edited:
Techs can increase the level of an ability. One defines the tech as requirment for the ability. So it can not be used without the tech.

Then one adds the tech to the unit's techtree list of benefiting/using techs. After having done that set an effect of the tech to level up an ability. With Base = 0, increament = 1. Also choose the Ability that should level up.

With such a setting the first research enables the ability while further ones improve the skill. But only units benefiting from the tech gain Ability Levels.
 
Last edited:
Level 9
Joined
Jul 30, 2018
Messages
445
that trigger will work only in one unit.

Well, you can pick units with the ability and then you can apply the bonus to all of them. But, as Tasyen pointed out, it's all unnecessary and you don't need any triggers. In case you didn't get his explanation: there's an option for researches on the Object Editor: Sieppaa.PNG
 
Status
Not open for further replies.
Top