• 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.
  • Create a faction for Warcraft 3 and enter Hive's 19th Techtree Contest: Co-Op Commanders! Click here to enter!
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 21st Texturing Contest: Upgrade is now concluded, time to vote for your favourite set of icons! Click here to vote!

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