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

[Solved]Trigger Leak Check

Status
Not open for further replies.
Level 5
Joined
Jun 13, 2017
Messages
83
Does This trigger leak?
The special effect in the first trigger, and the destroy on second

  • Rock Special Effect
    • Events
      • Time - Every 0.35 seconds of game time
    • Conditions
    • Actions
      • Set SE_DestroyWrite = (SE_DestroyWrite + 1)
      • Set DB_AbP[1] = (Position of DB_DU[1])
      • Special Effect - Create a special effect at (WB_Dummy_Point[0] offset by 5.00 towards (Facing of WB_Dummy_Units[0]) degrees) using Objects\Spawnmodels\Undead\ImpaleTargetDust\ImpaleTargetDust.mdl
      • Set DB_SE[SE_DestroyWrite] = (Last created special effect)
      • Custom script: call RemoveLocation(udg_DB_AbP[1])



Destroy SE trigger will run from another trigger

  • Destroy SE
    • Events
    • Conditions
    • Actions
      • For each (Integer A) from 1 to SE_DestroyWrite, do (Actions)
        • Loop - Actions
          • Set SE_DestroyRead = (SE_DestroyRead + 1)
          • Special Effect - Destroy DB_SE[SE_DestroyRead]

So will it destroy all special effect created like this?
 

Wrda

Spell Reviewer
Level 25
Joined
Nov 18, 2012
Messages
1,870
WB_Dummy_Point[0] leaks, also
(WB_Dummy_Point[0] offset by 5.00 towards (Facing of WB_Dummy_Units[0]) degrees) is another leak. When working with off sets, you are creating 2 points.
When looped for Integer A, you don't need to use another variable to use it in the loop, directly click on the loop variable, it should be Special Effect - Destroy DB_SE[Integer A]
I still don't know why you are destroying special effects in another trigger, but ok.
 
Level 5
Joined
Jun 13, 2017
Messages
83
Well for the WB_Dummy_Point i just forgot to change it it was an old variable thanks for pointing it out.
Here is the new one:
  • Rock Special Effect
    • Events
      • Time - Every 0.35 seconds of game time
    • Conditions
    • Actions
      • Set DB_AP[1] = (Position of DB_DU[1])
      • Special Effect - Create a special effect at (DB_AP[1] offset by (0.00, 0.00)) using Objects\Spawnmodels\Undead\ImpaleTargetDust\ImpaleTargetDust.mdl
      • Special Effect - Destroy (Last created special effect)
      • Custom script: call RemoveLocation(udg_DB_AP[1])
After few tests and searching i found special effect is destroyed right after creating works fine.
Should be good like this right?


by the way is it better to post new or just edit my first post when making changes?
 
Level 5
Joined
Jun 13, 2017
Messages
83
I did use it on Point Variable or do you mean i need to put the Special Effect in Variable?
Because the point is destroyed at the end of the trigger.

Edit:

Like this?
  • Rock Special Effect
    • Events
      • Time - Every 0.35 seconds of game time
    • Conditions
    • Actions
      • Set DB_AP[1] = (Position of DB_DU[1])
      • Set DB_Distance[1] = (Distance between DB_AP[1] and DB_TP[1])
      • Special Effect - Create a special effect at (DB_AP[1] offset by (0.00, 0.00)) using Objects\Spawnmodels\Undead\ImpaleTargetDust\ImpaleTargetDust.mdl
      • Set DB_SE[1] = (Last created special effect)
      • Special Effect - Destroy DB_SE[1]
      • Custom script: call RemoveLocation(udg_DB_AP[1])
 
Level 39
Joined
Feb 27, 2007
Messages
4,994
No there are two points as Wrda said in their initial post. "Offset by..." makes a new point object. That's what you have to clean.
  • Set DB_AP[1] = (Position of DB_DU[1])
  • Set DB_AP[2] = (DB_AP[1] offset by 5.00 towards (Facing of WB_Dummy_Units[0]) degrees))
  • -------- --------
  • Custom script: call RemoveLocation(udg_DB_AP[1])
  • Custom script: call RemoveLocation(udg_DB_AP[2])
 
Level 5
Joined
Jun 13, 2017
Messages
83
Hmm i didn't know offset could leak because it is a Real not a Point.
Tried to make it like you said but there is no option for DB_AP[0] to put it in there because it is a point
  • Rock Special Effect
    • Events
      • Time - Every 0.35 seconds of game time
    • Conditions
    • Actions
      • Set DB_AP[1] = (Position of DB_DU[1])
      • Set DB_AP[0] = (DB_AP[1] offset by 5.00 towards (Facing of DB_DU[1]) degrees)
      • Special Effect - Create a special effect at (DB_AP[1] offset by 5.00 towards 0.00 degrees) using Objects\Spawnmodels\Undead\ImpaleTargetDust\ImpaleTargetDust.mdl
      • Set DB_SE[3] = (Last created special effect)
      • Special Effect - Destroy DB_SE[3]
      • Custom script: call RemoveLocation(udg_DB_AP[0])
      • Custom script: call RemoveLocation(udg_DB_AP[1])
Here is what i got so far but have no idea to put a point in the 0.00 degrees.
 
Level 5
Joined
Jun 13, 2017
Messages
83
Fixed it
  • Rock Special Effect
    • Events
      • Time - Every 0.35 seconds of game time
    • Conditions
    • Actions
      • Set DB_AP[1] = (Position of DB_DU[1])
      • Special Effect - Create a special effect at DB_AP[1] using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
      • Set DB_SE[3] = (Last created special effect)
      • Special Effect - Destroy DB_SE[3]
      • Custom script: call RemoveLocation(udg_DB_AP[1])
I have no idea why i skipped the variables and went directly to options, and was wondering why cant i just put a point xD

Sorry everyone, and thanks for the help
of course +rep.
But would like to know few things if possible
1-why do offset leak if it is a real? is it because it is toward a point or something?
2-do i need the variable in Special effect or I can just do special effect without variable and destroy it?
 
Status
Not open for further replies.
Top