HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Showing Damage? mine appears as zero's why is this?

09-27-2006, 02:04 AM#1
Fr0zenLord
Well I know how to make it show the damage, but the damage isnt being calculated properly or something...

Everytime I attack, "0" appears, instead of the damage I deal, which is 4...

If I use String to real it shows it as 0.000

if I use String To Integer, Then Integer to Real, it displays 0, So, anyone know where my problem is >>
Trigger:
Damage Delt
Collapse Events
Advanced - Any unit takes damage
Conditions
Collapse Actions
Floating Text - Create floating text that reads (String((Integer((Damage taken))))) at (Position of (Triggering unit)) with Z offset 0.00, using font size 10.00, color (100.00%, 0.00%, 15.00%), and 0.00% transparency
Set FloatingText[0] = (Last created floating text)
Floating Text - Change FloatingText[0]: Disable permanence
Floating Text - Change the lifespan of FloatingText[0] to 3.00 seconds
Floating Text - Change the fading age of FloatingText[0] to 1.00 seconds

??
09-27-2006, 03:06 AM#2
Vexorian
seems like an issue with WEU's any unit takes damage event
09-27-2006, 03:51 AM#3
corvy
Yes, that must be it. The event must not be setting the damage taken to any value, as any real or integer will just return zero if it is not given a value. Try using the "Unit enters map area; add event for trigger" method; it's tried and true, and I've heard bad things about WEU specific functions anyways.
09-27-2006, 03:53 AM#4
Nubcookie
I didn't write this, I just had this map saved away and I found it. The author didn't put his name on it and the map is called 'Dection System'
Trigger:
Unit Check
Collapse Events
Map initialization
Conditions
Collapse Actions
Set TextDamage = (Units in (Playable map area))
-------- - --------
Unit Group - Pick every unit in TextDamage and do (Trigger - Add to FloatText Creation <gen> the event (Unit - (Picked unit) Takes damage))
-------- - --------
Custom script: call DestroyGroup(udg_TextDamage)

Trigger:
Unit Detection
Collapse Events
Unit - A unit enters (Playable map area)
Conditions
Collapse Actions
Trigger - Add to FloatText Creation <gen> the event (Unit - (Triggering unit) Takes damage)

Trigger:
FloatText Creation
Events
Conditions
Collapse Actions
Floating Text - Create floating text that reads (String((Integer((Damage taken))))) above (Triggering unit) with Z offset 5.00, using font size 10.00, color (100.00%, 100.00%, 0.00%), and 0.00% transparency
Floating Text - Set the velocity of (Last created floating text) to 100.00 towards 85.00 degrees
-------- - --------
Floating Text - Change (Last created floating text): Disable permanence
Floating Text - Change the lifespan of (Last created floating text) to 1.40 seconds
Floating Text - Change the fading age of (Last created floating text) to 0.65 seconds
09-27-2006, 04:24 AM#5
Fr0zenLord
Thanks guys,

XD :)
09-27-2006, 11:56 AM#6
shadow1500
That method leaks. If you have a lot of unit recycling it might be a good idea to implement a leakless version: http://www.wc3jass.com/viewtopic.php?t=2608.