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

[Trigger] Would a Permanent Floating Text Leak?

Status
Not open for further replies.
Level 8
Joined
Jan 16, 2008
Messages
156
I need to use a floating text, and would like to know if my test trigger below leaks, or should I be destroying and creating the floating texts between spell casts and every 0.03 seconds so it follows the hero.

  • Archmage Learns
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to (==) Human Archmage - Blizzard
    • Actions
      • Floating Text - Create floating text that reads <Empty String> above Archmage 0001 <gen> with Z offset 0.00, using font size 10.00, color (60.00%, 80.00%, 100.00%), and 0.00% transparency
      • Set ArchmageFloatingText = (Last created floating text)
      • Floating Text - Change ArchmageFloatingText: Enable permanence
      • Trigger - Turn off (This trigger)
  • Archmage Starts
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to (==) Blizzard
    • Actions
      • Floating Text - Change the position of ArchmageFloatingText to Archmage 0001 <gen> with Z offset 0.00
      • Floating Text - Change text of ArchmageFloatingText to (String((Mana of (Triggering unit)))) using font size 10.00
      • Set Archmage = True
      • Trigger - Turn on Text Move <gen>
      • Countdown Timer - Start ArchmageTimer as a One-shot timer that will expire in 6.00 seconds
  • Archmage Off
    • Events
      • Time - ArchmageTimer expires
    • Conditions
    • Actions
      • Floating Text - Change text of ArchmageFloatingText to <Empty String> using font size 10.00
      • Set Archmage = False
  • Text Move
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Archmage Equal to (==) True
        • Then - Actions
          • Floating Text - Change the position of ArchmageFloatingText to Archmage 0001 <gen> with Z offset 0.00
          • Floating Text - Change text of ArchmageFloatingText to (String((Mana of Archmage 0001 <gen>))) using font size 10.00
        • Else - Actions
          • Game - Display to (All players) the text: Mana Test off!
          • Trigger - Turn off (This trigger)
Also I want to stick a floating text over a part of the map for the duration of the game so people know what it is. I assume that doesn't leak if I leave it there all game?

Thanks for any and all information.
 
Last edited:
I dont see a Leak in your Code, if your Blizzard skill has only 1 LVL .
They way you do this is fine.

Leak does refer to a object to which you have no access anymore and has no practical value to keep.
The classic one is the current Position of a Unit, In General you need it only one time and thats right now.
Thats cause if you call it a new Point-Object is created which has the X/Y value of the current Position.

Objects which are needed the whole game and you have no access onto are fine.
 
Status
Not open for further replies.
Top