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

[Trigger] adding hero skills

Status
Not open for further replies.
Level 13
Joined
Mar 13, 2013
Messages
299
I would like to be able to have a hero 'purchase' a skill from a shop or something. It would be a standard 3-level hero skill that would be available through point allocation in the normal way. However, when I attempt to do this with the "obvious" method, it doesn't work. i.e.:
  • Unit - Create 1 Paladin for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
  • Unit - Add Acid Bomb to (Last created unit)
The created paladin does, indeed, get acid bomb. But it is level 1 with no way to progress to level 2 (i.e. not available in the training page). And he gets level 1 automatically - without spending a point in it (i.e. at hero level 1 he would have acid bomb AND holy light, if he wanted).

What am I doing wrong?
 
Level 4
Joined
Nov 27, 2012
Messages
85
There is a way to do what you want with the abilities, it's a little complicated, involving Tinker's Engineering Upgrade ability.

By hero training GUI I think you mean the shop or whatever you buy the ability from? Create a region around the shop and detect when the hero enters.
 
Level 13
Joined
Mar 13, 2013
Messages
299
There is a way to do what you want with the abilities, it's a little complicated, involving Tinker's Engineering Upgrade ability.
do you happen to know of anyone who has done it? specifically, a link to such work?
By hero training GUI I think you mean the shop or whatever you buy the ability from? Create a region around the shop and detect when the hero enters.
no, I mean when your hero gains a level, and you go to the hero training tab to select where to allocate your skill point - that GUI.
 
Level 4
Joined
Nov 27, 2012
Messages
85
do you happen to know of anyone who has done it? specifically, a link to such work?
I have a map, but it's entirely in JASS and quite large (a Dota type map, 241 triggers, 268 variables)
There is a guide on the Engineering Upgrade ability, can't find it but try this link
http://www.hiveworkshop.com/forums/world-editor-help-zone-98/adding-hero-skills-menu-170690/

It's best to play around with it a bit, I can try to write something up if I have time later
no, I mean when your hero gains a level, and you go to the hero training tab to select where to allocate your skill point - that GUI.
There's an event for that yes, Game - Hero Abilities Button Clicked
 
Level 13
Joined
Mar 13, 2013
Messages
299
There's an event for that yes, Game - Hero Abilities Button Clicked
what about when they exit the hero ability tab?
I have a map, but it's entirely in JASS and quite large (a Dota type map, 241 triggers, 268 variables)
There is a guide on the Engineering Upgrade ability, can't find it but try this link
Adding To Hero Skills Menu

It's best to play around with it a bit, I can try to write something up if I have time later
there's no need. This would only work if I could either detect when a person leaves the hero training menu (in which case I have a much simpler way in mind), or can allow an ability to be trained, but with no icon to indicate that it is available for 'use.' i.e. training devotion aura for a paladin would, indeed, grant the armor and display the aura, but in the paladin's command aura the passive "devotion aura" icon would not be visible. Do you know a way to do that?
 
Last edited:
Level 4
Joined
Nov 27, 2012
Messages
85
what about when they exit the hero ability tab?
I don't believe so.

there's no need. This would only work if I could either detect when a person leaves the hero training menu (in which case I have a much simpler way in mind), or can allow an ability to be trained, but with no icon to indicate that it is available for 'use.' i.e. training devotion aura for a paladin would, indeed, grant the armor and display the aura, but in the paladin's command aura the passive "devotion aura" icon would not be visible. Do you know a way to do that?

I believe this is what you're looking for
http://www.thehelper.net/threads/how-to-make-spellbooks.27637/

If you want the ability to be hidden like so, yet still upgradeable
54363d1242161149-ability-without-icon-removing-hiding-ability-icon-capture.jpg
 
There is much simpler that what you are trying to do.

Just make it do what you want by using the specific GUI commands.

Add ability - then unlearn with tome of retraining. Then add back the other spells. The ability will be ready to learn but not active.

You should be able to learn the ability. Make sure "Hero Ability" is set to "true" in OE.

You could also make it so that the only way to upgrade is to buy it.

There is no GUI way to detect when a player enters the "learn ability" option menu.

But, why would you need that?
 
Level 4
Joined
Nov 27, 2012
Messages
85
There is no GUI way to detect when a player enters the "learn ability" option menu.

  • Game - The 'Hero Abilities' button is clicked
@normalice - I'd like to help you further but I'm not entirely sure what you're trying to achieve. If you can explain this skill in more detail (why does it have to be when they exit the Abilities menu?) perhaps I can help
 
Level 13
Joined
Mar 13, 2013
Messages
299
  • Game - The 'Hero Abilities' button is clicked
@normalice - I'd like to help you further but I'm not entirely sure what you're trying to achieve. If you can explain this skill in more detail (why does it have to be when they exit the Abilities menu?) perhaps I can help

basically, a shop has several pages of skills. A hero (with only two abilities and an ultimate) can go to the shop and purchase any skill shown. Once purchased, they can allocate skill points in that skill, just like they would if it were one of their normal abilities.
 
Level 4
Joined
Nov 27, 2012
Messages
85
Ok, so when the ability is purchased, the hero doesn't automatically learn it, it's just added to their abilities tab, where they can then spend a point. Is that right?

If so then Engineering Upgrade is what you want, and it may also still be possible with Spellbook.
Let me see what will work
 
Level 13
Joined
Mar 13, 2013
Messages
299
Ok, so when the ability is purchased, the hero doesn't automatically learn it, it's just added to their abilities tab, where they can then spend a point. Is that right?

If so then Engineering Upgrade is what you want, and it may also still be possible with Spellbook.
Let me see what will work

I wanted to avoid the spellbook because there could be up to 36 different heroes in a game.

I have a way to do it, but it's not quite as elegant as I'd like..
 
Level 4
Joined
Nov 27, 2012
Messages
85
I'm not sure if this would work and cant test right now, also cant remember how spellbook actually works, but you could add all the spells into the spellbook, and disable them all at start. Then enable the ones purchased when the hero gets a skill point.


Side note: My map has 48 heroes, 10 players, each hero gets 4 random abilities at start from a pool of 100+ abilities. Done through Engineering Upgrade, so EU WILL work, but I'm not sure about hiding the icon.
 
Level 4
Joined
Nov 27, 2012
Messages
85
Only through dummy abilities and triggers I think.
Some abilities don't have icons when added to a hero, you can use one of those + Engineering Upgrade or Engineering Upgrade + Spellbook to achieve what you want.

Attached is a demo map with a basic model of how this will work, and here are some resources

http://www.hiveworkshop.com/forums/general-mapping-tutorials-278/disable-ability-specific-hero-unit-225879/

and

ANeg (Engineering Upgrade): The engineering upgrade finally solves the problem of not levelable trigger added hero skills. It allows to add hero skills with triggers and to still have them in the levelup menu. Therefore the hero needs to have dummy hero skills that can then be replaced by the actual skills. The placeholder skills need to have the same amount of levels and level skip requirements that's why you will probably need one for ultimates and one for normal hero skills. I usually base my placeholder skills off of Arpb (Replenish) but the base skill really shouldn't matter. The placeholder with 3 levels and 2 levels skip can simply be given to the hero several times. Then the placeholder skills must be disabled for all players at map initialization, so they don't show up in the levelup menu at first. Then you will just need an adder ability based off of engineering upgrade for each skill that you might want to have on the hero. The upgrade will replace the skills in the order of their ability upgrade field when it's added, and replace them backwards when it's removed. So if you want to abuse the engineering upgrade but don't want the passive upgrade icon on the unit you can simply have an engineering upgrade with the abilities B, A in the upgrade field and then when you add and remove it on a unit that has A it will then have B. That's because adding it will do nothing as B is not there, but removing it will replace A with B. As soon as a hero ability has been added that way it will be learnable in the levelup menu. Note that replacing skills only works well for unlearned hero skills. Replacing learned skills or normal unit skills will not actually replace them, it will just update the fields like range, area of effect, duration, icon, targets allowed, and so on, but will not change the hardcoded part of the ability. For example changing an aura to the heal ability will only change the icon, tooltips, range and probably some other fields, but it will still be an aura. If the ability that is being replaced is disabled at the time the results become even weirder and you can never know what you will get. Also the engineering upgrade only works for heroes, adding it to normal units will crash the game for some reason. Another weird bug with it is, that you have to specify all four upgraded abilities, otherwise it might not work. If you only want to upgrade one ability, you can simply specify ability ids that the unit will never have for the rest. Also dynamic tooltips like <dataA5> are flawed above level 3. Also the default buff shouldn't be replaced, but it doesn't show up anyway, so that's not really an issue.
 

Attachments

  • eu.w3x
    17.2 KB · Views: 205
Level 12
Joined
Oct 16, 2010
Messages
680
I think there is might be another way around this

I'm not shure but i think you can set research requirements for hero abilities as well

that way you can give the hero all of the abilities that could be learned and trigger the purchase and set the research uniquely for every spell

Of course that means u need as many custom researches as many skills the hero can posess but that way you can use the default leveling menu.

Just an idea can't test it right now, but i think it worth a try

EDIT: NWM i forgot the 5 ability limit/hero thing:p
 

sentrywiz

S

sentrywiz

I have done what you're asking for.

Its made through research upgrades. Heroes buy research upgrades and that gives them a spell or increases a spell's level.
Its not done through a shop, but you can also do it like that, only it will take a different approach.

Its also the base system in the Assassins map by Baintastic.
Here is a link: http://www.hiveworkshop.com/forums/maps-564/assassins-v4-1-ai-141082/?prev=search%3DAssassins%26d%3Dlist%26r%3D20 download it, play it and see if this is what you are asking for.

I can tell you how its done, but its rather tedious and complex. It involves lot of triggers and lot of object editor work.
Because each spell / upgrade can be bought at any time, that changes the hotkey it's supposed to be used at.

For example if I have 10 spells to be bought, buying one spell now will give me the hotkey to Q, and buying it later might
give me the hotkey to E, R or anything else.
 
Status
Not open for further replies.
Top