• 🏆 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] Timer Problem?

Status
Not open for further replies.
Level 8
Joined
Apr 30, 2009
Messages
338
Heroes on my map have a passive ability that gains levels when they cast other abilities, and to show the player the level of charges they have I am going to give them a +STR passive so their unit card has like +3 next to it so they see it's level 3 without looking at the ability tooltips.

The problem is this system seems to malfunction when it maxes out. The charges are supposed to max at +5 (ability level 6). It's tricky because I can't add levels to a +STR passive as it does not change the bonus value (a bug with item abilities?) So I have to have 6 different abilities for +0 thru +5. And I run a big If/Then/Else tree of

If current = 0, then make next = 1, else
If current = 1, then make next = 2, else
...
If current = 4, then make next = 5

But when I cast a spell at +5, the +STR resets to zero but the actualy passive ability does not.

I have to use a 0.00 second countdown because if I didn't, then the ability level changes BEFORE it takes effect.

  • Divine Light 1
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Paladin
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to PAL-6 Divine Light
        • Then - Actions
          • Set temp_real = (135.00 + (Real((15 x (Level of (Ability being cast) for (Triggering unit))))))
          • Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) + temp_real)
          • Unit - Set life of (Target unit of ability being cast) to ((Life of (Target unit of ability being cast)) + temp_real)
          • Special Effect - Create a special effect attached to the origin of (Triggering unit) using Abilities\Spells\Human\HolyBolt\HolyBoltSpecialArt.mdl
          • Special Effect - Destroy (Last created special effect)
          • Special Effect - Create a special effect attached to the origin of (Target unit of ability being cast) using Abilities\Spells\Human\HolyBolt\HolyBoltSpecialArt.mdl
          • Special Effect - Destroy (Last created special effect)
          • Set temp_timer_ability = Passive Bonus (+0)
          • Set temp_timer_integer = 1
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of PAL-P Healing Presence for (Triggering unit)) Less than 6
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of Passive Bonus (+1) for (Triggering unit)) Equal to 1
                • Then - Actions
                  • Set temp_timer_ability = Passive Bonus (+2)
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Level of Passive Bonus (+2) for (Triggering unit)) Equal to 1
                    • Then - Actions
                      • Set temp_timer_ability = Passive Bonus (+3)
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Level of Passive Bonus (+3) for (Triggering unit)) Equal to 1
                        • Then - Actions
                          • Set temp_timer_ability = Passive Bonus (+4)
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Level of Passive Bonus (+4) for (Triggering unit)) Equal to 1
                            • Then - Actions
                              • Set temp_timer_ability = Passive Bonus (+5)
                            • Else - Actions
                              • Set temp_timer_ability = Passive Bonus (+1)
              • Set temp_timer_integer = ((Level of PAL-P Healing Presence for (Triggering unit)) + 1)
            • Else - Actions
              • Set temp_timer_ability = Passive Bonus (+5)
      • Unit - Remove Passive Bonus (+1) from (Triggering unit)
      • Unit - Remove Passive Bonus (+2) from (Triggering unit)
      • Unit - Remove Passive Bonus (+3) from (Triggering unit)
      • Unit - Remove Passive Bonus (+4) from (Triggering unit)
      • Unit - Remove Passive Bonus (+5) from (Triggering unit)
      • Set temp_timer_unit = (Triggering unit)
      • Countdown Timer - Start T_PAL_HealingPresence as a One-shot timer that will expire in 0.00 seconds
  • Divine Light 2
    • Events
      • Time - T_PAL_HealingPresence expires
    • Conditions
    • Actions
      • Unit - Add temp_timer_ability to temp_timer_unit
      • Unit - Set level of PAL-6 Divine Light for temp_timer_unit to temp_timer_integer
      • Unit - Set level of PAL-P Healing Presence for temp_timer_unit to temp_timer_integer
 
  • Countdown Timer - Start T_PAL_HealingPresence as a One-shot timer that will expire in 0.00 seconds
You don't need that; you can normally increase the level of ability within the same trigger.

You don't need so many abilities. Just make one ability with several levels and do it like this:
  • Actions
  • If (All conditions are true) then do (Actions) else do (Actions)
    • If - Conditions
      • (Level of (Passive Bonus)) Less than 6
    • Then - Actions
      • Unit - Set level of Passive Bonus for (Triggering unit) to (Level of Passive Bonus + 1)
    • Else - Actions
      • Unit - Set level of Passive Bonus for (Triggering unit) to 1
If the level up doesn't work like this, place the Passive Bonus in a disabled spell book.
 
Level 8
Joined
Apr 30, 2009
Messages
338
when I upgrade the level of the +STR ability, it doesnt level up even if I give it 6 levels

And I cant do it in the same trigger because it changes the level before the spell is cast. I tried it already and certain abilities have 30 second cooldown at level 1, and 10 seconds at level 6. Casting the level 6 version will result in a 30 second cooldown unless I use a 0 timer
 
tml616 said:
when I upgrade the level of the +STR ability, it doesnt level up even if I give it 6 levels
That's why I posted this:
Pharaoh_ said:
If the level up doesn't work like this, place the Passive Bonus in a disabled spell book.

tml616 said:
And I cant do it in the same trigger because it changes the level before the spell is cast.
Use the event "Unit - A unit begins casting an ability" instead.
 
Status
Not open for further replies.
Top