• 🏆 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] Trying to make heroes learn random spells

Status
Not open for further replies.

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
If you mean learn as in allocate a skill point to one of a heroes many learnable abilities then your triggers will not work as you are adding the ability instead of learning the ability. Learning an ability is an order of sorts that is issued to the unit.

If you mean learn as in add an ability to a unit then yes the triggers will work.
 
Level 4
Joined
May 26, 2011
Messages
80
If you mean learn as in allocate a skill point to one of a heroes many learnable abilities then your triggers will not work as you are adding the ability instead of learning the ability. Learning an ability is an order of sorts that is issued to the unit.

If you mean learn as in add an ability to a unit then yes the triggers will work.

Nay I want to add abilities not upgrade them and those triggers don't work.

I think it's "Unit - Add Offensive_abilities[(Random integer number between 1 and 3)] to (Entering unit)" that is broken because any other actions work.
 
Last edited:
Level 21
Joined
Mar 27, 2012
Messages
3,232
There is one way, but it's not pleasant.
If an ability has not been learned yet, it can be replaced with Engineering Upgrade.
Put untrainable(req. level 999) dummy abilities in every slot, then swap them out through engineering upgrade.
If you set up Engineering Upgrade right, you can just add and remove it once to swap the ability permanently.
"Right" means that while normally you would put the initial ability in the first slot and the replaced one in the second, I would put them the other way around. The advantage is that you won't have to hide the engineering upgrade button that way.
The reason it's not pleasant is that you will need lots of abilities for this unless you limit choices a lot.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
It is very much possible and I've done it.
Except...
The reason it's not pleasant is that you will need lots of abilities for this unless you limit choices a lot.
Hence it is not really possible. It is only possible if one "limit choices a lot". One could also create many different hero unit types with different hero abilities and randomly choose them and this also is only possible if one limits choices a lot.
Think i'll allow players to upgrade their spells by buying them. I'll remove the spell and add an upgraded version of it to their heroes.
This approach works quite well, seen it in a lot of "custom hero" maps.
 
Status
Not open for further replies.
Top