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

Does this Floating Text trigger leak?

Status
Not open for further replies.
Level 4
Joined
Apr 16, 2008
Messages
80
I originally thought these triggers for floating text leak and that the only way to have leak-free floating text is to do it in JASS. But then someone told me that since they are on a timed life, it's fine. Can anyone confirm this please?

  • FloatText Creation
    • Events
    • Conditions
    • Actions
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Triggering unit) Equal to (==) BuilderChosen[(Player number of (Owner of (Triggering unit)))]
        • Then - Actions
          • Floating Text - Create floating text that reads (String((Integer((Damage taken))))) above (Triggering unit) with Z offset 5.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
          • Floating Text - Set the velocity of (Last created floating text) to 100.00 towards 85.00 degrees
          • Floating Text - Change (Last created floating text): Disable permanence
          • Floating Text - Change the lifespan of (Last created floating text) to 1.40 seconds
          • Floating Text - Change the fading age of (Last created floating text) to 0.65 seconds
        • Else - Actions
          • Floating Text - Create floating text that reads (String((Integer((Damage taken))))) above (Triggering unit) with Z offset 5.00, using font size 10.00, color (100.00%, 100.00%, 0.00%), and 0.00% transparency
          • Floating Text - Set the velocity of (Last created floating text) to 100.00 towards 85.00 degrees
          • Floating Text - Change (Last created floating text): Disable permanence
          • Floating Text - Change the lifespan of (Last created floating text) to 1.40 seconds
          • Floating Text - Change the fading age of (Last created floating text) to 0.65 seconds
  • Unit Gets Damaged
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
    • Actions
      • Trigger - Add to FloatText Creation <gen> the event (Unit - (Triggering unit) Takes damage)
  • Check the Units
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set TextDamage = (Units in (Playable map area))
      • Unit Group - Pick every unit in TextDamage and do (Trigger - Add to FloatText Creation <gen> the event (Unit - (Picked unit) Takes damage))
      • Custom script: call DestroyGroup(udg_TextDamage)

Thanks for any help! :)
 
Level 12
Joined
Mar 16, 2006
Messages
992
I don't see you assigning any points to a variable and then destroying it, so there are leaks.

I'm not certain if floating text leaks, but I usually assign them variables and destroy them as well.
 
Level 17
Joined
Apr 13, 2008
Messages
1,608
The way he takes care of the floating text leaks (yeah, they do leak) is correct. I still can't see any points in the triggers, but I'm in a hurry, so I won't bother now.
I don't recommend assigning floating texts to variables, it's too much work. Just add an expiration timer to them.
 
Level 4
Joined
Apr 16, 2008
Messages
80
And the point leak? He needs to store the point in a variable, use the variable and them destroy it.

Sorry, but what is this point leak you are talking about? I don't know of any point that I'm using in the triggers. Could you please point out the exact location? Thanks! :)
 
Level 12
Joined
Mar 23, 2008
Messages
942
Wrong:
Floating Text - Create floating text that reads (String((Integer((Damage taken))))) above (Triggering unit) with Z offset 5.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency

Correct:
Set temppoint = (Triggering unit)
Floating Text - Create floating text that reads (String((Integer((Damage taken))))) above (temppoint) with Z offset 5.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
Custom script: call RemoveLocation(udg_temppoint)
 
Status
Not open for further replies.
Top