• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Different abilities when Transforming

deepstrasz

Map Reviewer
Level 70
Joined
Jun 4, 2009
Messages
19,016
I think you can use an ability based on Bear Form if you want to do this witout triggers
You could try a custom Mount Hippogryph ability if you have an unmounted version/model of the wolf.

If that doesn't work nicely, you could trigger the change via triggers by using two Berserker Upgrade abilities which you add to both "forms" to get from one to the other. The change is instantaneous when the ability is added without any interruptions or control group loss.
  • So, you need three units. Unmounted Thrall, the wolf, and mounted Thrall on wolf.
  • Make two Berserker Upgrade abilities, one to change the mounted wolf into Thrall, the other to change Thrall into the mounted version.
  • You need two more dummy Channel abilities, one to cast with Thrall (put it on this unit in the unit editor) on the wolf, the other an instant/no target ability for the mounted wolf (add it via the unit editor - ability data field).
  • Then you do some triggering. An event for when Thrall casts the dummy ability (you could even use another spell which starts a buff/effect so you could detect it or even detect 0 damage) on the wolf. Then you Add Ability Berserker Upgrade for Thrall (which turns Thrall into the mounted version) and hide the wolf via triggers. You can complicate things with considering if mounted Thrall should have less HP if the wolf is hurt before mounting etc.
  • Now to dismount by casting the dummy Dismount spell. Similarly, when the spell is cast, Add Ability Berserker Upgrade for wolf (which turns mounted Thrall back to Thrall on foot) and Unhide the wolf unit (Move unit on Position of Thrall before that; don't forget to clean leaks).
 

Uncle

Warcraft Moderator
Level 65
Joined
Aug 10, 2018
Messages
6,667
How many of these threads do we need, lol. There's got to be 1000's by now.
 
Level 25
Joined
Sep 26, 2009
Messages
2,408
I was asked a similar question few months ago. As far as I could see, morphing and chaos abilities did not work.
The solution that ultimately worked was to have two sets of abilities:
  • the default set which are the heroic abilities you start with
  • an alternate set which are non-hero abilities
The trigger action
  • Unit - For your_unit, Ability your_ability, Disable ability: true, Hide UI: true
will prevent you from using your_ability, but you will still be able to level it up in skill points menu.

So the idea was:
  • Set learning description of the heroic ability to include descriptions of both versions of the ability
  • The non-hero ability has 3 levels as well (and will be leveled via trigger)
  • On start, let the heroic version be visible, while non-heroic version hidden
  • Have a trigger that detects when morphing starts. Disable heroic version, enable non-heroic (and vice-versa)
  • Have a trigger that detects when hero levels up one of his spells. Set level of the non-heroic version ability to same level as the (Leveled hero ability).

The example I have is for changing abilities during day and night. The idea was to use paladin's spells during day and death knight's during night. But the example trigger actually reacts to pressing Esc key for demo purposes rather than waiting for day/night change.
  • Map Ini
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set VariableSet HeroAbilities[1] = Holy Light
      • Set VariableSet HeroAbilities[2] = Divine Shield
      • Set VariableSet HeroAbilities[3] = Devotion Aura
      • Set VariableSet HeroAbilities[4] = Resurrection
      • Set VariableSet HeroAbilities[5] = Death Coil
      • Set VariableSet HeroAbilities[6] = Death Pact
      • Set VariableSet HeroAbilities[7] = Unholy Aura
      • Set VariableSet HeroAbilities[8] = Animate Dead
      • -------- ---- --------
      • Set VariableSet IsDay = True
      • Set VariableSet IsNight = False
  • Swap Abilities
    • Events
      • Player - Player 1 (Red) skips a cinematic sequence
    • Conditions
    • Actions
      • Set VariableSet SwappingHero = Paladin 0000 <gen>
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • IsDay Not equal to True
        • Then - Actions
          • Set VariableSet IsDay = True
          • Set VariableSet IsNight = False
        • Else - Actions
          • Set VariableSet IsDay = False
          • Set VariableSet IsNight = True
      • For each (Integer loopInt) from 1 to 4, do (Actions)
        • Loop - Actions
          • -------- Hide 'Day' abilities if it 'IsNight' --------
          • Unit - For SwappingHero, Ability HeroAbilities[loopInt], Disable ability: IsNight, Hide UI: IsNight
          • -------- ---- --------
          • -------- Hide 'Night' abilities if it 'IsDay' --------
          • Unit - For SwappingHero, Ability HeroAbilities[(loopInt + 4)], Disable ability: IsDay, Hide UI: IsDay
  • Hero Learns Ability
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Paladin
    • Actions
      • Custom script: set udg_abilCode = GetLearnedSkillBJ()
      • For each (Integer loopInt) from 1 to 4, do (Actions)
        • Loop - Actions
          • -------- Check which of the 4 hero abilities is the [Learned Hero Skill] --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • abilCode Equal to HeroAbilities[loopInt]
            • Then - Actions
              • -------- Check if the learned ability is level 1 --------
              • -------- - if not, we just sync levels between the day and night versions --------
              • -------- - if yes, we add the night version --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of HeroAbilities[loopInt] for (Triggering unit)) Equal to 1
                • Then - Actions
                  • Unit - Add HeroAbilities[(loopInt + 4)] to (Triggering unit)
                  • -------- Find out which of the two abilities should remain visible to the player --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • IsDay Equal to True
                    • Then - Actions
                      • -------- Hide 'Night' version --------
                      • Unit - For (Triggering unit), Ability HeroAbilities[(loopInt + 4)], Disable ability: True, Hide UI: True
                    • Else - Actions
                      • -------- Hide 'Day' version --------
                      • Unit - For (Triggering unit), Ability HeroAbilities[loopInt], Disable ability: True, Hide UI: True
                • Else - Actions
                  • Unit - Set level of HeroAbilities[(loopInt + 4)] for (Triggering unit) to (Level of HeroAbilities[loopInt] for (Triggering unit))
            • Else - Actions
The most important part is how abilities are placed in the ability array HeroAbilities. At indexes 1-4 are heroic abilities and at indexes 5-8 are non-hero abilities. Alternate versions are ordered same way as the default version and are always offset by 4. E.g. Death Pact is alternate ability to Divine Shield. Divine shield is at index 2, Death Pact at index 6. The offset between the two indexes is 4.
 
Top