• 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.

Dialog Leak?

Status
Not open for further replies.
Level 8
Joined
Jan 4, 2009
Messages
110
the map im working on right now seems like there's no leak in any place
but when i play it, after a while the game start lagging and more
so i think there's must be a leak in some place but couldnt find

so i wonder if dialog does leak..?
cos the map use dialog alot, for each player, and many buttons per dialog...

thanks in advance
 
Level 8
Joined
Jan 4, 2009
Messages
110
ok.. for example

  • Events
  • Conditions
  • Actions
    • Wait 12.00 seconds
    • Dialog - Clear Spawn[1]
    • Dialog - Change the title of Spawn[1] to |cffff0000Select Cl...
    • Dialog - Create a dialog button for Spawn[1] labelled |cffff0000Random|r
    • Set Button_RANDOM[1] = (Last created dialog Button)
    • Dialog - Create a dialog button for Spawn[1] labelled |cffffcc00Brawler|r
    • Set Button_Brawler[1] = (Last created dialog Button)
    • Dialog - Create a dialog button for Spawn[1] labelled Engineer
    • Set Button_Engineer[1] = (Last created dialog Button)
    • Dialog - Create a dialog button for Spawn[1] labelled Grenadier
    • Set Button_Grenadier[1] = (Last created dialog Button)
    • Dialog - Create a dialog button for Spawn[1] labelled Maruader
    • Set Button_Maruader[1] = (Last created dialog Button)
    • Dialog - Create a dialog button for Spawn[1] labelled Recon
    • Set Button_Recon[1] = (Last created dialog Button)
    • Dialog - Create a dialog button for Spawn[1] labelled Medic
    • Set Button_Medic[1] = (Last created dialog Button)
    • Dialog - Create a dialog button for Spawn[1] labelled Pyro
    • Set Button_Pyro[1] = (Last created dialog Button)
    • Dialog - Create a dialog button for Spawn[1] labelled Rocketeer
    • Set Button_Rocketeer[1] = (Last created dialog Button)
    • Dialog - Create a dialog button for Spawn[1] labelled Sniper
    • Set Button_Sniper[1] = (Last created dialog Button)
    • Dialog - Show Spawn[1] for Player 1 (Red)
is that consider creating new button?
i clear and create again..

---------------------------------------------------------------


oh and also!
i found it, theres a post said sound does leak right?
so it might be the sound, but when i do like


  • Sound - Play Bullethit <gen> at 100.00% volume, located at Temp_Point with Z offset 0.00
  • Sound - Destroy (Last played sound)
the sound doesnt even play...
 
Dialogs and their buttons do leak if you don't destroy them. (That is assuming that you aren't going to use them later on in your map) But that shouldn't be the problem. For leaks, look at all your periodic triggers, eg: Every 0.01 seconds or anything like that, and then you should check those for leaks. Those are the ones that suffer most from leak lag.
 
Level 8
Joined
Jan 4, 2009
Messages
110
Dialogs and their buttons do leak if you don't destroy them. (That is assuming that you aren't going to use them later on in your map) But that shouldn't be the problem. For leaks, look at all your periodic triggers, eg: Every 0.01 seconds or anything like that, and then you should check those for leaks. Those are the ones that suffer most from leak lag.

ok, so its the sound then..
but how can i get the sound to play?
when play and destroy, unlike special effect, sound doesnt even play..
any suggestion?
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,287
You are probably leaking handle IDs all over the place (due to bad GUI BJ calls). The only fix is to rewrite everything in JASS or to optimize the map with vexorians optimizer (which replaces all bad BJ calls to ones which do not leak, or atleast I think it did that at once stage).

Basically it is a local handle bug. At the end of functions, local handles must be nulled or it leaks an incriment to the recycle counter of the object it contains (thus locking a handle index from ever being recycled). Blizzard was not aware of this themselves thus programed many of the BJ functions that GUI calls without taking this into consideration. As such sending handles through GUI code and removing/destoying the handle objects later can result in the handle ID (the pointer to a pointer to the object) which it used becomming permantly blocked until you exit the game.

Leaking too many of these can result in some efficient systems breaking and reduced performance with object creation (there must be some itteration involved). With enough you can get low frame rate at times where lots of objects are being allocated. Leak enough and the game will eventually crash.
 
ok, so its the sound then..
but how can i get the sound to play?
when play and destroy, unlike special effect, sound doesnt even play..
any suggestion?

Don't worry, it probably isn't the sound.

I suggest you post the map, that way we'll be able to find out what happens. Does it happen after a certain spell or does it just slowly start to lag on its own? Does the fps keep dropping or is it just very low when the game starts?
 
Level 8
Joined
Jan 4, 2009
Messages
110
oh that sounds complicated
is the Vexorian's optimizer you were referring to is the Wc3 Map optimizer?
cos ive been using Wc3 Map optimizer 4.9 but it doesnt help fixing the lag
or i have to set something? i checked all the squares tho..

when starts the game its fine, then start lagging, the fps dropping.
 
Level 8
Joined
Jan 4, 2009
Messages
110
Okay, if you were to leave the game alone and not do anything, does it just being to lag? Post any triggers that have the following event:
  • Time - Every <Time> seconds of game time

i put the trigger which start the
  • Time - Every <Time> seconds of game time
so you know how it start







there's many triggers kinda similar to this one, but turn on the same every 0.01 second trigger

eg.
  • Gun Shoot Machine Copy
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Shoot (Machine)
    • Actions
      • Set Gun_Counts = (Gun_Counts + 1)
      • Set Gun_CountMaxSize = 8191
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Gun_Counts Greater than Gun_CountMaxSize
        • Then - Actions
          • Set Gun_Counts = 1
        • Else - Actions
      • Set Gun_Caster[Gun_Counts] = (Casting unit)
      • Set Gun_CasterPoint = (Position of Gun_Caster[Gun_Counts])
      • Set Gun_TargetPoint = (Target point of ability being cast)
      • Set Gun_Angle = (Angle from Gun_CasterPoint to Gun_TargetPoint)
      • Set TempPoint1 = (Gun_CasterPoint offset by 130.00 towards Gun_Angle degrees)
      • Unit - Create 1 Bullet Machine for (Owner of Gun_Caster[Gun_Counts]) at (Gun_CasterPoint offset by 130.00 towards Gun_Angle degrees) facing Gun_Angle degrees
      • Unit - Turn collision for (Last created unit) Off
      • Unit - Add Storm Crow Form to (Last created unit)
      • Unit - Remove Storm Crow Form from (Last created unit)
      • Unit - Set the custom value of (Last created unit) to Gun_Counts
      • Unit Group - Add (Last created unit) to Gun_StartGroup
      • Unit - Move (Last created unit) instantly to TempPoint1
      • Custom script: call RemoveLocation (udg_TempPoint1)
      • Set TempPoint1 = (Position of (Triggering unit))
      • Set TempPoint2 = (Target point of ability being cast)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Terrain cliff level at TempPoint1) Equal to 10
          • (Terrain cliff level at TempPoint2) Equal to 10
        • Then - Actions
          • Unit Group - Add (Last created unit) to Top_Bullet
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Terrain cliff level at TempPoint1) Greater than or equal to 9
          • (Terrain cliff level at TempPoint2) Equal to 9
        • Then - Actions
          • Unit Group - Add (Last created unit) to Top_Bullet
          • Unit Group - Add (Last created unit) to Bullet9
        • Else - Actions
      • Custom script: call RemoveLocation (udg_TempPoint1)
      • Custom script: call RemoveLocation (udg_TempPoint2)
      • Set Gun_Distance[Gun_Counts] = 2600.00
      • Set Gun_DistanceTravel[Gun_Counts] = 0.00
      • Set Gun_DistanceCount[Gun_Counts] = 0.00
      • Trigger - Turn on Gun Move <gen>
      • Custom script: call RemoveLocation (udg_Gun_TargetPoint)
      • Custom script: call RemoveLocation (udg_Gun_CasterPoint)




which turn this on





  • Gun Move
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in Gun_StartGroup and do (Actions)
        • Loop - Actions
          • Unit - Turn collision for (Picked unit) Off
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is in Top_Bullet) Equal to True
              • ((Picked unit) is in Bullet9) Not equal to True
            • Then - Actions
              • Set TempPoint1 = (Position of (Picked unit))
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Terrain cliff level at TempPoint1) Equal to 8
                • Then - Actions
                  • Animation - Change (Picked unit) flying height to ((Default flying height of (Picked unit)) + 250.00) at 0.00
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Terrain cliff level at TempPoint1) Equal to 9
                • Then - Actions
                  • Animation - Change (Picked unit) flying height to ((Default flying height of (Picked unit)) + 125.00) at 0.00
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Terrain cliff level at TempPoint1) Equal to 10
                • Then - Actions
                  • Animation - Change (Picked unit) flying height to (Default flying height of (Picked unit)) at 0.00
                • Else - Actions
              • Custom script: call RemoveLocation (udg_TempPoint1)
            • Else - Actions
          • Set Gun_CusValue = (Custom value of (Picked unit))
          • Set Gun_DummyLoc = (Position of (Picked unit))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Picked unit)) Equal to Bullet Shotgun
            • Then - Actions
              • Set Gun_Speed_int = 20
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Picked unit)) Equal to Bullet Saw
            • Then - Actions
              • Set Gun_Speed_int = 10
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Picked unit)) Equal to Bullet Machine
            • Then - Actions
              • Set Gun_Speed_int = 10
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Picked unit)) Equal to Bullet Sniper
            • Then - Actions
              • Set Gun_Speed_int = 50
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Picked unit)) Equal to Bullet Normal
            • Then - Actions
              • Set Gun_Speed_int = 25
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Picked unit)) Equal to Bullet Fire
            • Then - Actions
              • Set Gun_Speed_int = 8
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Picked unit)) Equal to Bullet Grenadier
            • Then - Actions
              • Set Gun_Speed_int = 12
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Picked unit)) Equal to Bullet Rocket
            • Then - Actions
              • Set Gun_Speed_int = 20
            • Else - Actions
          • Set Gun_Movement = (Gun_DummyLoc offset by (Real(Gun_Speed_int)) towards (Facing of (Picked unit)) degrees)
          • Unit - Move (Picked unit) instantly to Gun_Movement
          • Set Gun_DistanceTravel[Gun_CusValue] = (Gun_DistanceTravel[Gun_CusValue] + 18.00)
          • Set Gun_DistanceCount[Gun_CusValue] = (Gun_DistanceCount[Gun_CusValue] + 18.00)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Gun_DistanceCount[Gun_CusValue] Greater than or equal to 225.00
            • Then - Actions
              • Set Gun_DistanceCount[Gun_CusValue] = 0.00
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is in Top_Bullet) Equal to True
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Picked unit) is in Bullet9) Equal to True
                • Then - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Boolean_Friends_Fire Equal to True
                    • Then - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Unit-type of (Picked unit)) Equal to Bullet Machine
                        • Then - Actions
                          • Set Gun_UnitGroup = (Units within 90.00 of Gun_Movement matching ((((((Unit-type of (Matching unit)) Not equal to Bullet Fire) and ((Terrain cliff level at (Position of (Matching unit))) Equal to 9)) and ((Terrain cliff level at (Position of (Matching unit))) Equal to (Terrain c
                          • Set Gun_Victim = (Random 1 units from Gun_UnitGroup)
                          • Custom script: call DestroyGroup (udg_Gun_UnitGroup)
                        • Else - Actions
                          • Set Gun_UnitGroup = (Units within 60.00 of Gun_Movement matching ((((((Unit-type of (Matching unit)) Not equal to Bullet Fire) and ((Terrain cliff level at (Position of (Matching unit))) Equal to 9)) and ((Terrain cliff level at (Position of (Matching unit))) Equal to (Terrain c
                          • Set Gun_Victim = (Random 1 units from Gun_UnitGroup)
                          • Custom script: call DestroyGroup (udg_Gun_UnitGroup)
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Unit-type of (Picked unit)) Equal to Bullet Machine
                        • Then - Actions
                          • Set Gun_UnitGroup = (Units within 90.00 of Gun_Movement matching ((((((Unit-type of (Matching unit)) Not equal to Bullet Fire) and ((Terrain cliff level at (Position of (Matching unit))) Equal to 9)) and ((Terrain cliff level at (Position of (Matching unit))) Equal to (Terrain c
                          • Set Gun_Victim = (Random 1 units from Gun_UnitGroup)
                          • Custom script: call DestroyGroup (udg_Gun_UnitGroup)
                        • Else - Actions
                          • Set Gun_UnitGroup = (Units within 60.00 of Gun_Movement matching ((((((Unit-type of (Matching unit)) Not equal to Bullet Fire) and ((Terrain cliff level at (Position of (Matching unit))) Equal to 9)) and ((Terrain cliff level at (Position of (Matching unit))) Equal to (Terrain c
                          • Set Gun_Victim = (Random 1 units from Gun_UnitGroup)
                          • Custom script: call DestroyGroup (udg_Gun_UnitGroup)
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Boolean_Friends_Fire Equal to True
                    • Then - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Unit-type of (Picked unit)) Equal to Bullet Machine
                        • Then - Actions
                          • Set Gun_UnitGroup = (Units within 90.00 of Gun_Movement matching ((((((Unit-type of (Matching unit)) Not equal to Bullet Fire) and ((Terrain cliff level at (Position of (Matching unit))) Equal to 10)) and ((Terrain cliff level at (Position of (Matching unit))) Equal to (Terrain
                          • Set Gun_Victim = (Random 1 units from Gun_UnitGroup)
                          • Custom script: call DestroyGroup (udg_Gun_UnitGroup)
                        • Else - Actions
                          • Set Gun_UnitGroup = (Units within 60.00 of Gun_Movement matching ((((((Unit-type of (Matching unit)) Not equal to Bullet Fire) and ((Terrain cliff level at (Position of (Matching unit))) Equal to 10)) and ((Terrain cliff level at (Position of (Matching unit))) Equal to (Terrain
                          • Set Gun_Victim = (Random 1 units from Gun_UnitGroup)
                          • Custom script: call DestroyGroup (udg_Gun_UnitGroup)
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Unit-type of (Picked unit)) Equal to Bullet Machine
                        • Then - Actions
                          • Set Gun_UnitGroup = (Units within 90.00 of Gun_Movement matching ((((((Unit-type of (Matching unit)) Not equal to Bullet Fire) and ((Terrain cliff level at (Position of (Matching unit))) Equal to 10)) and ((Terrain cliff level at (Position of (Matching unit))) Equal to (Terrain
                          • Set Gun_Victim = (Random 1 units from Gun_UnitGroup)
                          • Custom script: call DestroyGroup (udg_Gun_UnitGroup)
                        • Else - Actions
                          • Set Gun_UnitGroup = (Units within 60.00 of Gun_Movement matching ((((((Unit-type of (Matching unit)) Not equal to Bullet Fire) and ((Terrain cliff level at (Position of (Matching unit))) Equal to 10)) and ((Terrain cliff level at (Position of (Matching unit))) Equal to (Terrain
                          • Set Gun_Victim = (Random 1 units from Gun_UnitGroup)
                          • Custom script: call DestroyGroup (udg_Gun_UnitGroup)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Boolean_Friends_Fire Equal to True
                • Then - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Unit-type of (Picked unit)) Equal to Bullet Machine
                    • Then - Actions
                      • Set Gun_UnitGroup = (Units within 90.00 of Gun_Movement matching (((((Unit-type of (Matching unit)) Not equal to Bullet Fire) and ((Terrain cliff level at (Position of (Matching unit))) Equal to (Terrain cliff level at (Position of (Picked unit))))) and ((Current flying height o
                      • Set Gun_Victim = (Random 1 units from Gun_UnitGroup)
                      • Custom script: call DestroyGroup (udg_Gun_UnitGroup)
                    • Else - Actions
                      • Set Gun_UnitGroup = (Units within 60.00 of Gun_Movement matching (((((Unit-type of (Matching unit)) Not equal to Bullet Fire) and ((Terrain cliff level at (Position of (Matching unit))) Equal to (Terrain cliff level at (Position of (Picked unit))))) and ((Current flying height o
                      • Set Gun_Victim = (Random 1 units from Gun_UnitGroup)
                      • Custom script: call DestroyGroup (udg_Gun_UnitGroup)
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Unit-type of (Picked unit)) Equal to Bullet Machine
                    • Then - Actions
                      • Set Gun_UnitGroup = (Units within 90.00 of Gun_Movement matching (((((Unit-type of (Matching unit)) Not equal to Bullet Fire) and ((Terrain cliff level at (Position of (Matching unit))) Equal to (Terrain cliff level at (Position of (Picked unit))))) and ((Current flying height o
                      • Set Gun_Victim = (Random 1 units from Gun_UnitGroup)
                      • Custom script: call DestroyGroup (udg_Gun_UnitGroup)
                    • Else - Actions
                      • Set Gun_UnitGroup = (Units within 60.00 of Gun_Movement matching (((((Unit-type of (Matching unit)) Not equal to Bullet Fire) and ((Terrain cliff level at (Position of (Matching unit))) Equal to (Terrain cliff level at (Position of (Picked unit))))) and ((Current flying height o
                      • Set Gun_Victim = (Random 1 units from Gun_UnitGroup)
                      • Custom script: call DestroyGroup (udg_Gun_UnitGroup)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Gun_Victim is empty) Not equal to True
              • (Unit-type of (Picked unit)) Not equal to Bullet Saw
            • Then - Actions
              • Unit - Kill (Picked unit)
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Picked unit)) Equal to Bullet Machine
            • Then - Actions
              • Unit Group - Pick every unit in Gun_Victim and do (Actions)
                • Loop - Actions
                  • Unit - Cause Gun_Caster[Gun_CusValue] to damage (Picked unit), dealing (Random real number between 160.00 and 325.00) damage of attack type Normal and damage type Normal
                  • Set Temp_Point = (Position of (Picked unit))
                  • Sound - Play Bullethit <gen> at 100.00% volume, located at Temp_Point with Z offset 0.00
                  • Sound - Destroy (Last played sound)
                  • Custom script: call RemoveLocation (udg_Temp_Point)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Or - Any (Conditions) are true
                        • Conditions
                          • (Unit-type of (Picked unit)) Equal to Bullet Machine
                          • (Unit-type of (Picked unit)) Equal to Bullet Shotgun
                          • (Unit-type of (Picked unit)) Equal to Bullet Saw
                          • (Unit-type of (Picked unit)) Equal to Sentry Gun
                          • (Unit-type of (Picked unit)) Equal to Goblin Land Mine
                          • (Unit-type of (Picked unit)) Equal to Way Gate
                          • (Unit-type of (Picked unit)) Equal to Bullet Grenadier
                          • (Unit-type of (Picked unit)) Equal to Bullet Normal
                          • (Unit-type of (Picked unit)) Equal to Bullet Rocket
                          • (Unit-type of (Picked unit)) Equal to Bullet Sniper
                    • Then - Actions
                      • Set Temp_Point = (Position of (Picked unit))
                      • Special Effect - Create a special effect at Temp_Point using Objects\InventoryItems\ThunderLizardEgg\ThunderLizardEgg.mdl
                      • Special Effect - Destroy (Last created special effect)
                      • Custom script: call RemoveLocation (udg_Temp_Point)
                    • Else - Actions
                      • Set Temp_Point = (Position of (Picked unit))
                      • Special Effect - Create a special effect at Temp_Point using Objects\Spawnmodels\Critters\Albatross\CritterBloodAlbatross.mdl
                      • Special Effect - Destroy (Last created special effect)
                      • Custom script: call RemoveLocation (udg_Temp_Point)
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Picked unit)) Equal to Bullet Saw
            • Then - Actions
              • Unit Group - Pick every unit in Gun_Victim and do (Actions)
                • Loop - Actions
                  • Unit - Cause Gun_Caster[Gun_CusValue] to damage (Picked unit), dealing (Random real number between 5.00 and 30.00) damage of attack type Normal and damage type Normal
                  • Set Temp_Point = (Position of (Picked unit))
                  • Sound - Play Saw <gen> at 100.00% volume, located at Temp_Point with Z offset 0.00
                  • Sound - Destroy (Last played sound)
                  • Custom script: call RemoveLocation (udg_Temp_Point)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Or - Any (Conditions) are true
                        • Conditions
                          • (Unit-type of (Picked unit)) Equal to Bullet Machine
                          • (Unit-type of (Picked unit)) Equal to Sentry Gun
                          • (Unit-type of (Picked unit)) Equal to Goblin Land Mine
                          • (Unit-type of (Picked unit)) Equal to Way Gate
                          • (Unit-type of (Picked unit)) Equal to Bullet Shotgun
                          • (Unit-type of (Picked unit)) Equal to Bullet Grenadier
                          • (Unit-type of (Picked unit)) Equal to Bullet Saw
                          • (Unit-type of (Picked unit)) Equal to Bullet Normal
                          • (Unit-type of (Picked unit)) Equal to Bullet Rocket
                          • (Unit-type of (Picked unit)) Equal to Bullet Sniper
                    • Then - Actions
                      • Set Temp_Point = (Position of (Picked unit))
                      • Special Effect - Create a special effect at Temp_Point using Abilities\Weapons\Rifle\RifleImpact.mdl
                      • Special Effect - Destroy (Last created special effect)
                      • Custom script: call RemoveLocation (udg_Temp_Point)
                    • Else - Actions
                      • Set Temp_Point = (Position of (Picked unit))
                      • Special Effect - Create a special effect at Temp_Point using Objects\Spawnmodels\Critters\Albatross\CritterBloodAlbatross.mdl
                      • Special Effect - Destroy (Last created special effect)
                      • Custom script: call RemoveLocation (udg_Temp_Point)
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Picked unit)) Equal to Bullet Sniper
            • Then - Actions
              • Unit Group - Pick every unit in Gun_Victim and do (Actions)
                • Loop - Actions
                  • Unit - Cause Gun_Caster[Gun_CusValue] to damage (Picked unit), dealing (Random real number between 315.00 and 330.00) damage of attack type Normal and damage type Normal
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Owner of (Picked unit)) Not equal to Juggernaut_player
                      • (Random integer number between 1 and 100) Less than or equal to 7
                      • (Unit-type of (Picked unit)) Not equal to Bullet Machine
                      • (Unit-type of (Picked unit)) Not equal to Bullet Grenadier
                      • (Unit-type of (Picked unit)) Not equal to Bullet Shotgun
                      • (Unit-type of (Picked unit)) Not equal to Way Gate
                      • (Unit-type of (Picked unit)) Not equal to Goblin Land Mine
                      • (Unit-type of (Picked unit)) Not equal to Bullet Rocket
                      • (Unit-type of (Picked unit)) Not equal to Bullet Normal
                      • (Unit-type of (Picked unit)) Not equal to Bullet Saw
                      • (Unit-type of (Picked unit)) Not equal to Sentry Gun
                      • (Unit-type of (Picked unit)) Not equal to Bullet Sniper
                    • Then - Actions
                      • Floating Text - Create floating text that reads |cffff0000Headshot|... above (Picked unit) with Z offset 0.00, using font size 8.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
                      • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
                      • Floating Text - Change (Last created floating text): Disable permanence
                      • Floating Text - Change the lifespan of (Last created floating text) to 1.50 seconds
                      • Floating Text - Change the fading age of (Last created floating text) to 0.75 seconds
                      • Unit - Cause Gun_Caster[Gun_CusValue] to damage (Picked unit), dealing 1000000000.00 damage of attack type Normal and damage type Normal
                    • Else - Actions
                  • Set Temp_Point = (Position of (Picked unit))
                  • Sound - Play Bullethit <gen> at 100.00% volume, located at Temp_Point with Z offset 0.00
                  • Sound - Destroy (Last played sound)
                  • Custom script: call RemoveLocation (udg_Temp_Point)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Or - Any (Conditions) are true
                        • Conditions
                          • (Unit-type of (Picked unit)) Equal to Bullet Machine
                          • (Unit-type of (Picked unit)) Equal to Bullet Shotgun
                          • (Unit-type of (Picked unit)) Equal to Bullet Grenadier
                          • (Unit-type of (Picked unit)) Equal to Way Gate
                          • (Unit-type of (Picked unit)) Equal to Sentry Gun
                          • (Unit-type of (Picked unit)) Equal to Bullet Saw
                          • (Unit-type of (Picked unit)) Equal to Bullet Shotgun
                          • (Unit-type of (Picked unit)) Equal to Goblin Land Mine
                          • (Unit-type of (Picked unit)) Equal to Bullet Rocket
                          • (Unit-type of (Picked unit)) Equal to Bullet Normal
                          • (Unit-type of (Picked unit)) Equal to Bullet Sniper
                    • Then - Actions
                      • Set Temp_Point = (Position of (Picked unit))
                      • Special Effect - Create a special effect at Temp_Point using Objects\InventoryItems\ThunderLizardEgg\ThunderLizardEgg.mdl
                      • Special Effect - Destroy (Last created special effect)
                      • Custom script: call RemoveLocation (udg_Temp_Point)
                    • Else - Actions
                      • Set Temp_Point = (Position of (Picked unit))
                      • Special Effect - Create a special effect at Temp_Point using Objects\Spawnmodels\Critters\Albatross\CritterBloodAlbatross.mdl
                      • Special Effect - Destroy (Last created special effect)
                      • Custom script: call RemoveLocation (udg_Temp_Point)
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Picked unit)) Equal to Bullet Normal
            • Then - Actions
              • Unit Group - Pick every unit in Gun_Victim and do (Actions)
                • Loop - Actions
                  • Unit - Cause Gun_Caster[Gun_CusValue] to damage (Picked unit), dealing (Random real number between 270.00 and 290.00) damage of attack type Normal and damage type Normal
                  • Set Temp_Point = (Position of (Picked unit))
                  • Sound - Play Bullethit <gen> at 100.00% volume, located at Temp_Point with Z offset 0.00
                  • Sound - Destroy (Last played sound)
                  • Custom script: call RemoveLocation (udg_Temp_Point)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Or - Any (Conditions) are true
                        • Conditions
                          • (Unit-type of (Picked unit)) Equal to Bullet Machine
                          • (Unit-type of (Picked unit)) Equal to Bullet Rocket
                          • (Unit-type of (Picked unit)) Equal to Bullet Shotgun
                          • (Unit-type of (Picked unit)) Equal to Goblin Land Mine
                          • (Unit-type of (Picked unit)) Equal to Bullet Grenadier
                          • (Unit-type of (Picked unit)) Equal to Bullet Normal
                          • (Unit-type of (Picked unit)) Equal to Sentry Gun
                          • (Unit-type of (Picked unit)) Equal to Way Gate
                          • (Unit-type of (Picked unit)) Equal to Bullet Sniper
                    • Then - Actions
                      • Set Temp_Point = (Position of (Picked unit))
                      • Special Effect - Create a special effect at Temp_Point using Objects\InventoryItems\ThunderLizardEgg\ThunderLizardEgg.mdl
                      • Special Effect - Destroy (Last created special effect)
                      • Custom script: call RemoveLocation (udg_Temp_Point)
                    • Else - Actions
                      • Set Temp_Point = (Position of (Picked unit))
                      • Special Effect - Create a special effect at Temp_Point using Objects\Spawnmodels\Critters\Albatross\CritterBloodAlbatross.mdl
                      • Special Effect - Destroy (Last created special effect)
                      • Custom script: call RemoveLocation (udg_Temp_Point)
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Picked unit)) Equal to Bullet Shotgun
            • Then - Actions
              • Unit Group - Pick every unit in Gun_Victim and do (Actions)
                • Loop - Actions
                  • Unit - Cause Gun_Caster[Gun_CusValue] to damage (Picked unit), dealing (Random real number between 90.00 and 150.00) damage of attack type Normal and damage type Normal
                  • Set Temp_Point = (Position of (Picked unit))
                  • Sound - Play Bullethit <gen> at 100.00% volume, located at Temp_Point with Z offset 0.00
                  • Sound - Destroy (Last played sound)
                  • Custom script: call RemoveLocation (udg_Temp_Point)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Or - Any (Conditions) are true
                        • Conditions
                          • (Unit-type of (Picked unit)) Equal to Bullet Machine
                          • (Unit-type of (Picked unit)) Equal to Bullet Shotgun
                          • (Unit-type of (Picked unit)) Equal to Bullet Rocket
                          • (Unit-type of (Picked unit)) Equal to Bullet Saw
                          • (Unit-type of (Picked unit)) Equal to Goblin Land Mine
                          • (Unit-type of (Picked unit)) Equal to Bullet Grenadier
                          • (Unit-type of (Picked unit)) Equal to Bullet Normal
                          • (Unit-type of (Picked unit)) Equal to Bullet Shotgun
                          • (Unit-type of (Picked unit)) Equal to Sentry Gun
                          • (Unit-type of (Picked unit)) Equal to Way Gate
                          • (Unit-type of (Picked unit)) Equal to Bullet Sniper
                    • Then - Actions
                      • Set Temp_Point = (Position of (Picked unit))
                      • Special Effect - Create a special effect at Temp_Point using Objects\InventoryItems\ThunderLizardEgg\ThunderLizardEgg.mdl
                      • Special Effect - Destroy (Last created special effect)
                      • Custom script: call RemoveLocation (udg_Temp_Point)
                    • Else - Actions
                      • Set Temp_Point = (Position of (Picked unit))
                      • Special Effect - Create a special effect at Temp_Point using Objects\Spawnmodels\Critters\Albatross\CritterBloodAlbatross.mdl
                      • Special Effect - Destroy (Last created special effect)
                      • Custom script: call RemoveLocation (udg_Temp_Point)
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Picked unit)) Equal to Bullet Fire
            • Then - Actions
              • Unit Group - Pick every unit in Gun_Victim and do (Actions)
                • Loop - Actions
                  • Unit - Cause Gun_Caster[Gun_CusValue] to damage (Picked unit), dealing (Random real number between 75.00 and 160.00) damage of attack type Normal and damage type Fire
                  • Set Temp_Point = (Position of (Picked unit))
                  • Sound - Play Burn <gen> at 100.00% volume, located at Temp_Point with Z offset 0.00
                  • Sound - Destroy (Last played sound)
                  • Custom script: call RemoveLocation (udg_Temp_Point)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Or - Any (Conditions) are true
                        • Conditions
                          • (Unit-type of (Picked unit)) Equal to Bullet Machine
                          • (Unit-type of (Picked unit)) Equal to Bullet Shotgun
                          • (Unit-type of (Picked unit)) Equal to Bullet Grenadier
                          • (Unit-type of (Picked unit)) Equal to Bullet Saw
                          • (Unit-type of (Picked unit)) Equal to Bullet Rocket
                          • (Unit-type of (Picked unit)) Equal to Way Gate
                          • (Unit-type of (Picked unit)) Equal to Goblin Land Mine
                          • (Unit-type of (Picked unit)) Equal to Bullet Normal
                          • (Unit-type of (Picked unit)) Equal to Bullet Shotgun
                          • (Unit-type of (Picked unit)) Equal to Sentry Gun
                          • (Unit-type of (Picked unit)) Equal to Bullet Sniper
                    • Then - Actions
                      • Set Temp_Point = (Position of (Picked unit))
                      • Special Effect - Create a special effect at Temp_Point using Objects\InventoryItems\ThunderLizardEgg\ThunderLizardEgg.mdl
                      • Special Effect - Destroy (Last created special effect)
                      • Custom script: call RemoveLocation (udg_Temp_Point)
                    • Else - Actions
                      • Set Temp_Point = (Position of (Picked unit))
                      • Special Effect - Create a special effect at Temp_Point using Abilities\Spells\Human\FlameStrike\FlameStrikeEmbers.mdl
                      • Special Effect - Destroy (Last created special effect)
                      • Custom script: call RemoveLocation (udg_Temp_Point)
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Picked unit)) Equal to Bullet Grenadier
            • Then - Actions
              • Unit Group - Pick every unit in Gun_Victim and do (Actions)
                • Loop - Actions
                  • Unit - Cause Gun_Caster[Gun_CusValue] to damage (Picked unit), dealing (Random real number between 325.00 and 375.00) damage of attack type Normal and damage type Fire
                  • Set Temp_Point = (Position of (Picked unit))
                  • Sound - Play Burn <gen> at 100.00% volume, located at Temp_Point with Z offset 0.00
                  • Sound - Destroy (Last played sound)
                  • Custom script: call RemoveLocation (udg_Temp_Point)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Or - Any (Conditions) are true
                        • Conditions
                          • (Unit-type of (Picked unit)) Equal to Bullet Machine
                          • (Unit-type of (Picked unit)) Equal to Bullet Rocket
                          • (Unit-type of (Picked unit)) Equal to Bullet Grenadier
                          • (Unit-type of (Picked unit)) Equal to Goblin Land Mine
                          • (Unit-type of (Picked unit)) Equal to Bullet Saw
                          • (Unit-type of (Picked unit)) Equal to Sentry Gun
                          • (Unit-type of (Picked unit)) Equal to Bullet Shotgun
                          • (Unit-type of (Picked unit)) Equal to Bullet Shotgun
                          • (Unit-type of (Picked unit)) Equal to Way Gate
                          • (Unit-type of (Picked unit)) Equal to Bullet Normal
                          • (Unit-type of (Picked unit)) Equal to Bullet Sniper
                    • Then - Actions
                      • Set Temp_Point = (Position of (Picked unit))
                      • Special Effect - Create a special effect at Temp_Point using Objects\InventoryItems\ThunderLizardEgg\ThunderLizardEgg.mdl
                      • Special Effect - Destroy (Last created special effect)
                      • Custom script: call RemoveLocation (udg_Temp_Point)
                    • Else - Actions
                      • Set Temp_Point = (Position of (Picked unit))
                      • Special Effect - Create a special effect at Temp_Point using Abilities\Spells\Human\FlameStrike\FlameStrikeEmbers.mdl
                      • Special Effect - Destroy (Last created special effect)
                      • Custom script: call RemoveLocation (udg_Temp_Point)
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Picked unit)) Equal to Bullet Rocket
            • Then - Actions
              • Unit Group - Pick every unit in Gun_Victim and do (Actions)
                • Loop - Actions
                  • Unit - Cause Gun_Caster[Gun_CusValue] to damage (Picked unit), dealing (Random real number between 325.00 and 360.00) damage of attack type Normal and damage type Fire
                  • Set Temp_Point = (Position of (Picked unit))
                  • Sound - Play Burn <gen> at 100.00% volume, located at Temp_Point with Z offset 0.00
                  • Sound - Destroy (Last played sound)
                  • Custom script: call RemoveLocation (udg_Temp_Point)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Or - Any (Conditions) are true
                        • Conditions
                          • (Unit-type of (Picked unit)) Equal to Bullet Machine
                          • (Unit-type of (Picked unit)) Equal to Bullet Rocket
                          • (Unit-type of (Picked unit)) Equal to Goblin Land Mine
                          • (Unit-type of (Picked unit)) Equal to Bullet Grenadier
                          • (Unit-type of (Picked unit)) Equal to Way Gate
                          • (Unit-type of (Picked unit)) Equal to Bullet Shotgun
                          • (Unit-type of (Picked unit)) Equal to Bullet Saw
                          • (Unit-type of (Picked unit)) Equal to Bullet Shotgun
                          • (Unit-type of (Picked unit)) Equal to Sentry Gun
                          • (Unit-type of (Picked unit)) Equal to Bullet Normal
                          • (Unit-type of (Picked unit)) Equal to Bullet Sniper
                    • Then - Actions
                      • Set Temp_Point = (Position of (Picked unit))
                      • Special Effect - Create a special effect at Temp_Point using Objects\InventoryItems\ThunderLizardEgg\ThunderLizardEgg.mdl
                      • Special Effect - Destroy (Last created special effect)
                      • Custom script: call RemoveLocation (udg_Temp_Point)
                    • Else - Actions
                      • Set Temp_Point = (Position of (Picked unit))
                      • Special Effect - Create a special effect at Temp_Point using Abilities\Spells\Human\FlameStrike\FlameStrikeEmbers.mdl
                      • Special Effect - Destroy (Last created special effect)
                      • Custom script: call RemoveLocation (udg_Temp_Point)
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is in Top_Bullet) Equal to True
            • Then - Actions
              • Set TempPoint1 = (Temp_Point offset by 150.00 towards (Facing of (Picked unit)) degrees)
              • Set TempPoint2 = (Temp_Point offset by 75.00 towards (Facing of (Picked unit)) degrees)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Picked unit) is in Bullet9) Equal to True
                • Then - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Terrain pathing at Temp_Point of type Walkability is off) Equal to True
                      • Or - Any (Conditions) are true
                        • Conditions
                          • (Terrain cliff level at TempPoint1) Greater than 9
                          • (Terrain cliff level at TempPoint2) Greater than 9
                    • Then - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Unit-type of (Picked unit)) Not equal to Bullet Fire
                        • Then - Actions
                          • Set Temp_Point = (Position of (Picked unit))
                          • Special Effect - Create a special effect at Temp_Point using Objects\InventoryItems\ThunderLizardEgg\ThunderLizardEgg.mdl
                          • Special Effect - Destroy (Last created special effect)
                          • Custom script: call RemoveLocation (udg_Temp_Point)
                        • Else - Actions
                          • Set Temp_Point = (Position of (Picked unit))
                          • Special Effect - Create a special effect at Temp_Point using Abilities\Spells\Items\AIfb\AIfbSpecialArt.mdl
                          • Special Effect - Destroy (Last created special effect)
                          • Custom script: call RemoveLocation (udg_Temp_Point)
                      • Unit - Kill (Picked unit)
                      • Unit Group - Remove (Picked unit) from Gun_StartGroup
                    • Else - Actions
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Terrain pathing at Temp_Point of type Walkability is off) Equal to True
                      • Or - Any (Conditions) are true
                        • Conditions
                          • (Terrain cliff level at TempPoint1) Greater than 10
                          • (Terrain cliff level at TempPoint2) Greater than 10
                    • Then - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Unit-type of (Picked unit)) Not equal to Bullet Fire
                        • Then - Actions
                          • Set Temp_Point = (Position of (Picked unit))
                          • Special Effect - Create a special effect at Temp_Point using Objects\InventoryItems\ThunderLizardEgg\ThunderLizardEgg.mdl
                          • Special Effect - Destroy (Last created special effect)
                          • Custom script: call RemoveLocation (udg_Temp_Point)
                        • Else - Actions
                          • Set Temp_Point = (Position of (Picked unit))
                          • Special Effect - Create a special effect at Temp_Point using Abilities\Spells\Items\AIfb\AIfbSpecialArt.mdl
                          • Special Effect - Destroy (Last created special effect)
                          • Custom script: call RemoveLocation (udg_Temp_Point)
                      • Unit - Kill (Picked unit)
                      • Unit Group - Remove (Picked unit) from Gun_StartGroup
                    • Else - Actions
              • Custom script: call RemoveLocation (udg_TempPoint1)
              • Custom script: call RemoveLocation (udg_TempPoint2)
            • Else - Actions
              • Set Temp_Point = (Position of (Picked unit))
              • Set TempPoint1 = (Temp_Point offset by 150.00 towards (Facing of (Picked unit)) degrees)
              • Set TempPoint2 = (Temp_Point offset by 75.00 towards (Facing of (Picked unit)) degrees)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Terrain pathing at Temp_Point of type Walkability is off) Equal to True
                  • Or - Any (Conditions) are true
                    • Conditions
                      • (Terrain cliff level at TempPoint1) Greater than (Terrain cliff level at Temp_Point)
                      • (Terrain cliff level at TempPoint2) Greater than (Terrain cliff level at Temp_Point)
                • Then - Actions
                  • Custom script: call RemoveLocation (udg_Temp_Point)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Unit-type of (Picked unit)) Not equal to Bullet Fire
                    • Then - Actions
                      • Set Temp_Point = (Position of (Picked unit))
                      • Special Effect - Create a special effect at Temp_Point using Objects\InventoryItems\ThunderLizardEgg\ThunderLizardEgg.mdl
                      • Special Effect - Destroy (Last created special effect)
                      • Custom script: call RemoveLocation (udg_Temp_Point)
                    • Else - Actions
                      • Set Temp_Point = (Position of (Picked unit))
                      • Special Effect - Create a special effect at Temp_Point using Abilities\Spells\Items\AIfb\AIfbSpecialArt.mdl
                      • Special Effect - Destroy (Last created special effect)
                      • Custom script: call RemoveLocation (udg_Temp_Point)
                  • Unit - Kill (Picked unit)
                  • Unit Group - Remove (Picked unit) from Gun_StartGroup
                • Else - Actions
              • Custom script: call RemoveLocation (udg_TempPoint1)
              • Custom script: call RemoveLocation (udg_TempPoint2)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is in Top_Bullet) Equal to True
            • Then - Actions
              • Destructible - Pick every destructible within 60.00 of Gun_Movement and do (Actions)
                • Loop - Actions
                  • Set TempPoint1 = (Position of (Picked destructible))
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Terrain cliff level at TempPoint1) Equal to 10
                      • ((Picked destructible) is alive) Equal to True
                      • (Destructible-type of (Picked destructible)) Not equal to Z Light
                    • Then - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • Or - Any (Conditions) are true
                            • Conditions
                              • (Unit-type of (Picked unit)) Equal to Bullet Machine
                              • (Unit-type of (Picked unit)) Equal to Bullet Rocket
                              • (Unit-type of (Picked unit)) Equal to Goblin Land Mine
                              • (Unit-type of (Picked unit)) Equal to Bullet Saw
                              • (Unit-type of (Picked unit)) Equal to Bullet Shotgun
                              • (Unit-type of (Picked unit)) Equal to Bullet Shotgun
                              • (Unit-type of (Picked unit)) Equal to Bullet Grenadier
                              • (Unit-type of (Picked unit)) Equal to Bullet Normal
                              • (Unit-type of (Picked unit)) Equal to Sentry Gun
                              • (Unit-type of (Picked unit)) Equal to Way Gate
                              • (Unit-type of (Picked unit)) Equal to Bullet Sniper
                        • Then - Actions
                          • Set Temp_Point = (Position of (Picked unit))
                          • Special Effect - Create a special effect at Temp_Point using Objects\InventoryItems\ThunderLizardEgg\ThunderLizardEgg.mdl
                          • Special Effect - Destroy (Last created special effect)
                          • Custom script: call RemoveLocation (udg_Temp_Point)
                        • Else - Actions
                          • Set Temp_Point = (Position of (Picked unit))
                          • Special Effect - Create a special effect at Temp_Point using Abilities\Spells\Human\FlameStrike\FlameStrikeEmbers.mdl
                          • Special Effect - Destroy (Last created special effect)
                          • Custom script: call RemoveLocation (udg_Temp_Point)
                      • Unit - Kill (Picked unit)
                      • Unit Group - Remove (Picked unit) from Gun_StartGroup
                    • Else - Actions
                  • Custom script: call RemoveLocation (udg_TempPoint1)
            • Else - Actions
              • Destructible - Pick every destructible within 60.00 of Gun_Movement and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ((Picked destructible) is alive) Equal to True
                      • (Destructible-type of (Picked destructible)) Not equal to Z Light
                    • Then - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • Or - Any (Conditions) are true
                            • Conditions
                              • (Unit-type of (Picked unit)) Equal to Bullet Machine
                              • (Unit-type of (Picked unit)) Equal to Bullet Rocket
                              • (Unit-type of (Picked unit)) Equal to Goblin Land Mine
                              • (Unit-type of (Picked unit)) Equal to Bullet Saw
                              • (Unit-type of (Picked unit)) Equal to Bullet Shotgun
                              • (Unit-type of (Picked unit)) Equal to Bullet Shotgun
                              • (Unit-type of (Picked unit)) Equal to Bullet Grenadier
                              • (Unit-type of (Picked unit)) Equal to Bullet Normal
                              • (Unit-type of (Picked unit)) Equal to Sentry Gun
                              • (Unit-type of (Picked unit)) Equal to Way Gate
                              • (Unit-type of (Picked unit)) Equal to Bullet Sniper
                        • Then - Actions
                          • Set Temp_Point = (Position of (Picked unit))
                          • Special Effect - Create a special effect at Temp_Point using Objects\InventoryItems\ThunderLizardEgg\ThunderLizardEgg.mdl
                          • Special Effect - Destroy (Last created special effect)
                          • Custom script: call RemoveLocation (udg_Temp_Point)
                        • Else - Actions
                          • Set Temp_Point = (Position of (Picked unit))
                          • Special Effect - Create a special effect at Temp_Point using Abilities\Spells\Human\FlameStrike\FlameStrikeEmbers.mdl
                          • Special Effect - Destroy (Last created special effect)
                          • Custom script: call RemoveLocation (udg_Temp_Point)
                      • Unit - Kill (Picked unit)
                      • Unit Group - Remove (Picked unit) from Gun_StartGroup
                    • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • Gun_DistanceTravel[Gun_CusValue] Greater than or equal to Gun_Distance[Gun_CusValue]
                  • (Number of units in Gun_UnitGroup) Greater than 0
            • Then - Actions
              • Unit - Kill (Picked unit)
              • Unit Group - Remove (Picked unit) from Gun_StartGroup
            • Else - Actions
          • Custom script: call RemoveLocation (udg_Gun_DummyLoc)
          • Custom script: call RemoveLocation (udg_Gun_Movement)
          • Custom script: call DestroyGroup (udg_Gun_Victim)
      • Set x = No unit
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in Gun_StartGroup) Equal to 0
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions

hope this help
you dont have to understand what it do or any glitch, just help me remove the leak

thanks a lot at this point
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,287
You are leaking a ton of locations...

Set Gun_UnitGroup = (Units within 60.00 of Gun_Movement matching (((((Unit-type of (Matching unit)) Not equal to Bullet Fire) and ((Terrain cliff level at (Position of (Matching unit))) Equal to (Terrain cliff level at (Position of (Picked unit))))) and ((Current flying height o

This leaks atleast 2 for example....
Please fix all location leaks...

Incase you wonder why
Position of (Matching unit)
That returns a new location, nowhere do you remove it...

Position of (Picked unit)
That returns a new location, nowhere do you remove it...
 
Level 8
Joined
Jan 4, 2009
Messages
110
You are leaking a ton of locations...

Set Gun_UnitGroup = (Units within 60.00 of Gun_Movement matching (((((Unit-type of (Matching unit)) Not equal to Bullet Fire) and ((Terrain cliff level at (Position of (Matching unit))) Equal to (Terrain cliff level at (Position of (Picked unit))))) and ((Current flying height o

This leaks atleast 2 for example....
Please fix all location leaks...

Incase you wonder why
Position of (Matching unit)
That returns a new location, nowhere do you remove it...

Position of (Picked unit)
That returns a new location, nowhere do you remove it...

OMG.. now that you mention it, i notice!
lol my bad, thank you a lot
 
Last edited:

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,287
Also run the trigger every 0.016 seconds rather than 0.01 seconds. This will still mean that it runs every frame (perfectly smooth) but will reduce wasted frames (updating position twice in 1 frame is a waste of time.

WC3 is prety much hard capped to 60 Frames per second. Even if you can get it faster (never heard of people suceeding), most people have displays which only support 60 frames per second.

Less itterations + less leaks = better performance
 
Level 8
Joined
Jan 4, 2009
Messages
110
Is this fixed the locations?

  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Unit-type of (Picked unit)) Equal to Bullet Machine
    • Then - Actions
      • Set Gun_UnitGroup = (Units within 90.00 of Gun_Movement matching ((((Unit-type of (Matching unit)) Not equal to Bullet Fire) and ((Current flying height of (Matching unit)) Less than or equal to 90.00)) and (((((Matching unit) is alive) Equal to True) and (((Owner of (Matching u
      • Set TempPoint1 = (Position of (Picked unit))
      • Unit Group - Pick every unit in Gun_UnitGroup and do (Actions)
        • Loop - Actions
          • Set TempPoint2 = (Position of (Picked unit))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • (Terrain cliff level at TempPoint2) Not equal to 9
                  • (Terrain cliff level at TempPoint2) Not equal to (Terrain cliff level at TempPoint1)
            • Then - Actions
              • Unit Group - Remove (Picked unit) from Gun_UnitGroup
            • Else - Actions
          • Custom script: call RemoveLocation (udg_TempPoint2)
      • Set Gun_Victim = (Random 1 units from Gun_UnitGroup)
      • Custom script: call DestroyGroup (udg_Gun_UnitGroup)
      • Custom script: call RemoveLocation (udg_TempPoint1)
    • Else - Actions
      • Set Gun_UnitGroup = (Units within 60.00 of Gun_Movement matching ((((Unit-type of (Matching unit)) Not equal to Bullet Fire) and ((Current flying height of (Matching unit)) Less than or equal to 90.00)) and (((((Matching unit) is alive) Equal to True) and (((Owner of (Matching u
      • Set TempPoint1 = (Position of (Picked unit))
      • Unit Group - Pick every unit in Gun_UnitGroup and do (Actions)
        • Loop - Actions
          • Set TempPoint2 = (Position of (Picked unit))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • (Terrain cliff level at TempPoint2) Not equal to 9
                  • (Terrain cliff level at TempPoint2) Not equal to (Terrain cliff level at TempPoint1)
            • Then - Actions
              • Unit Group - Remove (Picked unit) from Gun_UnitGroup
            • Else - Actions
          • Custom script: call RemoveLocation (udg_TempPoint2)
      • Set Gun_Victim = (Random 1 units from Gun_UnitGroup)
      • Custom script: call DestroyGroup (udg_Gun_UnitGroup)
      • Custom script: call RemoveLocation (udg_TempPoint1)
 
Level 8
Joined
Jan 4, 2009
Messages
110
Still leaks somewhere, the game still gets lagger and lagger.

btw is this leak?
  • JU auto radar
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Set Temp_Group = (Units in (Playable map area) matching ((((Unit-type of (Matching unit)) Not equal to Goblin Land Mine) and (((Matching unit) is A structure) Not equal to True)) and (((((Matching unit) is alive) Equal to True) and (((Matching unit) is Undead) Not equal to Tr
      • Unit Group - Pick every unit in Temp_Group and do (Actions)
        • Loop - Actions
          • Set TempPoint1 = (Position of (Picked unit))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Owner of (Picked unit)) is an enemy of Juggernaut_player) Equal to True
            • Then - Actions
              • Cinematic - Ping minimap for (All players matching ((Matching player) Equal to Juggernaut_player)) at TempPoint1 for 1.00 seconds, using a Simple ping of color (100.00%, 0.00%, 0.00%)
            • Else - Actions
              • Cinematic - Ping minimap for (All players matching ((Matching player) Equal to Juggernaut_player)) at TempPoint1 for 1.00 seconds, using a Simple ping of color (0.00%, 0.00%, 100.00%)
          • Custom script: call RemoveLocation (udg_TempPoint1)
      • Custom script: call DestroyGroup (udg_Temp_Group)
is playablemap leak? and if i change to a region (gen) is leak?
 
Level 8
Joined
Jan 4, 2009
Messages
110
ok the leak dont seem to go away,
sorry but ima ask again
is this causes leak? if i do it like 100 times

  • Actions
    • Wait 12.00 seconds
    • Dialog - Clear Spawn[1]
    • Dialog - Change the title of Spawn[1] to |cffff0000Select Cl...
    • Dialog - Create a dialog button for Spawn[1] labelled |cffff0000Random|r
    • Set Button_RANDOM[1] = (Last created dialog Button)
    • Dialog - Create a dialog button for Spawn[1] labelled |cffffcc00Brawler|r
    • Set Button_Brawler[1] = (Last created dialog Button)
    • Dialog - Create a dialog button for Spawn[1] labelled Engineer
    • Set Button_Engineer[1] = (Last created dialog Button)
    • Dialog - Create a dialog button for Spawn[1] labelled Grenadier
    • Set Button_Grenadier[1] = (Last created dialog Button)
    • Dialog - Create a dialog button for Spawn[1] labelled Maruader
    • Set Button_Maruader[1] = (Last created dialog Button)
    • Dialog - Create a dialog button for Spawn[1] labelled Recon
    • Set Button_Recon[1] = (Last created dialog Button)
    • Dialog - Create a dialog button for Spawn[1] labelled Medic
    • Set Button_Medic[1] = (Last created dialog Button)
    • Dialog - Create a dialog button for Spawn[1] labelled Pyro
    • Set Button_Pyro[1] = (Last created dialog Button)
    • Dialog - Create a dialog button for Spawn[1] labelled Rocketeer
    • Set Button_Rocketeer[1] = (Last created dialog Button)
    • Dialog - Create a dialog button for Spawn[1] labelled Sniper
    • Set Button_Sniper[1] = (Last created dialog Button)
    • Dialog - Show Spawn[1] for Player 1 (Red)
and also which one leaks, which one not?

  • Actions
    • Set All_player_playing = (All players matching ((((Matching player) controller) Equal to User) and (((Matching player) slot status) Equal to Is playing)))
    • Game - Display to All_player_playing the text: Hello
    • Custom script: call DestroyForce( udg_All_player_playing )
  • Actions
    • Game - Display to (All players) the text: Hello
 
Status
Not open for further replies.
Top