• Check out the results of the Techtree Contest #19!
  • Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

Trigger Leaks

Status
Not open for further replies.

out-of-name

O

out-of-name

Hello,

I have to ask something about leaks in triggers:

This is my trigger and I wanted to know if I did correctly so it doesn't leak:

  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (DamageEventSource has buff The Hand of Ares ) Equal to Wahr
    • Then - Actions
      • Set VariableSet HandofAresCount = 0
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Item-type of (Item carried by DamageEventSource of type |cffffff00The Hand of Ares|r)) Equal to (Item-type of (Item carried by DamageEventSource in slot (Integer A)))
            • Then - Actions
              • Set VariableSet HandofAresCount = (HandofAresCount + 1)
            • Else - Actions
      • Set VariableSet MapLocation = (Center of (Playable map area))
      • Unit - Create 1 DAMAGEDUMMY for (Owner of DamageEventSource) at MapLocation facing Default building facing degrees
      • Custom script: call RemoveLocation(udg_MapLocation)
      • Unit - Cause (Last created unit) to damage DamageEventTarget, dealing (200.00 x (Real(HandofAresCount))) damage of attack type Chaos and damage type Normal
      • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
      • Special Effect - Create a special effect attached to the chest of DamageEventTarget using Abilities\Spells\Undead\CarrionSwarm\CarrionSwarmDamage.mdl
      • Special Effect - Destroy (Last created special effect)
    • Else - Actions

And another one about that group:
  • Boss Event
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
      • (Number of units in (Units in PlayableArea <gen> owned by Player 12 (Brown))) Less than or equal to 0
    • Actions
      • Set VariableSet BossCheck = (BossCheck + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • BossCheck Greater than or equal to 2
        • Then - Actions
          • Set VariableSet BossCheck = 0
          • Trigger - Turn off (This trigger)
          • Game - Display to (All players) for 20.00 seconds the text: |cffff0000An evil b...
          • Cinematic - Ping minimap for (All players) at (Center of Spawn Boss <gen>) for 20.00 seconds, using a Warning ping of color (100.00%, 100.00%, 100.00%)
          • Trigger - Turn on Boss Spawn <gen>
        • Else - Actions

If they leak, can you show my where and how I can avoid it?

Thanks you.
 
There are some solutions here in the link below. Remember, you'll have to identify some triggers which can cause instability of the game:

 
  • empty.gif
    empty.gif
    line.gif
    join.gif
    cam.gif
    Cinematic - Ping minimap for (All players) at (Center of Spawn Boss <gen>) for 20.00 seconds, using a Warning ping of color (100.00%, 100.00%, 100.00%)

This part leaks a location/point.
This can be solved similar to how "MapLocation" is used in the first trigger.

Other than that, there is only a "dummy unit leak", but I usually don't recommend people caring about it, because it's probably more work than it's worth to care about (depending on situation ofc).
More info on that: Dummy Recycler v1.25
 
Thanks man, didn't know if the Condition in the second trigger would cause a leak.

joinbottom.gif
if.gif
(Number of units in (Units in PlayableArea <gen> owned by Player 12 (Brown))) Less than or equal to 0
 
Thanks man, didn't know if the Condition in the second trigger would cause a leak.

joinbottom.gif
if.gif
(Number of units in (Units in PlayableArea <gen> owned by Player 12 (Brown))) Less than or equal to 0
Ohh, I missed that one. It leaks a group.

(I'm in a meeting at work, so slightly distracted :p)

This can be solved by putting a custom script with "set bj_wantDestroyGroup = true" before an "if/then/else multiple" with that condition, and put everything in that if.
 
Last edited:
Hey man,
thank you very much for your help =)

  • Boss Event
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Set VariableSet MapGroup = (Units in PlayableArea <gen> owned by Player 12 (Brown))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in MapGroup) Less than or equal to 0
        • Then - Actions
          • Set VariableSet BossCheck = (BossCheck + 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • BossCheck Greater than or equal to 2
            • Then - Actions
              • Set VariableSet BossCheck = 0
              • Trigger - Turn off (This trigger)
              • Game - Display to (All players) for 20.00 seconds the text: |cffff0000An evil b...
              • Set VariableSet MapLocation = (Center of Spawn Boss <gen>)
              • Cinematic - Ping minimap for (All players) at MapLocation for 20.00 seconds, using a Warning ping of color (100.00%, 100.00%, 100.00%)
              • Custom script: call RemoveLocation(udg_MapLocation)
              • Trigger - Turn on Boss Spawn <gen>
            • Else - Actions
        • Else - Actions
      • Custom script: call DestroyGroup(udg_MapGroup)
I hope this is leakless. I think i start to understand it.
 
Status
Not open for further replies.
Back
Top