HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Strange thing - Takes Damage event

08-19-2006, 05:18 PM#1
Jacek
OK, I've made Any unit takes damage event by adding event for all preplaced units and on "Unit enters the playable map area" event. I made it round the numbers to integer. Here is the damage display part:

Trigger:
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Events
(Damage taken) greater than 0.00
Collapse Then - Actions
Floating text - Create floating text that reads (String((Integer((Damage taken))))) at temp_point with Z offset 0.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
Collapse Else - Actions
Floating text - Create floating text that reads (String((Integer((Damage taken))))) at temp_point with Z offset 0.00, using font size 10.00, color (0.00%, 100.00%, 0.00%), and 0.00% transparency

I did that to test if healing spells are counted as taking negative damage. Apparently, they aren't (I'll trigger the text myself in every healing spell, thats no problem).

problem is :

when I Storm Bolt an enemy unit (I have 10 lvl mountain king I use for testing) it displays 350 (dmg of stormbolt) in RED colour and 0 dmg in GREEN colour. Anyone have idea where is that 0 dmg from? Also it does trigger green 0 when MK does his normal attacks (sometimes it does, sometimes it doesn't).

08-19-2006, 05:24 PM#2
blu_da_noob
Whenever a buff is applied to a unit, it triggers the damage event with a damage of 0.
08-19-2006, 05:25 PM#3
Jacek
hmm I swear I saw this happening during normal (non-bash) attacks

EDIT:

oh yeah
thunder clap doesn't trigger 0s too. how about that wise guy? clap leaves buffs
08-19-2006, 05:27 PM#4
blu_da_noob
Perhaps bash applies some buff which is immediately removed or something? No other reason I could see it happening on a normal attack.

*shrug* Perhaps there are inconsistancies in the system. But buffs do trigger a 0 damage event.
08-19-2006, 05:28 PM#5
Thunder_Eye
I think he means it displays 0 on normal attacks too, or something..
08-19-2006, 05:35 PM#6
Jacek
check the edit
08-19-2006, 07:14 PM#7
Vexorian
well just check if absolute value of damage taken is greater than or equal to 1 before showing floating text.

there are many ways to trigger a 0 damage. For example you can modiffy a spell to only give buff and deal 0 damage, it would trigger the damage event anyways
08-19-2006, 08:16 PM#8
Jacek
ya it isn't a problem but I found it quite interesting two damages in one... oh and is there some way to detect healing (I guess only by catching heal spells)
08-20-2006, 07:03 AM#9
DioD
Heal use SetUnitState function and can be monitor by unit event state change
08-20-2006, 08:20 AM#10
Blade.dk
Heal can also use the damage natives with a negative value, I think that would be detected in this way.
08-20-2006, 08:29 AM#11
DioD
Negative damage cause crush
08-20-2006, 09:19 AM#12
blu_da_noob
No it doesn't.