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

[Solved] How to choose stats to my hero

Status
Not open for further replies.
Level 3
Joined
Jul 27, 2016
Messages
33
I will have my heroes select stats in a box in the same interface where the spells are chosen, creating a second interface where each of the boxes correspond to a stat.
I have 10 different stats, each stats can increase strength, agility, intelligence, critical strike chance, critical strike power or hit points, ect ...
I would like that when we click on the corresponding box the variable counting the number of points in the stat increases by 1. My variable is an integer.



Step in picture,
I wish that when you select the hero and click on the box...:
F95gYZ.png


...Get this below and when you click on the color box in blue...:
8Ftnv1.png



You get an interface as below and have each of the stats to be able to increase them by one point by clicking on the box:
ymSs6H.png

For example this screen was taken on TKoK


Sorry for my english and thanks for help

Łapin Viktus(fr)
 

Jampion

Code Reviewer
Level 15
Joined
Mar 25, 2016
Messages
1,327
The only buttons, that are shown in the hero skill box are hero skills, so your blue button would have to be a hero skill, that can be learned. You can detect when it's learned and unlearn it afterwards to know when it is used.
However opening up a new box is difficult. Maybe you can use a spellbook.
For example this screen was taken on TKoK
What is TKok?
 
Level 3
Joined
Jul 27, 2016
Messages
33
If the blue button for the Stats is a spell, then it will require a skill point every time we click on it. I think it's too complicated to do this way, if we use a spellbook directly to the left of the button to choose the spell. How to create Stats buttons in the spellbook ?

Thanks for help.
 

Jampion

Code Reviewer
Level 15
Joined
Mar 25, 2016
Messages
1,327
Well, you just need a dummy skill, detect when it's used and change the variable. I would use Channel as base spell, because you can change its order id.
You probably need something to prevent the player from endlessly increase stats, so maybe make a techtree requirement.
Use a unit called "Stats Point" and the spellbook requires the unit "Stats Point" to be used. When the integer variable statsPoints is 0, you change the owner of the unit to neutral, so the player can no longer use the spellbook. When statsPoints increases to 1, you change the owner back to the player.
 
Level 3
Joined
Jul 27, 2016
Messages
33
I do not know how to do :
Well, you just need a dummy skill, detect when it's used and change the variable. I would use Channel as base spell, because you can change its order id.
You probably need something to prevent the player from endlessly increase stats, so maybe make a techtree requirement.
Use a unit called "Stats Point" and the spellbook requires the unit "Stats Point" to be used. When the integer variable statsPoints is 0, you change the owner of the unit to neutral, so the player can no longer use the spellbook. When statsPoints increases to 1, you change the owner back to the player.

Could you explain precisely or make the trigger on a downloadable map.

Thanks
 

Jampion

Code Reviewer
Level 15
Joined
Mar 25, 2016
Messages
1,327
Use escape to add stats points, use the book to spend your stats points.
Obviously the stats have no effect in my map - just variables.
You will have to make it MUI using arrays probably.
If you want the spell book to close, whenever you learn a skill, set the cooldown of the learn skills (or maybe the book works as well, didn't test) to >0.
 

Attachments

  • Stats.w3x
    18.1 KB · Views: 43

Jampion

Code Reviewer
Level 15
Joined
Mar 25, 2016
Messages
1,327
Anything, that is not used twice. So if your hero can have acidbomb, don't give it acidbomb. Apart from that you can take anything.
I would try to avoid orders you don't know, because they could be some kind of generic orders every unit can have like "smart".
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,191
...Get this below and when you click on the color box in blue...:
Not possible directly in WC3. In SC2 one could add a nested command card with the desired functionality.

If the blue button for the Stats is a spell, then it will require a skill point every time we click on it. I think it's too complicated to do this way, if we use a spellbook directly to the left of the button to choose the spell. How to create Stats buttons in the spellbook ?
It will be learned when clicked and need at least 1 spendable ability point. This point could be refunded immediately upon being learnt. The player is then taken to a different command card (eg a spell book, or another unit) which allows for stat selection.
 
Level 15
Joined
Aug 14, 2007
Messages
936
Spell book is the only way to go, remember to use spells like starfall which require channel, they cast instantly

Edit: If you want the number icon, you can use custom icon edited by photoshop with numbers up to 3 or even 10, why would people save more than 3 points of attribute unless they are afk. Well then you can refresh by intervals of 10 once they have exceeded 10 spare points, put another image that says * instead of numbers.
 
Status
Not open for further replies.
Top