• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Is there a leak here & how do I fix it?

Status
Not open for further replies.
Level 2
Joined
Sep 21, 2018
Messages
12
howToLeak.PNG

Please provide with a step-by-step guide.
 
In Actions:

  • Floating Text - Create floating text that reads (String((Integer((Mana of (Triggering unit))))) at (Position of (Triggering unit)) with Z offset 0.00, using font size 10.00, color (100%, 100%, 100%) and 0.00% transparency
(Position of (Triggering unit)) leaks. Try setting it to a point variable and destroy it when it is no longer needed via Custom Script.

JASS:
    call RemoveLocation(yourVar)

yourVar represents the variable you are using which is pointing to that point object.

If created in GUI, add a "udg_" prefix, without quotes.
 
Level 2
Joined
Sep 21, 2018
Messages
12
In Actions:

  • Floating Text - Create floating text that reads (String((Integer((Mana of (Triggering unit))))) at (Position of (Triggering unit)) with Z offset 0.00, using font size 10.00, color (100%, 100%, 100%) and 0.00% transparency
(Position of (Triggering unit)) leaks. Try setting it to a point variable and destroy it when it is no longer needed via Custom Script.

JASS:
    call RemoveLocation(yourVar)

yourVar represents the variable you are using which is pointing to that point object.

If created in GUI, add a "udg_" prefix, without quotes.

Thanks, I guess it'll have to leak since I do not think I can work around it. Since I want the player to see the message.
I cannot foresee where the player is going to be, so if I set the location to be X, the player might be at Y.
Correct me if I'm wrong but I cannot see a way to make it work, leak-free.
 
Level 6
Joined
Jan 8, 2010
Messages
155
Thanks, I guess it'll have to leak since I do not think I can work around it. Since I want the player to see the message.
I cannot foresee where the player is going to be, so if I set the location to be X, the player might be at Y.
Correct me if I'm wrong but I cannot see a way to make it work, leak-free.


Create a variable, set the value of the Point variable to the position of the triggering unit, then replace that clause in your Floating Text - Create action with the variable. After you create it, call the RemoveLocation function as MyPad stated.
 
Level 9
Joined
Jul 30, 2018
Messages
445
If you didn't get it from above explanation, here's a visual one:

  • Events
    • Unit - A unit Dies
  • Conditions
    • Or - Any (Conditions) are true
      • Conditions
        • (Unit-type of (Triggering unit)) Equal to Pig
        • (Unit-type of (Triggering unit)) Equal to Sheep
  • Actions
    • Set TempPoint = (Position of (Triggering unit))
    • Floating Text - Create floating text that reads (String((Mana of (Triggering unit)))) at TempPoint with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
    • Floating Text - Change (Last created floating text): Disable permanence
    • Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
    • Custom script: call RemoveLocation(udg_TempPoint)
    • Player - Add (Integer((Mana of (Triggering unit)))) to (Owner of (Triggering unit)) Current gold
 
Level 2
Joined
Sep 21, 2018
Messages
12
If you didn't get it from above explanation, here's a visual one:

  • Events
    • Unit - A unit Dies
  • Conditions
    • Or - Any (Conditions) are true
      • Conditions
        • (Unit-type of (Triggering unit)) Equal to Pig
        • (Unit-type of (Triggering unit)) Equal to Sheep
  • Actions
    • Set TempPoint = (Position of (Triggering unit))
    • Floating Text - Create floating text that reads (String((Mana of (Triggering unit)))) at TempPoint with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
    • Floating Text - Change (Last created floating text): Disable permanence
    • Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
    • Custom script: call RemoveLocation(udg_TempPoint)
    • Player - Add (Integer((Mana of (Triggering unit)))) to (Owner of (Triggering unit)) Current gold

Thanks for all the help! And thanks Sabe for the visual one. Appreciate it! :)
 
Status
Not open for further replies.
Top