• 🏆 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] Ability level not being set when using a CR based ability?

Status
Not open for further replies.
Level 8
Joined
Mar 30, 2013
Messages
180
It's me again, with another problem.

So i've got this spell that, once used, gives different bonuses, it has three forms and you can cycle between them

-Form 1 Gives X Bonuses
-Form 2 Gives Y Bonuses
-Form 3 Gives Z Bonuses

Y'see the problem is there is also an ability on this hero that makes use of chemical rage, so the unit changes, i've got it to preserve the units MS when transforming (MS is one of the form bonuses/deductions), but the skill book (That has all the other bonuses) doesn't level up (There's three skill books, with level 1-5, level 1 has no bonuses in it and that's the base, both the main unit and the transformed unit have these as default abilities)

So, when transformed, even with this trigger below, it leaves the skill book at level 1 and i have no idea why.

  • Trans
    • Events
      • Unit - A unit Starts the effect of an ability
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Issei_D_New
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • IsseiReal[2] Not equal to 1.00
        • Then - Actions
          • Set Issei = (Triggering unit)
          • Set IsseiReal[2] = 1.00
          • Set IsseiPoints[4] = (Position of Issei)
          • Unit - Create 1 IsseiTrans for Neutral Passive at IsseiPoints[4] facing (Random angle) degrees
          • Unit - Add a 0.50 second Generic expiration timer to (Last created unit)
          • Unit - Create 1 IsseiTrans2 for Neutral Passive at IsseiPoints[4] facing (Random angle) degrees
          • Unit - Add a 0.50 second Generic expiration timer to (Last created unit)
          • For each (Integer A) from 1 to 5, do (Actions)
            • Loop - Actions
              • Special Effect - Create a special effect at IsseiPoints[4] using war3mapImported\DustWave.mdx
              • Set Random_Number = (Random real number between 1.50 and 2.00)
              • Special Effect - Set Scale of (Last created special effect) to Random_Number
              • Special Effect - Set Alpha of (Last created special effect) to 60
              • Set Random_Number = (Random real number between 0.60 and 1.20)
              • Special Effect - Set Time Scale of (Last created special effect) to Random_Number
              • Special Effect - Set Roll of (Last created special effect) to: (Random angle)
              • Special Effect - Destroy (Last created special effect)
          • Sound - Play Issei_R <gen> at 100.00% volume, attached to Issei
          • Unit - Set level of IsseiUltBook for Issei to (Level of Issei_D_New for Issei)
          • Custom script: call RemoveLocation(udg_IsseiPoints[4])
          • Set IsseiMovespeed = (Current movement speed of Issei)
          • Wait 1.00 seconds
          • Set Issei = (Triggering unit)
          • Unit - Set Issei movement speed to IsseiMovespeed
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • IsseiForm Equal to 2
            • Then - Actions
              • Unit - Set level of IsseiKnight for Issei to 1
              • Unit - Set level of IsseiBishop for Issei to 1
              • Unit - Set level of IsseiRook for Issei to IsseiWLevel
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • IsseiForm Equal to 3
                • Then - Actions
                  • Unit - Set level of IsseiRook for Issei to 1
                  • Unit - Set level of IsseiKnight for Issei to 1
                  • Unit - Set level of IsseiBishop for Issei to IsseiWLevel
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • IsseiForm Equal to 1
                    • Then - Actions
                      • Unit - Set level of IsseiBishop for Issei to 1
                      • Unit - Set level of IsseiRook for Issei to 1
                      • Unit - Set level of IsseiKnight for Issei to IsseiWLevel
                    • Else - Actions
        • Else - Actions
          • Set IsseiReal[2] = 0.00
          • Set IsseiMovespeed = (Current movement speed of Issei)
          • Wait 1.00 seconds
          • Set Issei = (Triggering unit)
          • Unit - Set Issei movement speed to IsseiMovespeed
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • IsseiForm Equal to 2
            • Then - Actions
              • Unit - Set level of IsseiKnight for Issei to 1
              • Unit - Set level of IsseiBishop for Issei to 1
              • Unit - Set level of IsseiRook for Issei to IsseiWLevel
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • IsseiForm Equal to 3
                • Then - Actions
                  • Unit - Set level of IsseiRook for Issei to 1
                  • Unit - Set level of IsseiKnight for Issei to 1
                  • Unit - Set level of IsseiBishop for Issei to IsseiWLevel
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • IsseiForm Equal to 1
                    • Then - Actions
                      • Unit - Set level of IsseiBishop for Issei to 1
                      • Unit - Set level of IsseiRook for Issei to 1
                      • Unit - Set level of IsseiKnight for Issei to IsseiWLevel
                    • Else - Actions

Sorry for it being messy/hard to read it's one of my older things i've just started editing

I'm sure this is gonna be a case of me being stupid, but i don't know everything about transformation abilties since i don't use them much, if there's an easier way to do this just say
 
Level 8
Joined
Mar 30, 2013
Messages
180
  • IsseiWSwitch
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Issei_W_BrandNew
    • Actions
      • Set Issei = (Triggering unit)
      • Set IsseiWLevel = ((Level of Issei_W_BrandNew for Issei) + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • IsseiForm Equal to 1
        • Then - Actions
          • Unit - Set level of IsseiKnight for Issei to 1
          • Unit - Set level of IsseiRook for Issei to IsseiWLevel
          • Game - Set Icon of Issei_W_BrandNew to ReplaceableTextures\CommandButtons\BTNHumanArmorUpOne.blp
          • Unit - Set Issei movement speed to ((Current movement speed of Issei) - IsseiMSChange)
          • Set IsseiMSChange = (30.00 x (Real((Level of Issei_W_BrandNew for Issei))))
          • Unit - Set Issei movement speed to ((Current movement speed of Issei) - IsseiMSChange)
          • Set IsseiForm = 2
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • IsseiForm Equal to 2
            • Then - Actions
              • Unit - Set level of IsseiRook for Issei to 1
              • Unit - Set level of IsseiBishop for Issei to IsseiWLevel
              • Game - Set Icon of Issei_W_BrandNew to ReplaceableTextures\CommandButtons\BTNMagicalSentry.blp
              • Unit - Set Issei movement speed to ((Current movement speed of Issei) + IsseiMSChange)
              • Set IsseiMSChange = (10.00 x (Real((Level of Issei_W_BrandNew for Issei))))
              • Unit - Set Issei movement speed to ((Current movement speed of Issei) - IsseiMSChange)
              • Set IsseiForm = 3
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • IsseiForm Equal to 3
                • Then - Actions
                  • Unit - Set level of IsseiBishop for Issei to 1
                  • Unit - Set level of IsseiKnight for Issei to IsseiWLevel
                  • Game - Set Icon of Issei_W_BrandNew to ReplaceableTextures\CommandButtons\BTNArcaniteMelee.blp
                  • Unit - Set Issei movement speed to ((Current movement speed of Issei) + IsseiMSChange)
                  • Set IsseiMSChange = (20.00 x (Real((Level of Issei_W_BrandNew for Issei))))
                  • Unit - Set Issei movement speed to ((Current movement speed of Issei) + IsseiMSChange)
                  • Set IsseiForm = 1
                • Else - Actions

Here's the trigger for the actual ability activation as well since it'll probably make more sense with this
 
Spellbooks and their content are removed on morphing.
One can make abilities permanent so they are not removed when morphing.
For spellbooks you need to make the spellbook and all abilities inside the book permanent.
One can skip the book ability, if all forms have the spellbook ability on default.
JASS:
native UnitMakeAbilityPermanent     takes unit whichUnit, boolean permanent, integer abilityId returns boolean
  • Custom script: call UnitMakeAbilityPermanent(udg_Issei, true, 'AHab')
If IsseiBishop, IsseiRook and IsseiKnight are the content of the book.

  • Custom script: call UnitMakeAbilityPermanent(udg_Issei, true, udg_IsseiKnight)
  • Custom script: call UnitMakeAbilityPermanent(udg_Issei, true, udg_IsseiBishop)
  • Custom script: call UnitMakeAbilityPermanent(udg_Issei, true, udg_IsseiRook)
You need to use that permanent setting only once, as soon an unit has the ability. It keeps as long the ability is not lost for that specific unit.

One could also do the whole thing with techs I guess, depends how many forms you wana use and what the bonuses of this 3 types are, But well you might dislike stacking up object Editor data.
 
Last edited:
Level 8
Joined
Mar 30, 2013
Messages
180
Spellbooks and their content are removed on morphing.
On can make abilities permanent so they are not removed when morphing.
For spellbooks you need to make the spellbook and all abilities inside the book permanent.
One can skip the book ability, if all forms have the spellbook ability on default.
JASS:
native UnitMakeAbilityPermanent     takes unit whichUnit, boolean permanent, integer abilityId returns boolean
  • Custom script: call UnitMakeAbilityPermanent(udg_Issei, true, 'AHab')
If IsseiBishop, IsseiRook and IsseiKnight are the content of the book.

  • Custom script: call UnitMakeAbilityPermanent(udg_Issei, true, udg_IsseiKnight)
  • Custom script: call UnitMakeAbilityPermanent(udg_Issei, true, udg_IsseiBishop)
  • Custom script: call UnitMakeAbilityPermanent(udg_Issei, true, udg_IsseiRook)
You need to use that permanent setting only once, as soon an unit has the ability. It keeps as long the ability is not lost for that specific unit.

One could also do the whole thing with techs I guess, depends how many forms you wana use and what the bonuses of this 3 types are, But well you might dislike stacking up object Editor data.

I see, i decided to not use this ability because it'll probable be buggy as hell but i'll keep this in mind for the future, thans
 
Status
Not open for further replies.
Top