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

[Trigger] Help With Leaks

Status
Not open for further replies.
Level 4
Joined
Nov 10, 2007
Messages
56
I'm using Kitamatake's Fire Slash Combo spell in my map. I was working on an older laptop and after some modifications of that skill it started to lag, greatly. On my computer, however, it's working perfectly. The funny thing is, the lag starts (on laptop) when units meet in the middle and start to fight (It' s an AoS map). When I disable the trigger for the spell, it doesn't lag. I tought the leaks in the trigger cause the problem but it lags without even using the spell so I'm confused. In original spell, event was: "Begins casting an ability" but I changed it to: "Starts the effect..." becouse there was no cooldown or mana usage when casted. After the change lag started. Here's the trigger if anyone feels like helping.

P.S. What leaks in triggers except Special Effects? Unit Groups???

Note: I'm somewhat of a beginner in this but learning fast, and I'm from Croatia so that explains the mistakes in writing, if there are any.

Spell name is "Blade Rage", hero name is Kitamatake (by the creator of the spell)
  • Blade Rage Kitamatake
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Blade Rage (Kitamatake)
    • Actions
      • Set BladeVictim = (Target unit of ability being cast)
      • Set Kitamatake = (Casting unit)
      • Unit - Make Kitamatake Invulnerable
      • Unit - Pause Kitamatake
      • Unit - Pause BladeVictim
      • Unit - Turn collision for Kitamatake Off
      • Unit - Make Kitamatake face BladeVictim over 0.00 seconds
      • Unit - Make BladeVictim face Kitamatake over 0.00 seconds
      • Wait 0.05 seconds
      • Animation - Change Kitamatake's animation speed to 25.00% of its original speed
      • Animation - Play Kitamatake's stand ready animation
      • Wait 2.80 seconds
      • Animation - Change Kitamatake's animation speed to 0.00% of its original speed
      • Special Effect - Create a special effect attached to the weapon of Kitamatake using Abilities\Weapons\PhoenixMissile\Phoenix_Missile.mdl
      • Set BladeEffect = (Last created special effect)
      • Wait 0.20 seconds
      • Special Effect - Destroy BladeEffect
      • Wait 1.00 seconds
      • Special Effect - Create a special effect attached to the weapon of Kitamatake using Abilities\Weapons\PhoenixMissile\Phoenix_Missile.mdl
      • Set BladeEffect = (Last created special effect)
      • Animation - Change Kitamatake's animation speed to 300.00% of its original speed
      • For each (Integer A) from 1 to 3, do (Actions)
        • Loop - Actions
          • Set BladeRageAttackPoint = ((Position of BladeVictim) offset by 150.00 towards ((Facing of Kitamatake) + (Random real number between -80.00 and 80.00)) degrees)
          • Unit - Move Kitamatake instantly to BladeRageAttackPoint, facing (Position of BladeVictim)
          • Animation - Play Kitamatake's attack animation, using only Rare animations
          • Special Effect - Create a special effect at (Position of BladeVictim) using Objects\Spawnmodels\Human\HumanLargeDeathExplode\HumanLargeDeathExplode.mdl
          • Animation - Play BladeVictim's death animation
          • Special Effect - Create a special effect at (Position of BladeVictim) using Objects\Spawnmodels\Human\FragmentationShards\FragBoomSpawn.mdl
          • If ((Level of Blade Rage (Kitamatake) for Kitamatake) Equal to 1) then do (Unit - Cause Kitamatake to damage BladeVictim, dealing 30.00 damage of attack type Hero and damage type Normal) else do (Do nothing)
          • If ((Level of Blade Rage (Kitamatake) for Kitamatake) Equal to 2) then do (Unit - Cause Kitamatake to damage BladeVictim, dealing 50.00 damage of attack type Hero and damage type Normal) else do (Do nothing)
          • If ((Level of Blade Rage (Kitamatake) for Kitamatake) Equal to 3) then do (Unit - Cause Kitamatake to damage BladeVictim, dealing 70.00 damage of attack type Hero and damage type Normal) else do (Do nothing)
          • Wait 0.15 seconds
          • Unit - Make Kitamatake face BladeVictim over 0.00 seconds
          • Animation - Play Kitamatake's attack animation, using only Rare animations
          • Special Effect - Create a special effect at (Position of BladeVictim) using Objects\Spawnmodels\Human\HumanLargeDeathExplode\HumanLargeDeathExplode.mdl
          • Animation - Play BladeVictim's death animation
          • Special Effect - Create a special effect at (Position of BladeVictim) using Objects\Spawnmodels\Human\FragmentationShards\FragBoomSpawn.mdl
          • If ((Level of Blade Rage (Kitamatake) for Kitamatake) Equal to 1) then do (Unit - Cause Kitamatake to damage BladeVictim, dealing 30.00 damage of attack type Hero and damage type Normal) else do (Do nothing)
          • If ((Level of Blade Rage (Kitamatake) for Kitamatake) Equal to 2) then do (Unit - Cause Kitamatake to damage BladeVictim, dealing 50.00 damage of attack type Hero and damage type Normal) else do (Do nothing)
          • If ((Level of Blade Rage (Kitamatake) for Kitamatake) Equal to 3) then do (Unit - Cause Kitamatake to damage BladeVictim, dealing 70.00 damage of attack type Hero and damage type Normal) else do (Do nothing)
          • Wait 0.15 seconds
          • Unit - Make Kitamatake face BladeVictim over 0.00 seconds
          • Animation - Play Kitamatake's attack animation, using only Rare animations
          • Special Effect - Create a special effect at (Position of BladeVictim) using Objects\Spawnmodels\Human\HumanLargeDeathExplode\HumanLargeDeathExplode.mdl
          • Animation - Play BladeVictim's death animation
          • Special Effect - Create a special effect at (Position of BladeVictim) using Objects\Spawnmodels\Human\FragmentationShards\FragBoomSpawn.mdl
          • If ((Level of Blade Rage (Kitamatake) for Kitamatake) Equal to 1) then do (Unit - Cause Kitamatake to damage BladeVictim, dealing 30.00 damage of attack type Hero and damage type Normal) else do (Do nothing)
          • If ((Level of Blade Rage (Kitamatake) for Kitamatake) Equal to 2) then do (Unit - Cause Kitamatake to damage BladeVictim, dealing 50.00 damage of attack type Hero and damage type Normal) else do (Do nothing)
          • If ((Level of Blade Rage (Kitamatake) for Kitamatake) Equal to 3) then do (Unit - Cause Kitamatake to damage BladeVictim, dealing 70.00 damage of attack type Hero and damage type Normal) else do (Do nothing)
      • Unit - Move Kitamatake instantly to ((Position of BladeVictim) offset by 120.00 towards (Facing of BladeVictim) degrees)
      • Unit - Make Kitamatake face BladeVictim over 0.00 seconds
      • Animation - Change Kitamatake's animation speed to 30.00% of its original speed
      • Animation - Play Kitamatake's slam animation
      • Animation - Reset BladeVictim's animation
      • Wait 2.60 seconds
      • If ((Level of Blade Rage (Kitamatake) for Kitamatake) Equal to 1) then do (Unit - Cause Kitamatake to damage BladeVictim, dealing 130.00 damage of attack type Hero and damage type Normal) else do (Do nothing)
      • If ((Level of Blade Rage (Kitamatake) for Kitamatake) Equal to 2) then do (Unit - Cause Kitamatake to damage BladeVictim, dealing 150.00 damage of attack type Hero and damage type Normal) else do (Do nothing)
      • If ((Level of Blade Rage (Kitamatake) for Kitamatake) Equal to 3) then do (Unit - Cause Kitamatake to damage BladeVictim, dealing 170.00 damage of attack type Hero and damage type Normal) else do (Do nothing)
      • Special Effect - Create a special effect at (Position of BladeVictim) using Objects\Spawnmodels\Other\NeutralBuildingExplosion\NeutralBuildingExplosion.mdl
      • Special Effect - Create a special effect at (Position of BladeVictim) using Abilities\Spells\Human\FlameStrike\FlameStrike1.mdl
      • Special Effect - Create a special effect at ((Position of BladeVictim) offset by 100.00 towards 0.00 degrees) using Objects\Spawnmodels\Other\NeutralBuildingExplosion\NeutralBuildingExplosion.mdl
      • Special Effect - Create a special effect at ((Position of BladeVictim) offset by 50.00 towards 45.00 degrees) using Objects\Spawnmodels\Human\SmallFlameSpawn\SmallFlameSpawn.mdl
      • Special Effect - Create a special effect at ((Position of BladeVictim) offset by 100.00 towards 90.00 degrees) using Objects\Spawnmodels\Other\NeutralBuildingExplosion\NeutralBuildingExplosion.mdl
      • Special Effect - Create a special effect at ((Position of BladeVictim) offset by 50.00 towards 315.00 degrees) using Objects\Spawnmodels\Human\SmallFlameSpawn\SmallFlameSpawn.mdl
      • Special Effect - Create a special effect at ((Position of BladeVictim) offset by 100.00 towards 180.00 degrees) using Objects\Spawnmodels\Other\NeutralBuildingExplosion\NeutralBuildingExplosion.mdl
      • Special Effect - Create a special effect at ((Position of BladeVictim) offset by 50.00 towards 225.00 degrees) using Objects\Spawnmodels\Human\SmallFlameSpawn\SmallFlameSpawn.mdl
      • Special Effect - Create a special effect at ((Position of BladeVictim) offset by 100.00 towards 270.00 degrees) using Objects\Spawnmodels\Other\NeutralBuildingExplosion\NeutralBuildingExplosion.mdl
      • Special Effect - Create a special effect at ((Position of BladeVictim) offset by 50.00 towards 135.00 degrees) using Objects\Spawnmodels\Human\SmallFlameSpawn\SmallFlameSpawn.mdl
      • Special Effect - Destroy BladeEffect
      • Wait 0.10 seconds
      • Unit - Make Kitamatake face (Facing of BladeVictim) over 0.00 seconds
      • Animation - Change Kitamatake's animation speed to 1000.00% of its original speed
      • Animation - Play Kitamatake's stand ready animation
      • Wait 0.07 seconds
      • Animation - Change Kitamatake's animation speed to 0.00% of its original speed
      • Wait 0.03 seconds
      • Unit - Move Kitamatake instantly to ((Position of BladeVictim) offset by 600.00 towards (Facing of BladeVictim) degrees)
      • Wait 0.05 seconds
      • Special Effect - Create a special effect at (Position of Kitamatake) using Abilities\Spells\NightElf\Blink\BlinkCaster.mdl
      • Wait 0.40 seconds
      • Special Effect - Create a special effect attached to the weapon of Kitamatake using Abilities\Spells\Undead\DeathCoil\DeathCoilSpecialArt.mdl
      • Wait 0.20 seconds
      • Animation - Change Kitamatake's animation speed to 100.00% of its original speed
      • Animation - Reset Kitamatake's animation
      • Unit - Unpause Kitamatake
      • Unit - Unpause BladeVictim
      • Unit - Turn collision for Kitamatake On
      • Unit - Make Kitamatake Vulnerable
 
Last edited:
Level 9
Joined
Oct 17, 2007
Messages
547
Your loops got 2 waits and effects that remain on the map for the entire game, too many waits in that one trigger, the speciall effect section near bottom leaks. Both the effects and the locations they were created at. You need to set EVERY location to a variable then remove it manually after the effect is created. Read the "things that leak" thread for more info.

http://www.hiveworkshop.com/forums/showthread.php?t=35124
 
Level 6
Joined
Nov 28, 2007
Messages
203
I think he thinks about that the waits makes the trigger non-MUI (Multi Unit Instanceable), which means that the trigger can only be used with one unit at the time. I have a way to make the trigger MUI, but i don't wanna do it if u don't need it, so write here again if u need it :)

And you have a lot of position leaks, for example every time you create a special effect. You can remove them by doing this:
  • Set RemovablePoint = (Position of BladeVictim)
before any special effect create function and this:
  • Custom script: call RemoveLocation(udg_RemovablePoint)
after any special effect create function.
 
Level 4
Joined
Nov 10, 2007
Messages
56
No thanks, I have no problem with MUI couse the map I'm making is AoS and players can't have the same hero. There's one thing that confuses me, is this an effect leak or position leak:
  • Special Effect - Create a special effect at (Position of BladeVictim) using Objects\Spawnmodels\Human\FragmentationShards\FragBoomSpawn.mdl
 
Level 6
Joined
Nov 28, 2007
Messages
203
It has both effect leak and position leaks. "at (Position of BladeVictim)" automatically creates a position that won't be removed unless you set it to a variable first and use it as "at (Point_Variable)" and.. then removes it using "call RemoveLocation(udg_Point_Variable)"
 
Level 9
Joined
Oct 17, 2007
Messages
547
Even if its not suppose to be MUI, make sure the cool down of the spell is much longer than all those waits, because waits are usually longer than what you set it as, and if that hero cast the spell again too soon it might cause a problem.
 
Status
Not open for further replies.
Top