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

Learn spells for two forms

Status
Not open for further replies.
Level 6
Joined
Jul 22, 2021
Messages
50
Hello guys,

So I have a hero which has two alternate forms and I want it to have two different skill sets.

I want to create a trigger that does the following thing:
Unit learns new skill --> Add ability to unit's alternate form

When the hero learns a skill it automatically appears in its hotkey bar. But the problem is that my hero unit has an alternate form based on the Bear Form spell.

I can add both heroic and normal abilities to this alternate form unit, the same as the original one.

I have two problems:

  • I cannot pick the unit's alternate form in the following action:
    Unit - Add ability
    • Guess I should create some sort of variable, am I right?

  • Can't find the condition for (Learned Hero Skill)

I'm also not sure if this methodology is correct I will look around the issue more tomorrow because I'm a bit sleepy 💤
 
Level 13
Joined
Jul 12, 2018
Messages
510
you probably need to trigger the skill-add to happen when you turn into the 2nd form. You can't add the ability to a nonexistant unit and it's the same unit, so you cant add it at the same time the first skill is learned.
Use set ability for unit, and if necessary save the level of the ability in an integer and then reference it.

Condition: Learned Hero Skill is under "Hero skill comparison"
 
Level 6
Joined
Jul 22, 2021
Messages
50
Thanks for the reply.

Based on your words, the workaround I see here is to create a trigger with the condition: if hero learns "Q skill" then enable "Q2 skill" in the 2nd form. That's how I understand this at least. Is my logic correct?
you probably need to trigger the skill-add to happen when you turn into the 2nd form
Any tips on how can I do exactly that?
I still have a problem adding (or removing) abilities from alternate form via triggers. Tried to play with the unit variable but something's wrong.
To sum up - I have a problem picking the right unit.

PS. I just noticed that spell learned transfers into 2nd form. I definitely don't want that.
 
Level 13
Joined
Jul 12, 2018
Messages
510
exactly. here's how i have it set up for a bear form type of hero in my map. Ability1 is the one you learn in druid form, Ability2 is the one the bear form gets.
1. Disable ability2 for player on map init.
2. Trigger: Hero ability learned, Condition: it's Ability1, Action: Enable ability2 for player.
3. Trigger: Unit starts the effect of FormChangeAbility. If it's from Form1 to Form2, enable Ability2, Set level of ability2 for unit to level of ability1 for unit. and vice versa ofc.
 
Level 6
Joined
Jul 22, 2021
Messages
50
Okay, so I managed to make it work, it was kinda messy and buggy. What helped was setting the spells to unit abilities instead of heroic ones.

I made "Defend / Cripling Shot" - a learnable spell that enables the skill for both forms.

In the spoiler below there are triggers for those interested.

Thanks for the help. Problem solved.

  • No spell learned
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Player - Disable Crippling Arrows for Player 2 (Blue)
      • Player - Disable Defend for Player 2 (Blue)
  • Q learned
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Defend / Crippling Shot
    • Actions
      • Player - Enable Crippling Arrows for Player 2 (Blue)
      • Player - Enable Defend for Player 2 (Blue)
      • Player - Disable Defend / Crippling Shot for Player 2 (Blue)
 
Level 12
Joined
Mar 13, 2020
Messages
421
Okay, so I managed to make it work, it was kinda messy and buggy. What helped was setting the spells to unit abilities instead of heroic ones.

I made "Defend / Cripling Shot" - a learnable spell that enables the skill for both forms.

In the spoiler below there are triggers for those interested.

Thanks for the help. Problem solved.

  • No spell learned
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Player - Disable Crippling Arrows for Player 2 (Blue)
      • Player - Disable Defend for Player 2 (Blue)
  • Q learned
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Defend / Crippling Shot
    • Actions
      • Player - Enable Crippling Arrows for Player 2 (Blue)
      • Player - Enable Defend for Player 2 (Blue)
      • Player - Disable Defend / Crippling Shot for Player 2 (Blue)
You need to use Unit Abilitys for each other form your Hero use only the original form should use Hero Abilitys

Just use Unit Abilities with Levels and you are fine

Use for the Reference player a Unit[Array]
Enable Crippling Arrows for Unit[Playernumber(ownerofunit(LearningHero)]

So no matter which player use the hero it Reference the right one...

You can easily add the Unit[Array] in the HeroPick or HeroTavern

Tavern Example
By Set Unit[Playernumber(ownerofunit(SoldUnit)] = Sold Unit

So Unit[1] is Player Red
So Unit[2] is Player Blue

And and and you get it :)

Edit: I saw you just enable the Abilitys I would prefere to add the Abilitys and Set the Ability Level so my post is misleading...
 
Last edited:
Status
Not open for further replies.
Top