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

Custom hero ability to increase base attack range of hero

Status
Not open for further replies.
Level 4
Joined
Apr 29, 2020
Messages
59
So, my first thoughts were to use a custom version of the upgrade "Long Rifles" that only my hero would have available in his tech tree and that would have a number of levels equal to a corresponding custom skill i have for the hero to learn. my plan was to use a trigger so that when the hero puts a point into my custom skill, the game would set the player's research tech to have the custom upgrade that only applies to my hero researched..... only problem is i dont seem to have any script that involves ability/upgrade levels. i could just make a bunch of copies of my custom upgrade, but i cannot seem to figure out how to add ability levels into my script, and so this seems kinda impossible.... is there a better way to go about what im trying to do?
 
Level 28
Joined
Feb 18, 2014
Messages
3,579
  • Increase Attack Range
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Increase Range Ability
    • Actions
      • Player - Set the current research level of Increase Range Upgrade to (Level of Increase Range Ability for (Triggering unit)) for (Owner of (Triggering unit))
 
Level 4
Joined
Apr 29, 2020
Messages
59
so thats about where i got to as well... unfortunately it doesnt quite work... assume for this scenario i have 10 levels for the ability i want to affect my hero's range. under the event "unit learns skill" with "learned hero skill" condition there is no way to correlate the level of the ability to the level of the upgrade. with what you have currently, i believe what will happen is everytime my hero puts a point into that ability, regardless of what level, it will set the upgrade to the one value we have defined in the action (not what i want). if there was an "increase level of upgrade" action that would make this work. on the other side of the equation, if i there was a "Learned Hero Skill equal to ability of specific LEVEL" condition this would work. but i cant seem to find either of those functions.... i could also be going about this in the wrong way, but i cant seem to think of any other way to do it
 
Level 3
Joined
Aug 22, 2013
Messages
14
so thats about where i got to as well... unfortunately it doesnt quite work... assume for this scenario i have 10 levels for the ability i want to affect my hero's range. under the event "unit learns skill" with "learned hero skill" condition there is no way to correlate the level of the ability to the level of the upgrade. with what you have currently, i believe what will happen is everytime my hero puts a point into that ability, regardless of what level, it will set the upgrade to the one value we have defined in the action (not what i want). if there was an "increase level of upgrade" action that would make this work. on the other side of the equation, if i there was a "Learned Hero Skill equal to ability of specific LEVEL" condition this would work. but i cant seem to find either of those functions.... i could also be going about this in the wrong way, but i cant seem to think of any other way to do it

There is under (Integer - Units - Level of ability for unit)
 
Level 4
Joined
Apr 29, 2020
Messages
59
ah crap... i have seen the integer function i just didnt realize exactly how it worked. thank you so much. i believe this is what im looking for :)
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,537
You don't need that though, Warseeker's example has it all covered.

See how he sets the Research to the level of the ability. So if the Skill is increased to level 6, the research will be set to level 6 as well. Research will always equal Ability Level.

The "A unit learns a Skill" Event runs every single time you level up a skill, not just the first time you "learn" it.
 
Level 4
Joined
Apr 29, 2020
Messages
59
  • Increase Attack Range
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Increase Range Ability
    • Actions
      • Player - Set the current research level of Increase Range Upgrade to (Level of Increase Range Ability for (Triggering unit)) for (Owner of (Triggering unit))
thank you. this was definitely the correct answer. im sorry, at first glance the script looked like one i had tried before but it wasnt the same. much appreciated :)
 
Status
Not open for further replies.
Top