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

[Solved] Heal over time not healing

Status
Not open for further replies.
Level 7
Joined
Sep 19, 2012
Messages
204
Hey there :)

i am currently trying to make a spell that heals the units in the target area for a certain amount of health per second, for 4 seconds.
Normally i would use Healing Spray for that (used it for visuals here), but i want the Healing to scale with a variable i use, so i have to trigger it.

This is what i have so far, but for some reason it doesnt do anything. Can someone spot the error, or is maybe the whole concept wrong?
  • Natures Gift
    • Events
      • Unit - A unit Begins channeling an ability
    • Conditions
      • (Ability being cast) Equal to Nature´s Gift [E] (Nature)
    • Actions
      • Set Nature_loc = (Target point of ability being cast)
      • Set Natures_Gift_Group[(Player number of (Owner of (Casting unit)))] = (Units within 250.00 of Nature_loc matching (((Matching player) is an ally of (Owner of (Casting unit))) Equal to True))
      • Set Natures_Gift_Caster[(Player number of (Owner of (Casting unit)))] = (Casting unit)
  • Natures Gift heal
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • Unit Group - Pick every unit in Natures_Gift_Group[(Integer A)] and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • NatureRealm_Stack_Array[(Integer A)] Less than or equal to 0.00
                • Then - Actions
                  • Unit - Set life of (Picked unit) to ((Life of (Picked unit)) + 10.00)
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • NatureRealm_Stack_Array[(Integer A)] Greater than or equal to 1.00
                      • (Level of Nature´s Gift [E] (Nature) for Natures_Gift_Caster[(Integer A)]) Equal to 1
                    • Then - Actions
                      • Unit - Set life of (Picked unit) to ((Life of (Picked unit)) + (10.00 x NatureRealm_Stack_Array[(Integer A)]))
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • NatureRealm_Stack_Array[(Integer A)] Greater than or equal to 1.00
                          • (Level of Nature´s Gift [E] (Nature) for Natures_Gift_Caster[(Integer A)]) Equal to 2
                        • Then - Actions
                          • Unit - Set life of (Picked unit) to ((Life of (Picked unit)) + (15.00 x NatureRealm_Stack_Array[(Integer A)]))
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • NatureRealm_Stack_Array[(Integer A)] Greater than or equal to 1.00
                              • (Level of Nature´s Gift [E] (Nature) for Natures_Gift_Caster[(Integer A)]) Equal to 3
                            • Then - Actions
                              • Unit - Set life of (Picked unit) to ((Life of (Picked unit)) + (20.00 x NatureRealm_Stack_Array[(Integer A)]))
                            • Else - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • NatureRealm_Stack_Array[(Integer A)] Greater than or equal to 1.00
                                  • (Level of Nature´s Gift [E] (Nature) for Natures_Gift_Caster[(Integer A)]) Equal to 4
                                • Then - Actions
                                  • Unit - Set life of (Picked unit) to ((Life of (Picked unit)) + (25.00 x NatureRealm_Stack_Array[(Integer A)]))
                                • Else - Actions
                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • NatureRealm_Stack_Array[(Integer A)] Greater than or equal to 1.00
                                      • (Level of Nature´s Gift [E] (Nature) for Natures_Gift_Caster[(Integer A)]) Equal to 5
                                    • Then - Actions
                                      • Unit - Set life of (Picked unit) to ((Life of (Picked unit)) + (30.00 x NatureRealm_Stack_Array[(Integer A)]))
                                    • Else - Actions
          • Custom script: call DestroyGroup (udg_Natures_Gift_Group[bj_forLoopAIndex])

greetings

CodeBlack
 
Level 15
Joined
Mar 25, 2016
Messages
1,327
(Matching player) is an ally of (Owner of (Casting unit)): I am not sure, if a player is an ally to itself
NatureRealm_Stack_Array should also be initialized for every player (either array size 12, or manually initialize by setting their values).
Otherwise the trigger will stop, because variables are not initialized
 
Level 7
Joined
Sep 19, 2012
Messages
204
(Matching player) is an ally of (Owner of (Casting unit)): I am not sure, if a player is an ally to itself
NatureRealm_Stack_Array should also be initialized for every player (either array size 12, or manually initialize by setting their values).
Otherwise the trigger will stop, because variables are not initialized

-this spell is made to heal units of allies only.
-array is set to 12

Did you post the entire code? It seems there is a lot missing.

this is the entire code for the spell.

the only thing that is not in here is the trigger setting the factor for the healing.
 
Status
Not open for further replies.
Top