• 🏆 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] Optimizing triggers: leaks/desyncs

Status
Not open for further replies.
Level 6
Joined
Nov 24, 2012
Messages
218
Hello, I recently started coding for this map: Fortress Survival Alpha
I received it in a mess, I didn't expect the map to be 98% leaking GUI,
1% Pro vJass, and 1% Noob Jass, and when I copy the code in text it added up to over 60,000 lines. I reduced it to 40,000 recently, but still a lot.

I thought I had removed most of the leaks, but Handle Counter says otherwise.
I placed a Handle Counter and it starts game with 10,000.
By the end of game (50 minutes) the count is at 100,000 with 3 players.

If the map was leakless, would it be right to assume the end count should be 10,000 as well?
I notice an increase of approximate 150 per 5 seconds of handle counter checking.

Here are some periodic triggers that seem to be pretty heavy, do they leak or is any coding really inefficient?
Also, can converting it to Jass remove more leaks? Such as, nulling triggers?

This trigger here runs every 5 seconds and picks every enemy unit in map (sometimes 100+), and I have 4 copies of it since certain areas with elevations need more AI.
  • Wall Attacks
    • Events
      • Time - Every 5.00 seconds of game time
    • Conditions
    • Actions
      • Set Temp_Group = (Units owned by Player 12 (Brown) matching (((Unit-type of (Matching unit)) Not equal to Euxo) or (((Unit-type of (Matching unit)) Not equal to Nightstriker) or (((Unit-type of (Matching unit)) Equal to Sniper [2]) or (((Unit-type of (Matching unit)) Not equal...ETC
      • Unit Group - Pick every unit in Temp_Group and do (Actions)
        • Loop - Actions
          • Set TempPoint = (Position of (Picked unit))
          • Set TempGroup = (Units within 128.00 of TempPoint matching (((Matching unit) belongs to an enemy of Player 12 (Brown)) Equal to True))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Number of units in TempGroup) Greater than or equal to 1
            • Then - Actions
              • Unit - Order (Picked unit) to Attack TempUnit
            • Else - Actions
              • Custom script: call DestroyGroup (udg_TempGroup)
              • Set TempGroup = (Units within 400.00 of TempPoint matching ((((Unit-type of (Matching unit)) Equal to Large Fortification) or ((Unit-type of (Matching unit)) Equal to Light Wall)) or (((Unit-type of (Matching unit)) Equal to Medium Fortification) or (((Unit-type of (Matching...+30 more unit types)))
              • If ((Number of units in TempGroup) Greater than or equal to 1) then do (Unit - Order (Picked unit) to Attack (Random unit from TempGroup)) else do (Do nothing)
          • Custom script: call RemoveLocation (udg_TempPoint)
          • Custom script: call DestroyGroup (udg_TempGroup)
          • Custom script: set udg_TempPoint = null
          • Custom script: set udg_TempGroup = null
      • Custom script: call DestroyGroup (udg_Temp_Group)
      • Custom script: set udg_Temp_Group = null


I also have about 100 triggers with event: A unit is attacked.
Some towers attack as fast as 0.20 seconds, can this lag? Or will trigger leak everytime everytime it runs?
Also, dozens of bosses have their own "A unit is attacked" event which in response they cast certain spells.
Should these be turned on only when boss is in map, and turned off when boss dies, or does it not really matter?

  • Assassin Ultimate
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Unit-type of (Attacking unit)) Equal to Shadow Assassin
      • (Random integer number between 1 and 125) Equal to 125
    • Actions
      • Trigger - Turn off (This trigger)
      • Set TempPoint = (Position of (Attacking unit))
      • Unit - Create 1 Dummy for (Owner of (Attacking unit)) at TempPoint facing Default building facing degrees
      • Unit - Add a 1.30 second Generic expiration timer to (Last created unit)
      • Unit - Add Red Assassination Lightning [Assassin Tower Ult] to (Last created unit)
      • Unit - Order (Last created unit) to Special Archimonde - Finger Of Death (Attacked unit)
      • Custom script: call RemoveLocation (udg_TempPoint)
      • Wait (Random real number between 0.50 and 3.25) seconds
      • Trigger - Turn on (This trigger)


Anything really bad in this? There are literally like 100 triggers of this kind.
So, any leaks, will easily stack up. I thought there were no leaks but the leaks are pretty bad.

Also, will the code be faster if I made "A unit by player 12 is attacked" rather than "A unit is attacked"?

Here's the 3rd and final trigger of concern.
This trigger probably runs like 1000 times in a minute.
It upgrades the enemy's attack power as they attack more.

  • Fury Mad
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Owner of (Attacking unit)) Equal to Player 12 (Brown)
    • Actions
      • Unit - Set the custom value of (Attacking unit) to ((Custom value of (Attacking unit)) + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Boss Marker for (Attacking unit)) Not equal to 1
          • Or - Any (Conditions) are true
            • Conditions
              • (Custom value of (Attacking unit)) Equal to 30
              • (Custom value of (Attacking unit)) Equal to 60
              • (Custom value of (Attacking unit)) Equal to 90
              • (Custom value of (Attacking unit)) Equal to 120
              • (Custom value of (Attacking unit)) Equal to 150
              • (Custom value of (Attacking unit)) Equal to 180
        • Then - Actions
          • Unit - Increase level of Fury [Mad] for (Attacking unit)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of Boss Marker for (Attacking unit)) Equal to 1
              • Or - Any (Conditions) are true
                • Conditions
                  • (Custom value of (Attacking unit)) Equal to 60
                  • (Custom value of (Attacking unit)) Equal to 120
            • Then - Actions
              • Unit - Increase level of Fury [Mad] for (Attacking unit)
            • Else - Actions


============================================


Map also has desync issues, maybe 1 in 5 games.
I have gone insane searching for the cause(s).
Absolutely no getlocalplayer() except beginning, which has never desync'd (desyncs tend to happen mid/late game).
No deformations, no pan camera thingie, limited use of custom models so something being corrupt should be unlikely, unless a model can be corrupt but seemingly working fine?
I've gone absolutely crazy from this. Testing with myself on 3 wc3s, and stuff.
Now I'm starting to think the attack damage auras (99,999 range) are causing it.
The auras blink like crazy on the buff screen, on and off.
Say a unit has 100-100 damage, with 2X crit, and 100% dmg aura (global, blinking on and off)
When it crits, I see 200 damage sometimes, and 400 damage others.
Also, can training like 200 units per second in a map desync? The income system (lumber) is by automatic training of lumber "units" which are then removed when complete and you get +1 lumber.
As for dice damage, since FS does use large numbers, majority of the dice goes like this : damage number of dice: 1, sides per die: 11, basically 10 damage range. some bosses/towers have dice up to damage # 22: sides per die, 26. Is this too much? These attack roughly once every second.
Oh yes, I have experienced desyncs myself. I usually am not doing anything while desync occurs. Usually it instant drops me, sometimes I enter a different game state. How could this be possible with no getlocalplayer?


If anyone picks something up that could potentially lower handle counter from spamming its way up to 100,000, please tell.
That, or desync as well. I'd be so happy if I could get desync out of the way. Still doing various tests on that myself with kLoader.
Kinda hard to test since I desync maybe every 3-5 hours of playing with 3 wc3s. I can't really handle more instances.
 
Level 25
Joined
Jul 10, 2006
Messages
3,315
The Wall Attacks trigger is a mess.
Use TempGroup1, TempGroup2, TempGroup3, and rewrite it neatly.
Another way of making it, would be to add units to a group when they enter a region, removing them when they leave it, and running the trigger on that unit group.

I have a neat idea for your "attacked" triggers to prevent the game firing all those triggers:
Assuming each unit only has one of these triggered abilities associated with it, give the unit a unique Point Value.
Put all the triggers in a trigger array, with the array index of a trigger being the point value of the unit that uses it.

Then remove all the events and conditions from the triggers you have (leaving the actions), and make a new trigger:
Event - Unit is attacked
Condition - Point value of attacking unit not equal to 0 (set all units without abilities to 0 point value)
Action - Run AttackTrigger[Point value of attacking unit]

Note you'll have to redo the chance condition, and pass the associated event data (triggering unit, attacking unit, etc) using global variables.

You're aware that the example trigger isn't MUI, right?

Absolutely no getlocalplayer() except beginning, which has never desync'd (desyncs tend to happen mid/late game).

Post this trigger regardless, sometimes the game only splits when players are detected to be desynced.

Also, can training like 200 units per second in a map desync? The income system (lumber) is by automatic training of lumber "units" which are then removed when complete and you get +1 lumber.
Trigger a new one.

The auras blink like crazy on the buff screen, on and off.
Say a unit has 100-100 damage, with 2X crit, and 100% dmg aura (global, blinking on and off)

Do the auras have global range? Global range auras can be laggy.
 
Level 6
Joined
Nov 24, 2012
Messages
218
The Wall Attacks trigger is a mess.
Use TempGroup1, TempGroup2, TempGroup3, and rewrite it neatly.
Another way of making it, would be to add units to a group when they enter a region, removing them when they leave it, and running the trigger on that unit group.
Err, this is probably the heaviest trigger in the map. It picks like 100 units then for each one picks even more units... I can write it neater by using TempGroup1/2 instead of TempGroup and Temp_Group actually but I don't see how it can be more efficient. Could this be leaking anything? Map is leaking 30 handles per second.

I have a neat idea for your "attacked" triggers to prevent the game firing all those triggers:
Assuming each unit only has one of these triggered abilities associated with it, give the unit a unique Point Value.
Put all the triggers in a trigger array, with the array index of a trigger being the point value of the unit that uses it.

Then remove all the events and conditions from the triggers you have (leaving the actions), and make a new trigger:
Event - Unit is attacked
Condition - Point value of attacking unit not equal to 0 (set all units without abilities to 0 point value)
Action - Run AttackTrigger[Point value of attacking unit]

Note you'll have to redo the chance condition, and pass the associated event data (triggering unit, attacking unit, etc) using global variables.

You're aware that the example trigger isn't MUI, right?

Ah, I see, that will make only 1 trigger try to run and check the conditions instead of 100+. I'm definitely gonna try this. It would be like, the neatest code in FS, by far, lmao.

Post this trigger regardless, sometimes the game only splits when players are detected to be desynced.

999999999999999999999999% sure it's not this, like really, there is just no way! I nearly killed myself inspecting it forever.

Trigger a new one.
I'm trying to think of another way to make lumber gain. I tried to use auto-cast heal but it stupidly requires not full health, plus I can't have lumber mill below max health because there are always repairs going around trying to repair.

Do the auras have global range? Global range auras can be laggy.
Map has 1 99999 range "mode" aura (for damage) to all enemies, and 1 99999 range "tower damage" aura (for damage to all towers). The tower damage aura blinks on and off like crazy.

Thanks for helping =).
Still looking for:
  • Potential leaks in any of these triggers above (there are hundreds of similar triggers of these types in the map)
  • A way to make first trigger more efficient but leave the periodic timer and stuff there
  • Experts in desync problems. Map has very often desync (1 in 5 games).
  • Answer to question: Can converting triggers to Jass remove more leaks? Such as, nulling triggers? (like, local trigger t = create, set t = null)
 
Level 23
Joined
Apr 16, 2012
Messages
4,041
Jass is generally better in most cases(I cant find an advantage of GUI over Jass, except simplicity) but nulling triggers that are running for the whole game has no effect, the trigger will not even need to recycle so theres no need to null him really
 
Level 25
Joined
Jul 10, 2006
Messages
3,315
Simply converting triggers to jass has no effect, you have to recode it all properly using the advantages jass has over GUI.

999999999999999999999999% sure it's not this, like really, there is just no way! I nearly killed myself inspecting it forever.

Post it anyway for us to look at.

I'm trying to think of another way to make lumber gain. I tried to use auto-cast heal but it stupidly requires not full health, plus I can't have lumber mill below max health because there are always repairs going around trying to repair.

On init or build:
Unit group - add lumber mill to LumberMills

Every X seconds:
Unit group - pick every unit in LumberMills and do
Player - add (level of lumber ability for picked unit) to owner of picked unit current lumber

Map has 1 99999 range "mode" aura (for damage) to all enemies, and 1 99999 range "tower damage" aura (for damage to all towers). The tower damage aura blinks on and off like crazy.

For modes, modify the creeps' damage as they are spawned. Or better yet, set research levels. I'm assuming the mode doesn't change during the game, of course.
 
Level 6
Joined
Nov 24, 2012
Messages
218
Another trigger I'd like to look at is GUI, but we've had a fullhouse of players in a game spam this without any problems so far, so is it ok to leave it like this?

  • StartProduction
    • Events
      • Unit - A unit Finishes construction
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Triggering unit)) Equal to Lumber Mill
          • (Unit-type of (Triggering unit)) Equal to Tiny Lumber Mill
    • Actions
      • Wait 2.00 seconds
      • Unit - Order (Triggering unit) to train/upgrade to a Add Lumber
      • Unit - Order (Triggering unit) to train/upgrade to a Add Lumber
I'm thinking about replacing this since training units spam green pings and possibly more lag than needed.
Here is the plan so far.

It adds all lumber mills to MillGroup upon construction.
Every 2 seconds I pick all MillGroup to cast "Produce Lumber".
Mills are removed from group upon death or upgrade, and re-added on completion of upgrades.
It doesn't have bj_wantDestroyGroup or DestroyGroup thing when I pick all units in MillGroup, will it leak like that, if yes/no, why?
(If I did destroy group everything would screw over, unless I set group each time as all units of type X )

P.S. ruler, the localplayer is no problem, it's Nes's save/load system. I've thoroughly tested and repeatedly asked him questions regarding it. Oh yeh we had desync problems before adding this in too
 
Level 25
Joined
Jul 10, 2006
Messages
3,315
It adds all lumber mills to MillGroup upon construction.
Every 2 seconds I pick all MillGroup to cast "Produce Lumber".
Mills are removed from group upon death or upgrade, and re-added on completion of upgrades.
It doesn't have bj_wantDestroyGroup or DestroyGroup thing when I pick all units in MillGroup, will it leak like that, if yes/no, why?
(If I did destroy group everything would screw over, unless I set group each time as all units of type X )

Don't cast anything, just add lumber using triggers.
No need for destroy group, you are using the unit group throughout the game, so it isn't a "leak", but rather "used data".

The point of adding them to the unit group one-by-one is to prevent picking units every 2 seconds, which is much more costly.
 
Level 4
Joined
Jan 27, 2010
Messages
133
Let's look at what the matching-filter does!

  • Set TempGroup = (Units within 128.00 of TempPoint matching (((Matching unit) belongs to an enemy of Player 12 (Brown)) Equal to True))
Is, in reality:

JASS:
function Trig_Melee_Initialization_Func001002003 takes nothing returns boolean
    return ( IsUnitEnemy(GetFilterUnit(), Player(11)) == true )
endfunction

function Trig_Melee_Initialization_Actions takes nothing returns nothing
// Notice the call to the function "Condition"
// That creates a variable of type boolexpr, which you cannot clean up in GUI.
    set udg_TempGroup = GetUnitsInRangeOfLocMatching(128.00, udg_TempPoint, Condition(function Trig_Melee_Initialization_Func001002003))
endfunction

The problem is that the "matching"-functions create a boolexpr, which you cannot clean up. You could make a Pick All Units + If instead:

  • Actions
    • Set TempGroup = (Units within 128.00 of TempPoint)
    • Unit Group - Pick every unit in TempGroup and do (Actions)
      • Loop - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • ((Picked unit) belongs to an enemy of Player 12 (Brown)) Equal to True
          • Then - Actions
          • Else - Actions
 
Level 6
Joined
Nov 24, 2012
Messages
218
Let's look at what the matching-filter does!

  • Set TempGroup = (Units within 128.00 of TempPoint matching (((Matching unit) belongs to an enemy of Player 12 (Brown)) Equal to True))
Is, in reality:

JASS:
function Trig_Melee_Initialization_Func001002003 takes nothing returns boolean
    return ( IsUnitEnemy(GetFilterUnit(), Player(11)) == true )
endfunction

function Trig_Melee_Initialization_Actions takes nothing returns nothing
// Notice the call to the function "Condition"
// That creates a variable of type boolexpr, which you cannot clean up in GUI.
    set udg_TempGroup = GetUnitsInRangeOfLocMatching(128.00, udg_TempPoint, Condition(function Trig_Melee_Initialization_Func001002003))
endfunction

The problem is that the "matching"-functions create a boolexpr, which you cannot clean up. You could make a Pick All Units + If instead:

  • Actions
    • Set TempGroup = (Units within 128.00 of TempPoint)
    • Unit Group - Pick every unit in TempGroup and do (Actions)
      • Loop - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • ((Picked unit) belongs to an enemy of Player 12 (Brown)) Equal to True
          • Then - Actions
          • Else - Actions

Thanks so much! GG. There was over 40 unit-type matching in that actually, when I converted to custom text I saw this...

JASS:
function Trig_No_More_Wall_Attacks_Func001002002001 takes nothing returns boolean
    return ( GetUnitTypeId(GetFilterUnit()) != 'n00S' )
endfunction

function Trig_No_More_Wall_Attacks_Func001002002002001 takes nothing returns boolean
    return ( GetUnitTypeId(GetFilterUnit()) != 'n016' )
endfunction

function Trig_No_More_Wall_Attacks_Func001002002002002001 takes nothing returns boolean
    return ( GetUnitTypeId(GetFilterUnit()) == 'e000' )
endfunction

function Trig_No_More_Wall_Attacks_Func001002002002002002001 takes nothing returns boolean
    return ( GetUnitTypeId(GetFilterUnit()) != 'n00Z' )
endfunction

function Trig_No_More_Wall_Attacks_Func001002002002002002002 takes nothing returns boolean
    return ( GetUnitTypeId(GetFilterUnit()) != 'n017' )
endfunction

function Trig_No_More_Wall_Attacks_Func001002002002002002 takes nothing returns boolean
    return GetBooleanOr( Trig_No_More_Wall_Attacks_Func001002002002002002001(), Trig_No_More_Wall_Attacks_Func001002002002002002002() )
endfunction

function Trig_No_More_Wall_Attacks_Func001002002002002 takes nothing returns boolean
    return GetBooleanOr( Trig_No_More_Wall_Attacks_Func001002002002002001(), Trig_No_More_Wall_Attacks_Func001002002002002002() )
endfunction

function Trig_No_More_Wall_Attacks_Func001002002002 takes nothing returns boolean
    return GetBooleanOr( Trig_No_More_Wall_Attacks_Func001002002002001(), Trig_No_More_Wall_Attacks_Func001002002002002() )
endfunction

function Trig_No_More_Wall_Attacks_Func001002002 takes nothing returns boolean
    return GetBooleanOr( Trig_No_More_Wall_Attacks_Func001002002001(), Trig_No_More_Wall_Attacks_Func001002002002() )
endfunction

function Trig_No_More_Wall_Attacks_Func002Func002002003001 takes nothing returns boolean
    return ( IsUnitEnemy(GetFilterUnit(), Player(11)) == true )
endfunction

function Trig_No_More_Wall_Attacks_Func002Func002002003002 takes nothing returns boolean
    return ( IsUnitType(GetFilterUnit(), UNIT_TYPE_GROUND) == true )
endfunction

function Trig_No_More_Wall_Attacks_Func002Func002002003 takes nothing returns boolean
    return GetBooleanAnd( Trig_No_More_Wall_Attacks_Func002Func002002003001(), Trig_No_More_Wall_Attacks_Func002Func002002003002() )
endfunction

function Trig_No_More_Wall_Attacks_Func002Func003Func002002003001001 takes nothing returns boolean
    return ( GetUnitTypeId(GetFilterUnit()) == 'h00E' )
endfunction

function Trig_No_More_Wall_Attacks_Func002Func003Func002002003001002 takes nothing returns boolean
    return ( GetUnitTypeId(GetFilterUnit()) == 'h03F' )
endfunction

function Trig_No_More_Wall_Attacks_Func002Func003Func002002003001 takes nothing returns boolean
    return GetBooleanOr( Trig_No_More_Wall_Attacks_Func002Func003Func002002003001001(), Trig_No_More_Wall_Attacks_Func002Func003Func002002003001002() )
endfunction

function Trig_No_More_Wall_Attacks_Func002Func003Func002002003002001 takes nothing returns boolean
    return ( GetUnitTypeId(GetFilterUnit()) == 'h00C' )
endfunction

function Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002001 takes nothing returns boolean
    return ( GetUnitTypeId(GetFilterUnit()) == 'h004' )
endfunction

function Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002001 takes nothing returns boolean
    return ( GetUnitTypeId(GetFilterUnit()) == 'h007' )
endfunction

function Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002001 takes nothing returns boolean
    return ( GetUnitTypeId(GetFilterUnit()) == 'h005' )
endfunction

function Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002001 takes nothing returns boolean
    return ( GetUnitTypeId(GetFilterUnit()) == 'h006' )
endfunction

function Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002001 takes nothing returns boolean
    return ( GetUnitTypeId(GetFilterUnit()) == 'h00R' )
endfunction

function Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002002001 takes nothing returns boolean
    return ( GetUnitTypeId(GetFilterUnit()) == 'h00V' )
endfunction

function Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002002002001 takes nothing returns boolean
    return ( GetUnitTypeId(GetFilterUnit()) == 'h003' )
endfunction

function Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002002002002001 takes nothing returns boolean
    return ( GetUnitTypeId(GetFilterUnit()) == 'h00W' )
endfunction

function Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002002002002002001 takes nothing returns boolean
    return ( GetUnitTypeId(GetFilterUnit()) == 'h01A' )
endfunction

function Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002002002002002002001 takes nothing returns boolean
    return ( GetUnitTypeId(GetFilterUnit()) == 'h01Q' )
endfunction

function Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002002002002002002002001 takes nothing returns boolean
    return ( GetUnitTypeId(GetFilterUnit()) == 'h016' )
endfunction

function Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002002002002002002002002001 takes nothing returns boolean
    return ( GetUnitTypeId(GetFilterUnit()) == 'h01Y' )
endfunction

function Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002002002002002002002002002001 takes nothing returns boolean
    return ( GetUnitTypeId(GetFilterUnit()) == 'h01R' )
endfunction

function Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002002002002002002002002002002001 takes nothing returns boolean
    return ( GetUnitTypeId(GetFilterUnit()) == 'h01S' )
endfunction

function Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002002002002002002002002002002002001 takes nothing returns boolean
    return ( GetUnitTypeId(GetFilterUnit()) == 'h01U' )
endfunction

function Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002002002002002002002002002002002002001 takes nothing returns boolean
    return ( GetUnitTypeId(GetFilterUnit()) == 'h01T' )
endfunction

function Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002002002002002002002002002002002002002001001 takes nothing returns boolean
    return ( GetUnitTypeId(GetFilterUnit()) == 'h01V' )
endfunction

function Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002002002002002002002002002002002002002001002 takes nothing returns boolean
    return ( GetUnitTypeId(GetFilterUnit()) == 'h02A' )
endfunction

function Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002002002002002002002002002002002002002001 takes nothing returns boolean
    return GetBooleanOr( Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002002002002002002002002002002002002002001001(), Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002002002002002002002002002002002002002001002() )
endfunction

function Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002002002002002002002002002002002002002002001 takes nothing returns boolean
    return ( GetUnitTypeId(GetFilterUnit()) == 'h02N' )
endfunction

function Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002002002002002002002002002002002002002002002001 takes nothing returns boolean
    return ( GetUnitTypeId(GetFilterUnit()) == 'h03X' )
endfunction

function Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002002002002002002002002002002002002002002002002001 takes nothing returns boolean
    return ( GetUnitTypeId(GetFilterUnit()) == 'h01Z' )
endfunction

function Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002002002002002002002002002002002002002002002002002001 takes nothing returns boolean
    return ( GetUnitTypeId(GetFilterUnit()) == 'h04Y' )
endfunction

function Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002002002002002002002002002002002002002002002002002002001 takes nothing returns boolean
    return ( GetUnitTypeId(GetFilterUnit()) == 'h04Z' )
endfunction

function Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002002002002002002002002002002002002002002002002002002002001 takes nothing returns boolean
    return ( GetUnitTypeId(GetFilterUnit()) == 'h05K' )
endfunction

function Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002002002002002002002002002002002002002002002002002002002002001 takes nothing returns boolean
    return ( GetUnitTypeId(GetFilterUnit()) == 'h05S' )
endfunction

function Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002002002002002002002002002002002002002002002002002002002002002001 takes nothing returns boolean
    return ( GetUnitTypeId(GetFilterUnit()) == 'h06Y' )
endfunction

function Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002002002002002002002002002002002002002002002002002002002002002002001 takes nothing returns boolean
    return ( GetUnitTypeId(GetFilterUnit()) == 'h06X' )
endfunction

function Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002002002002002002002002002002002002002002002002002002002002002002002001 takes nothing returns boolean
    return ( GetUnitTypeId(GetFilterUnit()) == 'h075' )
endfunction

function Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002002002002002002002002002002002002002002002002002002002002002002002002001 takes nothing returns boolean
    return ( GetUnitTypeId(GetFilterUnit()) == 'h064' )
endfunction

function Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002002002002002002002002002002002002002002002002002002002002002002002002002 takes nothing returns boolean
    return ( GetUnitTypeId(GetFilterUnit()) == 'h06R' )
endfunction

function Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002002002002002002002002002002002002002002002002002002002002002002002002 takes nothing returns boolean
    return GetBooleanOr( Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002002002002002002002002002002002002002002002002002002002002002002002002001(), Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002002002002002002002002002002002002002002002002002002002002002002002002002() )
endfunction

function Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002002002002002002002002002002002002002002002002002002002002002002002 takes nothing returns boolean
    return GetBooleanOr( Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002002002002002002002002002002002002002002002002002002002002002002002001(), Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002002002002002002002002002002002002002002002002002002002002002002002002() )
endfunction

function Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002002002002002002002002002002002002002002002002002002002002002002 takes nothing returns boolean
    return GetBooleanOr( Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002002002002002002002002002002002002002002002002002002002002002002001(), Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002002002002002002002002002002002002002002002002002002002002002002002() )
endfunction

function Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002002002002002002002002002002002002002002002002002002002002002 takes nothing returns boolean
    return GetBooleanOr( Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002002002002002002002002002002002002002002002002002002002002002001(), Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002002002002002002002002002002002002002002002002002002002002002002() )
endfunction

function Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002002002002002002002002002002002002002002002002002002002002 takes nothing returns boolean
    return GetBooleanOr( Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002002002002002002002002002002002002002002002002002002002002001(), Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002002002002002002002002002002002002002002002002002002002002002() )
endfunction

function Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002002002002002002002002002002002002002002002002002002002 takes nothing returns boolean
    return GetBooleanOr( Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002002002002002002002002002002002002002002002002002002002001(), Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002002002002002002002002002002002002002002002002002002002002() )
endfunction

function Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002002002002002002002002002002002002002002002002002002 takes nothing returns boolean
    return GetBooleanOr( Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002002002002002002002002002002002002002002002002002002001(), Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002002002002002002002002002002002002002002002002002002002() )
endfunction

function Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002002002002002002002002002002002002002002002002002 takes nothing returns boolean
    return GetBooleanOr( Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002002002002002002002002002002002002002002002002002001(), Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002002002002002002002002002002002002002002002002002002() )
endfunction

function Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002002002002002002002002002002002002002002002002 takes nothing returns boolean
    return GetBooleanOr( Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002002002002002002002002002002002002002002002002001(), Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002002002002002002002002002002002002002002002002002() )
endfunction

function Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002002002002002002002002002002002002002002002 takes nothing returns boolean
    return GetBooleanOr( Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002002002002002002002002002002002002002002002001(), Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002002002002002002002002002002002002002002002002() )
endfunction

function Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002002002002002002002002002002002002002002 takes nothing returns boolean
    return GetBooleanOr( Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002002002002002002002002002002002002002002001(), Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002002002002002002002002002002002002002002002() )
endfunction

function Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002002002002002002002002002002002002002 takes nothing returns boolean
    return GetBooleanOr( Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002002002002002002002002002002002002002001(), Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002002002002002002002002002002002002002002() )
endfunction

function Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002002002002002002002002002002002002 takes nothing returns boolean
    return GetBooleanOr( Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002002002002002002002002002002002002001(), Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002002002002002002002002002002002002002() )
endfunction

function Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002002002002002002002002002002002 takes nothing returns boolean
    return GetBooleanOr( Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002002002002002002002002002002002001(), Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002002002002002002002002002002002002() )
endfunction

function Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002002002002002002002002002002 takes nothing returns boolean
    return GetBooleanOr( Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002002002002002002002002002002001(), Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002002002002002002002002002002002() )
endfunction

function Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002002002002002002002002002 takes nothing returns boolean
    return GetBooleanOr( Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002002002002002002002002002001(), Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002002002002002002002002002002() )
endfunction

function Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002002002002002002002002 takes nothing returns boolean
    return GetBooleanOr( Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002002002002002002002002001(), Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002002002002002002002002002() )
endfunction

function Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002002002002002002002 takes nothing returns boolean
    return GetBooleanOr( Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002002002002002002002001(), Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002002002002002002002002() )
endfunction

function Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002002002002002002 takes nothing returns boolean
    return GetBooleanOr( Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002002002002002002001(), Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002002002002002002002() )
endfunction

function Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002002002002002 takes nothing returns boolean
    return GetBooleanOr( Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002002002002002001(), Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002002002002002002() )
endfunction

function Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002002002002 takes nothing returns boolean
    return GetBooleanOr( Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002002002002001(), Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002002002002002() )
endfunction

function Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002002002 takes nothing returns boolean
    return GetBooleanOr( Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002002002001(), Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002002002002() )
endfunction

function Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002002 takes nothing returns boolean
    return GetBooleanOr( Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002002001(), Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002002002() )
endfunction

function Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002 takes nothing returns boolean
    return GetBooleanOr( Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002001(), Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002002() )
endfunction

function Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002 takes nothing returns boolean
    return GetBooleanOr( Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002001(), Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002002() )
endfunction

function Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002 takes nothing returns boolean
    return GetBooleanOr( Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002001(), Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002002() )
endfunction

function Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002 takes nothing returns boolean
    return GetBooleanOr( Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002001(), Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002002() )
endfunction

function Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002 takes nothing returns boolean
    return GetBooleanOr( Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002001(), Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002002() )
endfunction

function Trig_No_More_Wall_Attacks_Func002Func003Func002002003002 takes nothing returns boolean
    return GetBooleanOr( Trig_No_More_Wall_Attacks_Func002Func003Func002002003002001(), Trig_No_More_Wall_Attacks_Func002Func003Func002002003002002() )
endfunction

function Trig_No_More_Wall_Attacks_Func002Func003Func002002003 takes nothing returns boolean
    return GetBooleanOr( Trig_No_More_Wall_Attacks_Func002Func003Func002002003001(), Trig_No_More_Wall_Attacks_Func002Func003Func002002003002() )
endfunction

function Trig_No_More_Wall_Attacks_Func002Func003Func003001 takes nothing returns boolean
    return ( CountUnitsInGroup(udg_TempGroup) >= 1 )
endfunction

function Trig_No_More_Wall_Attacks_Func002Func003C takes nothing returns boolean
    if ( not ( CountUnitsInGroup(udg_TempGroup) >= 1 ) ) then
        return false
    endif
    return true
endfunction

function Trig_No_More_Wall_Attacks_Func002A takes nothing returns nothing
    set udg_TempPoint = GetUnitLoc(GetEnumUnit())
    set udg_TempGroup = GetUnitsInRangeOfLocMatching(100.00, udg_TempPoint, Condition(function Trig_No_More_Wall_Attacks_Func002Func002002003))
    if ( Trig_No_More_Wall_Attacks_Func002Func003C() ) then
        call IssueTargetOrderBJ( GetEnumUnit(), "attack", udg_TempUnit )
    else
        call DestroyGroup (udg_TempGroup)
        set udg_TempGroup = GetUnitsInRangeOfLocMatching(400.00, udg_TempPoint, Condition(function Trig_No_More_Wall_Attacks_Func002Func003Func002002003))
        if ( Trig_No_More_Wall_Attacks_Func002Func003Func003001() ) then
            call IssueTargetOrderBJ( GetEnumUnit(), "attack", GroupPickRandomUnit(udg_TempGroup) )
        else
            call DoNothing(  )
        endif
    endif
    call RemoveLocation (udg_TempPoint)
    call DestroyGroup (udg_TempGroup)
    set udg_TempPoint = null
    set udg_TempGroup = null
endfunction

function Trig_No_More_Wall_Attacks_Actions takes nothing returns nothing
    set udg_Temp_Group = GetUnitsOfPlayerMatching(Player(11), Condition(function Trig_No_More_Wall_Attacks_Func001002002))
    call ForGroupBJ( udg_Temp_Group, function Trig_No_More_Wall_Attacks_Func002A )
    call DestroyGroup (udg_Temp_Group)
    set udg_Temp_Group = null
endfunction

//===========================================================================
function InitTrig_No_More_Wall_Attacks takes nothing returns nothing
    set gg_trg_No_More_Wall_Attacks = CreateTrigger(  )
    call TriggerRegisterTimerEventPeriodic( gg_trg_No_More_Wall_Attacks, 5.00 )
    call TriggerAddAction( gg_trg_No_More_Wall_Attacks, function Trig_No_More_Wall_Attacks_Actions )
endfunction
I'm guessing it leaks like 40+ of these "boolexpr" every time it runs?
Gonna fix that to your suggestion =)
 
Level 4
Joined
Jan 27, 2010
Messages
133
according to makers post in different thread, boolexprs no longer leaks

True. But the reference counter won't reset from GetUnitsOwnedByPlayerMatching (as in Pick Matching), so it's a "pointer-leak" (making the handle counter unable to detect other leaks)
 
Last edited:
Status
Not open for further replies.
Top