Stat-Based Abilities

Nurdguy

New Member
Reaction score
0
Greetings,

I've been reading the great tutorials here and playing around in the editor for a few days and I can't seem to figure out a number of things. I have made a unit with a custom ability and modified the tooltip to pull in from the damage of the effect rather than hard-code the number. I've read about how to make stats on heroes but haven't tried it myself yet because I'm not yet sure if I want it to be an attribute or if it needs to be something else.

What I'd like to do is to make an ability that scales based on a stat (or any numerical data, whether it's a trigger variable or something else is fine as well). The core idea is that the ability's damage and range (or any two properties.. cd, cost, radius, etc) are each based on different stats.

For a more concrete example, let's take something simple like snipe. How could I make it's damage scale with one stat (damage = 50 + (2*strength)) and make it's cast range scale with a second stat (range = 1 + (agility/2))?

As a bonus, could the tooltip still reflect the actual scaled number? For instance, if I have 10 strength, could it say 70 damage? At 11 strength, read 72 damage. Etc.

I have many more questions.. I must confess I'm not having much luck figuring things out myself. But I figure I should keep it to one question per thread and I'm starting with this one. Would really appreciate any help. I know the Custom Hero Defense map (my inspiration for the game I'm ultimately trying to make) has damage scaling via a "Potential" stat and the Ghost hero has a passive that increases the range of all abilities so I'm hoping my idea is actually possible, but I haven't been able to find any questions or tutorials here or via google searches. Thanks! :)

Answer

Of course I ask the question and then I finally find the answer. Or something that could work pretty well for my needs.

There's a trigger action called Catalog Reference Set which seems to allow you to set any data editor value (there's also Catalog Field Value Set but I didn't understand it). And the nice part is that it's specific to a certain player (NOTE: not specific to an individual unit though). Since in my map, each player will control only one hero, I can set up triggers so that when a hero's stat changes, it'll update the data for the effects tied that hero's abilities.

I did a simple test that whenever player 1 uses the damage effect of the hero's abilities, it would get the hero's health and the effects damage and store them to variables. I incremented health by 50 and damage by 1 and then set them back in the data and watched as my hero's health increased and the damage relayed in the ability's tooltip increased. I had placed the hero twice on the map for player 1 and a few times for another player. Both of copies of the hero had their health and damage increased (as expected, it's per player), the heroes owned by the other player did not change in health. So it seems to be a great success!

I did run into a small got'cha that seems worth mentioning: I originally stored the damage as a real value, incremented it by 1.5, and then set it. The first time I then used the ability the damage increased by 2. The second time I used it, I got an error reading it. I believe this is because the amount is actually stored as an integer, not a real, so doing this would necessitate using like Math.floor when setting the value. There's nothing in the trigger editor to point out that it's going to fail so play with caution. :)

Sources:
www.sc2mapster.com/forums/development/data/29687-stat-attribute-based-abilities/
www.youtube.com/watch?v=64x8jRL5np0
 

X-maul

AKA: Demtrod
Reaction score
201
So this means you solved your question? :)
If not, I made a map with heroes, and the stat Ability Power, meaning that it increased the damage of some of the abilities :)

The way I did it, was to make a trigger that launched every time that a damage effect was used, and then checked the amount of the Ability Power attribute for the casting unit, and dealt bonus damage relative to that.

I'm not entirely sure if I made the trigger call an integer set when the attribute changed, but if you want me to elaborate, I'll be happy to find the system again :)
 

Nurdguy

New Member
Reaction score
0
I did end up finding an answer a couple hours later while digging through google some more. Thanks :)

I read about the trigger system idea.. it sounds like the simplest way to go but it only works for scaling damage, right? And the damage wouldn't be visible in the tooltip. However, I'd still love to take a look at what you did if you wouldn't mind finding it. :) It'd be nice to see someone else's work and how you set things up.

I'm still flying by the seat of my pants trying to figure all this out, and trying to break my old wc3 habits. Like when I needed to give vision of a diagonal corridor I originally started making invisible units to place in it rather than using the new diamond-shape for regions to give visibility. Glad I got that figured out the unit idea was ugly!
 

X-maul

AKA: Demtrod
Reaction score
201
I'll find it as soon as I get the time. In tooltips you can refer to effects for the player, so what I did, was to have an effect (not used by anything) named it Ability Power and refered to it in tooltips, so my tooltips looked something like the:
Deals 100 (+(0.7*Ability Power)) damage.
What I did, was to set a field in the effect using triggers, to the same as the stat for the hero.

This only works for 1 unit per player though, but as I used it for a hero map with 1 unit per player, it worked for me. I guess it's possible to do for multiple units aswell, but not with this system. :)

I'll find it for you as soon as I get the time :)
 

Nurdguy

New Member
Reaction score
0
Oh cool. Hm. That's a neat way of doing it. I also have just one hero per player. :)
 

X-maul

AKA: Demtrod
Reaction score
201
Sorry for not respondin' - I'll fetch it for ya in a few days - pretty busy sketchual these days, with all those christmas dinners comin' up. I see a hole comin' up thursdag or so, will probably have time to share it with ya :)
 

Nurdguy

New Member
Reaction score
0
Np been busy too. Just finished my spawn triggers thinking of turning it into a library. Trying to find a good community, sc2mapster seems to have the biggest but the forums are hideous and lack so many features. My hero development has kind of stagnated. Been drawing up a design document and planning things but I'm at such a loss when it comes to developing abilities. Anyhow. /end rant
 

X-maul

AKA: Demtrod
Reaction score
201
Sorry for not coming back here. I've been so damn bussy, havent opened my gaming computer for 14 days now. You can hit me up on skype, (check my member info) and I'll give you a helping hand, I'm pretty innovative, and I might be able to help finish hero concepts.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top