• 🏆 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!
  • ✅ The POLL for Hive's Texturing Contest #33 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!

No idea how to do this trigger

Status
Not open for further replies.
Level 4
Joined
Aug 17, 2014
Messages
102
So I want to know if it is possible to make a GUI trigger that will modify a heroes attributes constantly based off of his other attributes. For example one of my heroes has a passive that increases his Agility by 20% of whatever his Strength is. Problem is I cant figure out a way to make that number constantly refresh considering there are items that give strength as well as by leveling up.
 
Level 9
Joined
Apr 23, 2011
Messages
527
Something like this.

  • Events
    • Time - Every 1.00 seconds of game-time
  • Conditions
    • (Level of AgiToStrAbility for HeroUnit) Greater than 0
  • Actions
    • Set BaseAgi = (starting strength of hero) + (str per level x level of hero)
    • // Getting the base agi just so it doesn't keep adding up
    • Set Str = (Strength of hero x 0.20)
    • Hero - Set Agility of HeroUnit to (BaseAgi + Str)
Both variables are integers. You can find the relevant functions yourself as I can't use the Editor right now.
 
Level 4
Joined
Aug 17, 2014
Messages
102
Something like this.

  • Events
    • Time - Every 1.00 seconds of game-time
  • Conditions
    • (Level of AgiToStrAbility for HeroUnit) Greater than 0
  • Actions
    • Set BaseAgi = (starting strength of hero) + (str per level x level of hero)
    • // Getting the base agi just so it doesn't keep adding up
    • Set Str = (Strength of hero x 0.20)
    • Hero - Set Agility of HeroUnit to (BaseAgi + Str)
Both variables are integers. You can find the relevant functions yourself as I can't use the Editor right now.
upload_2018-7-12_0-4-39.png

So I tried to do it as you said, but somehow it still does not add correctly and does not seem to work for when I equip an item oddly enough. Also when my hero has 18 Intelligence 15% of that is 2.7 and I have noticed before that the game either rounds up or down, but for some reason it only added 2 strength, do you think changing the variables from integers to real may fix that?

EDIT:

upload_2018-7-12_0-15-24.png

The heroes base Strength is 14 and technically it is adding the bonus 15% Intelligence correctly (2.1), but with an item equipped it should be adding (4.35)
 
Last edited:
Level 4
Joined
Aug 17, 2014
Messages
102
View attachment 302328
So I tried to do it as you said, but somehow it still does not add correctly and does not seem to work for when I equip an item oddly enough. Also when my hero has 18 Intelligence 15% of that is 2.7 and I have noticed before that the game either rounds up or down, but for some reason it only added 2 strength, do you think changing the variables from integers to real may fix that?

EDIT:

View attachment 302329
The heroes base Strength is 14 and technically it is adding the bonus 15% Intelligence correctly (2.1), but with an item equipped it should be adding (4.35)
upload_2018-7-12_0-34-26.png

I changed the bonus integer into a real and it seemed to of had resolved the issue... weird...
 
Status
Not open for further replies.
Top