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

Can someone tell me if this trigger leaks?

Status
Not open for further replies.
Level 8
Joined
Jul 17, 2004
Messages
283
Here's my trigger. It's for a respawn system. I need to know if it leaks. If so, where? And how do I fix it?

  • Map ini
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Respawn_Fade[1] = 100.00
      • Set Respawn_Unit[1] = Fallen 0040 <gen>
      • Set Temp_Point[1] = (Position of Fallen 0040 <gen>)
  • Respawn1
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Triggering unit) Equal to Respawn_Unit[1]
    • Actions
      • Wait 15.00 seconds
      • Unit - Remove Respawn_Unit[1] from the game
      • Unit - Create 1 Fallen for Player 1 (Red) at Temp_Point[1] facing 23.07 degrees
      • Set Respawn_Unit[1] = (Last created unit)
      • Animation - Change Respawn_Unit[1]'s vertex coloring to (100.00%, 100.00%, 100.00%) with 100.00% transparency
      • Trigger - Turn on Respawn1 Fade <gen>
  • Respawn1 Fade
    • Events
      • Time - Every 0.04 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Respawn_Fade[1] Equal to 0.00
        • Then - Actions
          • Trigger - Turn off (This trigger)
          • Set Respawn_Fade[1] = 100.00
        • Else - Actions
          • Set Respawn_Fade[1] = (Respawn_Fade[1] - 2.00)
          • Animation - Change Respawn_Unit[1]'s vertex coloring to (100.00%, 100.00%, 100.00%) with Respawn_Fade[1]% transparency
 
Level 29
Joined
Oct 24, 2012
Messages
6,543
For the respawn fade trigger u should not use reals they are very inaccurate so 30.0-1.0-1.0 and so on might not hit 0.00 because of the I accuracy. This is a problem because u use the condition to check if it is equal to 0.00 . U can change this to less than or equal to it will solve the glitch of it never stopping. Whenever u can use greater than or equal to or use less than or equal to. And never use equal to with reals. If u want this to be accurate switch it over to integers. It will leak if u change the location variable in another trigger without removing it first.
 
Level 20
Joined
Apr 14, 2012
Messages
2,901
Correct. Also u should remove and null it b4 u change it to a new location.

So let's say I'm making a spell that would send units back and forth the same two locations stored in the same array variable. Are you saying that I no longer need to remove or null the array variable if I don't change the location of the point?

But I would still need to remove the leak after that certain spell has finished casting right?
 
Status
Not open for further replies.
Top