I am trying to make a Diablo 2 style stats system for my new map. i.e. the hero has Strength, Agility, etc; when he gains level, he gets some stats points. Player can choose to distribute the stats points to Strength, Agility, etc however he likes.
I tried using the Ability and Research but failed. Another possible but stupid way is to make a lot of different version of Strength behavior and use Ability: apply behavior / remove behavior. However, if my hero has 10 level, then I will need to make 10 Behavior and 10 Ability for each stats.....
check out Vexal's Team Tower Defence Map. The Heroes in that Map gain Stat points which you can use to purchase certain stats. Its pretty much exactly what you want.
The way it looks like its done (atleast to me), is he has a Seperate Stat which records how many Stat Points you have to Spend. The only problem with this is you can only have 3 stats since the 4th would be your Spendable Stat Points.
There's a Behavior subtype called Attribute. It grants certain bonuses of your choosing to a character. You add an Attribute to a Hero unit with veterancy and the Hero will have that Attribute at level 0.
You can then add points to an Attribute and the bonuses will stack. For example, my Armor attribute adds 1 Life Armor, 10 Life and 1 Life regeneration per point, and with 5 Armor you will as excepted have +5 Life Armor, +50 Life and +5 Life regeneration.
I however have all my level ups done automatically according to predefined class values, so I can't help you with how to add them according to player choices.
I don't have the editor here, but if you can do +1 Strenght on a unit with an trigger, you can do it with triggers.
Create your own variable for stat points.
Any unit gains add a level -> add +5 stat points or whatever to that player.
Create a dialog with buttons for increase each stat, and use triggers for each one. Every time the player hits a button of that dialog, you call a trigger, check if Stat Point >0, then remove a Stat Point and add +1 Strenght or whatever does the button pressed. You can hide that dialog only if the hero has no stat points avaliable. Or you can show the stat dialog only if the player hits another button or some key.
I wouldn't shy away from triggers either, they can very easily modify stats for units and considering how rare skill choices are in most games aren't detrimental to game performance in general. You can also create your own custom UI this way to fit the needs of your game.
Edit: Basically what frOdObOlsOn said just seconds before me :P
Actually, I would like to avoid using trigger as much as possible for these types of thing, as my map already has used tons of triggers for different fights and events and will have even more as I continue on it. However, if data editor fails to do this, I will go back to trigger.
Try to do another veteracy with the same levels with another learn skill. With only 1 skill for each stat you want. Put an additional submenu named Distribute Stat Points, and put your X increase stat skills there.
Probably will work if doesn't interact awfully with your other veteracy.
I have three abilities: Add stat 1, add stat 2, add stat 3.
Each ability has the requirement "Have skill points" so you can only use the abilities if you have the skill points. You don't need to make these abilities. You can also have a dialog, or anything you'd like. You also do not need to keep track of your skill points with a stat. It's just what I did. You can use a variable, but if you do that, you should use a dialog for adding stats.
To add the stats, either with dialog, or with ability, is the same. Create a behavior of type buff. Have this buff increase your stat by 1. Have your add stat abilities, (or your add stat dialog) add an additional count of this buff (if you choose to use the dialog, add the buff with a trigger). Each time you add this buff again, it will increase that by 1. As far as I know, you can't have an ability directly modify the attribute count. It did not work when I tried it. So you need the ability to add a buff to your unit, and that buff adds 1 stat count.
Repeat for however many stats you wish to have.
Feel free to respond for clarification.
- Vexal
EDIT: One more thing: If you don't want the skill points you have not spent to show on the hero, you can still use an attribute to keep track of them. Set the attribute to "hidden" in its flags. I forgot to mention that your stat buff, in addition to adding 1 to the stat, should add -1 to your skill point attribute. That's what I did.
Here is a system I made sorry thought I had posted it on all relevent posts that were not ancient. See no one bothered to look at the wiki about the learn ability. With some minor modification of the requirements you can get it to also support possitive and negative attributes from items
I am trying to make a Diablo 2 style stats system for my new map. i.e. the hero has Strength, Agility, etc; when he gains level, he gets some stats points. Player can choose to distribute the stats points to Strength, Agility, etc however he likes.
I tried using the Ability and Research but failed. Another possible but stupid way is to make a lot of different version of Strength behavior and use Ability: apply behavior / remove behavior. However, if my hero has 10 level, then I will need to make 10 Behavior and 10 Ability for each stats.....
Does anyone know how to do it better?
@Wakeman: Go
check out Vexal's Team Tower Defence Map. The Heroes in that Map gain Stat points which you can use to purchase certain stats. Its pretty much exactly what you want.
The way it looks like its done (atleast to me), is he has a Seperate Stat which records how many Stat Points you have to Spend. The only problem with this is you can only have 3 stats since the 4th would be your Spendable Stat Points.
Thanks! I'll check that out, when I'm back home. Have anyone checked how the author did it?
There's a Behavior subtype called Attribute. It grants certain bonuses of your choosing to a character. You add an Attribute to a Hero unit with veterancy and the Hero will have that Attribute at level 0.
You can then add points to an Attribute and the bonuses will stack. For example, my Armor attribute adds 1 Life Armor, 10 Life and 1 Life regeneration per point, and with 5 Armor you will as excepted have +5 Life Armor, +50 Life and +5 Life regeneration.
I however have all my level ups done automatically according to predefined class values, so I can't help you with how to add them according to player choices.
I don't have the editor here, but if you can do +1 Strenght on a unit with an trigger, you can do it with triggers.
Create your own variable for stat points.
Any unit gains add a level -> add +5 stat points or whatever to that player.
Create a dialog with buttons for increase each stat, and use triggers for each one. Every time the player hits a button of that dialog, you call a trigger, check if Stat Point >0, then remove a Stat Point and add +1 Strenght or whatever does the button pressed. You can hide that dialog only if the hero has no stat points avaliable. Or you can show the stat dialog only if the player hits another button or some key.
I wouldn't shy away from triggers either, they can very easily modify stats for units and considering how rare skill choices are in most games aren't detrimental to game performance in general. You can also create your own custom UI this way to fit the needs of your game.
Edit: Basically what frOdObOlsOn said just seconds before me :P
Thanks.
Actually, I would like to avoid using trigger as much as possible for these types of thing, as my map already has used tons of triggers for different fights and events and will have even more as I continue on it. However, if data editor fails to do this, I will go back to trigger.
@Wakeman: Go
Try to do another veteracy with the same levels with another learn skill. With only 1 skill for each stat you want. Put an additional submenu named Distribute Stat Points, and put your X increase stat skills there.
Probably will work if doesn't interact awfully with your other veteracy.
@Wakeman:
How I did it in my map (Vexal TD)
I have three abilities: Add stat 1, add stat 2, add stat 3.
Each ability has the requirement "Have skill points" so you can only use the abilities if you have the skill points. You don't need to make these abilities. You can also have a dialog, or anything you'd like. You also do not need to keep track of your skill points with a stat. It's just what I did. You can use a variable, but if you do that, you should use a dialog for adding stats.
To add the stats, either with dialog, or with ability, is the same. Create a behavior of type buff. Have this buff increase your stat by 1. Have your add stat abilities, (or your add stat dialog) add an additional count of this buff (if you choose to use the dialog, add the buff with a trigger). Each time you add this buff again, it will increase that by 1. As far as I know, you can't have an ability directly modify the attribute count. It did not work when I tried it. So you need the ability to add a buff to your unit, and that buff adds 1 stat count.
Repeat for however many stats you wish to have.
Feel free to respond for clarification.
- Vexal
EDIT: One more thing: If you don't want the skill points you have not spent to show on the hero, you can still use an attribute to keep track of them. Set the attribute to "hidden" in its flags. I forgot to mention that your stat buff, in addition to adding 1 to the stat, should add -1 to your skill point attribute. That's what I did.
Thanks again! Very detailed explanation! I'll try both methods and see which fits my map!
@Vexal: Go
What ability type do the "Add Stat"s have to be? I can't figure out how to make an ability directly affect the behavior with the +1 Strength.
EDIT: also, I can't figure out how to make the requirement.
BUMB!! :P
Here is a system I made sorry thought I had posted it on all relevent posts that were not ancient. See no one bothered to look at the wiki about the learn ability. With some minor modification of the requirements you can get it to also support possitive and negative attributes from items
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
https://www.sc2mapster.com/forums/resources/tutorials/179654-data-actor-events-message-texture-select-by-id
https://media.forgecdn.net/attachments/187/40/Screenshot2011-04-17_09_16_21.jpg