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

- - - - - No Memory Leak Floating dmg and exp system - - - -

Status
Not open for further replies.
Level 5
Joined
Jan 21, 2005
Messages
106
I really need to get a floating damage system and preferably a floating exp system as well.

Here is my trigger.. it leaks but I dont know why.

Part 1..

Event
A unit is attacked
Condition
Action
Trigger - Add to text check <gen> the event (Unit - (Attacked unit) Takes damage)

Part 2..

Event
Condition
Actions
Floating Text - Create floating text that reads (String((Integer((Damage taken))))) above (Attacked unit) with Z offset 0.00, using font size 12.00, color (16.00%, 54.00%, 20.00%), and 0.00% transparency

Floating Text - Set the velocity of (Last created floating text) to 96.00 towards 90.00 degrees

Floating Text - Change (Last created floating text): Disable permanence

Floating Text - Change the lifespan of (Last created floating text) to 0.75 seconds

Floating Text - Change the fading age of (Last created floating text) to 0.75 seconds

It seems to only have a problem when there are fast attacking enemies. Quicker than the lifespan timer of the thing.
Please help
 
Level 1
Joined
Jun 12, 2006
Messages
5
Make the floating text a variable. Then, each time the attack event occurs, be sure to remove the current floating text variable from the screen and THEN substitute it with a new one. It should work properly. Cya!
 
Status
Not open for further replies.
Top