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

Possibility of leaks?

Status
Not open for further replies.
Level 3
Joined
Nov 26, 2009
Messages
35
Does this trigger have leaks or not?
  • FireWave Throw
    • Events
      • Unit - A unit Приводит способность в действие
    • Conditions
      • (Ability being cast) равно Fire Wave (throw)
    • Actions
      • Set FireWaveCaster = (Casting unit)
      • Set FireWavePoint = (Position of FireWaveCaster)
      • Set FireWaveTargetPoint = (Target point of ability being cast)
      • Set FireWaveDamage = (((Разум of FireWaveCaster (Включить bonuses)) x 3) x (Integer(FireEssence)))
      • Set FireWaveRange = 100.00
      • Set FireWaveDegrees = (Angle from FireWavePoint to FireWaveTargetPoint)
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • Set FireWaveDegreesPoint = ((Position of FireWaveCaster) offset by FireWaveRange towards FireWaveDegrees degrees)
          • Unit - Create 1 FireWave for (Owner of FireWaveCaster) at FireWaveDegreesPoint facing 0.00 degrees
          • Unit Group - Add (Last created unit) to FireWaveDummyGroup
          • Set FireWaveRange = (FireWaveRange + 100.00)
          • Set FireWaveDummyPosition = (Position of (Last created unit))
          • Set FireWavePick = (Units within 125.00 of FireWaveDummyPosition matching (((Matching unit) belongs to an enemy of (Owner of FireWaveCaster)) равно Да))
          • Custom script: call RemoveLocation(udg_FireWaveDegreesPoint)
          • Custom script: call RemoveLocation(udg_FireWaveWaveDummyPosition)
          • Unit Group - Pick every unit in FireWavePick and do (Actions)
            • Loop - Actions
              • Unit Group - Add (Picked unit) to FireWaveGroup
      • Unit Group - Pick every unit in FireWaveGroup and do (Actions)
        • Loop - Actions
          • Unit - Cause FireWaveCaster to damage (Picked unit), dealing (Real(FireWaveDamage)) damage of attack type Заклинание and damage type Обычный
          • Unit Group - Remove all units of FireWaveGroup from FireWaveGroup
          • Unit Group - Remove all units of FireWavePick from FireWaveGroup
      • Countdown Timer - Start FireWaveTimer as a Однократный timer that will expire in 1.00 seconds
      • Custom script: call RemoveLocation(udg_FireWavePoint)
      • Custom script: call RemoveLocation(udg_FireWaveTargetPoint)
  • FireWaveDummyRemove
    • Events
      • Time - FireWaveTimer expires
    • Conditions
    • Actions
      • Unit Group - Pick every unit in FireWaveDummyGroup and do (Actions)
        • Loop - Actions
          • Unit - Remove (Picked unit) from the game
          • Unit Group - Remove all units of FireWaveDummyGroup from FireWaveDummyGroup
 
Level 39
Joined
Feb 27, 2007
Messages
4,989
You're leaking FireWavePick 6 times. This tutorial shows how to clean group leaks in 2 ways: Things That Leak. Aside from that, the points are properly cleaned and FireWaveGroup and FireWaveDummyGroup don't need to be destroyed, just have all units removed from them (which you've done). There are some... odd choices, though:
  • FireWaveDegreesPoint and FireWaveDummyPosition are the same location, no need to use the second one. You create a dummy there and then immediately ask its position. Only reason to do this would be if the dummies have collision and you want to pick from where they end up being displaced too rather than where they are put down.
  • FireWaveGroup doesn't really need to exist; you could just damage the units in the Pick for FireWavePick instead of adding them to FireWaveGroup and then damaging right after that.
  • Why are you removing units from FireWaveGroup inside its Pick action? You should clear the group after the Pick.
  • There is the "Unit Group - Remove all units" action you should use to clear unit groups (it might be called "clear" in GUI too, don't remember off the top of my head).
  • Why are you removing units of FireWavePick from FireWaveGroup? Those units are already removed by the previous line.
  • Why do you need to wait 1s before removing the dummies? You could just give them 1s expiration timers instead, and if you really don't want to see their death animation just remove them with a trigger when they die.
  • This spell as written can only have 1 instance active (no simultaneous instances). Removing the need to wait with a timer would make it fully MUI.
 
Level 3
Joined
Nov 26, 2009
Messages
35
Thanks for answer!
Sry for my bad english.
You're leaking FireWavePick 6 times. This tutorial shows how to clean group leaks in 2 ways: Things That Leak. Aside from that, the points are properly cleaned and FireWaveGroup and FireWaveDummyGroup don't need to be destroyed, just have all units removed from them (which you've done). There are some... odd choices, though:
  • FireWaveGroup doesn't really need to exist; you could just damage the units in the Pick for FireWavePick instead of adding them to FireWaveGroup and then damaging right after that.
I had a problem with that, because visually spell should hit enemy but it don't. If i do like you said, then it will be something like this
upload_2019-12-30_22-32-56.png

In "arrow" places enemy will be not damaged. But if i do something like this
upload_2019-12-30_22-34-21.png

Then visually all will be good, but enemy will take damage at least 2 times. Unit Group can help with that problem, so units will receive damage only once.

ADD: Ah im retarded. Now i understand what you mean.
 
Status
Not open for further replies.
Top