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

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