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

[Solved] Does this Special Effect leak?

Status
Not open for further replies.
Level 3
Joined
Dec 7, 2020
Messages
20
Hi. I hope this question belongs here. Well, I essentially just wanted to know if the FX on the following trigger leaks or not.

  • Hammer of The Lightbringer
    • Events
      • Game - DamageModifierEvent becomes Less than or equal to 1.00
    • Conditions
      • (Level of Hammer of The Lightbringer (Checker) (Uther) for DamageEventSource) Greater than 0
    • Actions
      • Custom script: local effect udg__Temp_FX_1
      • Set VariableSet _ID = (Custom value of DamageEventSource)
      • Set VariableSet _Temp_Number[_ID] = (_Temp_Number[_ID] + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • _Temp_Number[_ID] Greater than or equal to 3
        • Then - Actions
          • Set VariableSet _Temp_Number[_ID] = 0
          • Unit Group - Pick every unit in (Units within 500.00 of (Position of DamageEventSource).) and do (Actions)
            • Loop - Actions
              • Set VariableSet _Temp_Objective_1 = (Picked unit)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (_Temp_Objective_1 is alive) Equal to True
                  • (_Temp_Objective_1 is A structure) Equal to False
                  • (_Temp_Objective_1 belongs to an ally of (Owner of DamageEventSource).) Equal to True
                • Then - Actions
                  • Set VariableSet NextHealTarget = _Temp_Objective_1
                  • Set VariableSet NextHealSource = DamageEventSource
                  • Set VariableSet NextHealAmount = 15.00
                  • Trigger - Run Heal Unit <gen> (ignoring conditions)
                  • Special Effect - Create a special effect attached to the origin of _Temp_Objective_1 using Abilities\Spells\Human\Heal\HealTarget.mdl
                  • Set VariableSet _Temp_FX_1 = (Last created special effect)
                  • Wait 1.00 seconds
                  • Special Effect - Destroy _Temp_FX_1
                  • Custom script: set udg__Temp_FX_1 = null
                • Else - Actions
        • Else - Actions
I tried to do the "shadow variables" thing but don't really know if that's how it's done. I had to do it because instantly removing the effect after creating it didn't show anything, it's supposed to show a death animation still but I don't know what I did wrong.
It works nicely, the healing and all, and I think it's MUI which is needed, but I can only be sure that it eliminates the last effect created, not all of them.
It uses Bribe's Damage Engine and Heal Event.

Edit: I'm an idiot and forgot to mention what the trigger DOES. Smhm. It is supposed to trigger a 15 points healing to all living, non-structure allies in a 500 radius every third attack. The condition simply checks whether the attack is melee. The Run Heal Unit <gen> (ignoring conditions) is a trigger that comes with Heal Event that triggers a heal I can refer to if needed.
 
Last edited:
Level 3
Joined
Dec 7, 2020
Messages
20
Oh, I initially put it inside the unit group actions and it told me to put it at the beginning. :/ Maybe it meant at the beginning of the loop? Damn.

Anyways, I'm a little slow so, could you tell me how to use the TimedHandles? What I understand is that I need to " call DestroyEffectTimed(AddSpecialEffect("put the path of my effect here", 0, 0), 5)" do I need to change the numbers? I also can't find TimerUtils, if that's important.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,539
I attached a map with a GUI system for destroying special effects. It's super simple.

All you have to do is Set the DDE_Delay variable to how long you want the special effect to last, then run Delayed Destroy Effect (ignoring conditions).

Example:
  • Example DDE
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
    • Actions
      • Special Effect - Create a special effect attached to the chest of (Triggering unit) using Abilities\Spells\Human\DivineShield\DivineShieldTarget.mdl
      • Set VariableSet DDE_Delay = 1.00
      • Trigger - Run Delayed Destroy Effect <gen> (ignoring conditions)
You definitely don't want to put Waits inside of your Pick Every Unit function, that'll Wait 1.00*Unit Count seconds, meaning if it found 10 units then it would Wait 1.00 second PER unit (10.00 seconds overall).
 

Attachments

  • Delayed Destroy Effect Fixed.w3m
    17.1 KB · Views: 22
Level 3
Joined
Dec 7, 2020
Messages
20
Thank you both very much!

Uncle, the Delayed Destroy Effect works perfectly, tho you knew that already. Ty! I'll remember to use it every time I need to destroy an effect in a timer or something. I'll also remember not to use wait inside a Pick Every Unit function, I though the wait would apply per effect, not sum up per unit. I definitely owe you one for all the help.
 
I attached a map with a GUI system for destroying special effects. It's super simple.

All you have to do is Set the DDE_Delay variable to how long you want the special effect to last, then run Delayed Destroy Effect (ignoring conditions).

Example:
  • Example DDE
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
    • Actions
      • Special Effect - Create a special effect attached to the chest of (Triggering unit) using Abilities\Spells\Human\DivineShield\DivineShieldTarget.mdl
      • Set VariableSet DDE_Delay = 1.00
      • Trigger - Run Delayed Destroy Effect <gen> (ignoring conditions)
You definitely don't want to put Waits inside of your Pick Every Unit function, that'll Wait 1.00*Unit Count seconds, meaning if it found 10 units then it would Wait 1.00 second PER unit (10.00 seconds overall).
Hi Uncle, i need your help. Will this system work well with multiple effect being created at once? It will not overwrite the dealy every time another is created? Thanks.
 
Status
Not open for further replies.
Top