HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Floating Damage / Exp System - Help

06-19-2006, 04:09 AM#1
Xandramas
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..

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

Part 2..

Trigger:
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
06-19-2006, 04:19 AM#2
darkwulfv
If I'm not mistaken floating text has to be nulled either w/ custom text or by making the whole spell Jass and setting the text to variables and nullin them. That would probably solve your leakage issue. What is the problem you are having with the floating text?
06-19-2006, 04:39 AM#3
harshateja
Course, this is gonna leak MAJORLY in a long game because you are constnatly adding events. Unfortunetly, there is no way to remove events without destroying the trigger. So pretty much, you will have to create a local trigger for each unit that is attacked.
06-19-2006, 04:47 AM#4
Xandramas
How would I do that if i have spawning units?
Or do u have any idea on how to make a non leaking one
or a location I can go to get one?

How would I modify
Trigger:
Collapse Events
Unit - enter playable map area.
Conditions - None.
Actions - Add event to trigger "(Entering Unit) takes damage"

To work with this and make it a spawn unit trigger

Trigger:
Collapse Events
Unit - A unit Is attacked
Collapse Actions
Trigger - Add to text check <gen> the event (Unit - (Attacked unit) Takes damage)

Trigger:
text check
Events
Conditions
Collapse 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 (90.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.01 seconds


The problem I am having with the floating text is that when i have say 5 enemies that attack very fast it gets REALLY laggy. its an obvious memory leak then it disappears after the life timers deplete.

Btw - I would be completly fine with implimenting a jass floating text system too.. someone would have to make it tho I dont know jass well enough to make my own.
06-19-2006, 08:27 AM#5
Captain Griffen
It's not a memory leak as such. You're just creating lots, and lots of events. Meaning if a unit gets attacked 100 times, each time it gets damaged, it runs the trigger 100 times.

Change to these:

Trigger:
Collapse Events:
Map initialisation
Conditions:
Collapse Actions:
Set TempGroup = Units within (Playable map area)
Unit Group - Pick every unit in TempGroup and do action Trigger - Add event (Picked Unit) takes damage to Damage Display.
Custom script: call DestroyGroup(udg_TempGroup)

And:

Trigger:
Collapse Events:
Unit - Enters playable map area.
Conditions:
Collapse Actions:
Trigger - Add event (Triggering unit) takes damage to Damage Display.

And:

Trigger:
Damage Display
Events:
Conditions:
Collapse Actions:
Floating Text - Create floating text that reads (String((Integer((Damage taken))))) above (Triggering unit) with Z offset 0.00, using font size 12.00, color (90.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.01 seconds
06-19-2006, 08:59 AM#6
Xandramas
If this works griffen I am going to love you for life.
06-19-2006, 09:32 AM#7
Xandramas
i cant find

Trigger:
Unit Group - Pick every unit in TempGroup and do action Trigger - Add event (Picked Unit) takes damage to Damage Display.

anywhere... This is what I found...

Trigger:
Part 1
Collapse Events
Map initialization
Conditions
Collapse Actions
Set DisplayText = (Units in (Playable map area))
Unit Group - Pick every unit in DisplayText and do (Trigger - Add to (This trigger) the event (Unit - (Picked unit) Takes damage))
Custom script: call DestroyGroup(udg_DisplayText)

I dont see to damage display.. ?? where do i find that
06-19-2006, 09:34 AM#8
Blade.dk
Damage Display is another trigger, you should be able to find it in the list in the menu where (This trigger) is selected.
06-19-2006, 09:40 AM#9
Xandramas
My coices are
This trigger
Trigger - Create Trigger
Advanced - JASS Code

I am using WEU .. . Will that make a difference?
06-19-2006, 09:53 AM#10
blu_da_noob
There should be a box above that with a drop down list of all the triggers in your map.
06-19-2006, 10:10 AM#11
Xandramas
Okay thank you all of u. Going to test it out.
06-19-2006, 11:33 AM#12
Xandramas
It works, Flawlessly. I love you guys. Thank u