HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Showing damage with floating text

12-21-2005, 09:14 PM#1
Ignitedstar
There seem to have been no question in the other thread that Homer made, even though what he wanted to know was I wanted to know. And, it didn't seem to get answered either. No, I'm not using WEU.

First Question: I figured out how to show damage done with only triggered spells, but how exactly can you do that with regular attacks?

Second Question: Can anyone tell me how do you make a floating text float? Float as in, starting in one point then going up? That's been bothering me.

Third Question: I haven't really played around with floating text a lot, so I wondered why, when I interrupt a spell by moving, when it shows the text, it won't dissapear?
12-21-2005, 09:18 PM#2
iNfraNe
First and third: show trigger
second: Set the velocity of the floating text (velocity==speed)
12-21-2005, 09:27 PM#3
Ignitedstar
Oops, got so wrapped up in the questions that I forgot to list the trigger.

Trigger:
Spell Ability
Collapse Events
Unit - A unit Starts the effect of an ability
Collapse Conditions
(Ability being cast) Equal to Spell
Collapse Actions
Set TargetUnit = (Target unit of ability being cast)
Set Caster = (Triggering unit)
Set UnitDamage = (# + (# x (Real((Intelligence of Caster (Include bonuses))))))
Unit - Cause Caster to damage TargetUnit, dealing UnitDamage damage of attack type Normal and damage type Universal
Collapse Floating Text - Create floating text that reads (String(UnitDamage)) at (Target point of ability being cast) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
Wait 1.00 seconds
Floating Text - Destroy (Last created floating text)

This is what I used to show damage for that particular spell(and others like it). How exactly can I show the same effect, but for regular attacks?
12-21-2005, 10:12 PM#4
Anitarf
If you don't mind the red font colour, you can give the unit a critical strike that has a 100% chance to hit, but multiplies damage by 1, thus keeping it the same.
12-21-2005, 10:20 PM#5
Ignitedstar
Yeah, I realized that before writing the first post, but since the spell damage is displayed in white text, I was thinking people would get confused to where, "I keep getting critical hits?!?! But how come I'm not hitting a lot?"

Also, I find the "!" used in Critical Strike bothersome.

Thanks for considering it, though.
12-21-2005, 10:30 PM#6
iNfraNe
Well, how about the exact same trigger, but with the event "unit gets damaged" and the events that respond to the correct units.
This will work on both spells and attacks, great isnt it. Only one problem: it is a specific event, but this can be fixed by adding all units as event in the trigger.
At map init, pick all units and add an event for them
And each time a unit enters the map add that unit to the events too.

Comments on the trigger: dont use floating text destroy. The way you do it now your floating text might never get destroyed cus the last creating text may be replaced. Use the new functions lifespan, and fade point instead. The floating text will be removed after its lifespan.
12-22-2005, 01:11 AM#7
Ignitedstar
I can't really tell if your talking about one trigger or two triggers. Be a little more descriptive, please. It's hard to understand what your saying.
12-22-2005, 01:14 AM#8
Tim.
A little note: You can make the Critical text white, but I do not think it will work on B.net then.
12-22-2005, 05:51 AM#9
Blade.dk
I think it will.

Just export the file that contains the texttag color values, change the critical strike value, and import the file to your map in the correct path.

Bad thing is that it will take up map space.
12-22-2005, 04:13 PM#10
JeffreyQ
Code:
    Events
        Unit - A unit Begins casting an ability
    Conditions
        (Ability being cast) Equal to A 
    Actions
        Set A_Caster = (Casting unit)
        Set A_Victim = (Target unit of ability being cast)
        Set A_Dmg = (10 x (Strength of A_Caster (Include bonuses)))

Code:
    Events
        Unit - A unit Finishes casting an ability
    Conditions
        (Ability being cast) Equal to A
    Actions
        Unit - Cause A_Caster to damage A_Victim, dealing (Real(A_Dmg)) damage of attack type Hero and damage type Normal
        Floating Text - Create floating text that reads ((String(A_Dmg)) + !) above A_Victim with Z offset 0.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
        Floating Text - Change (Last created floating text): Disable permanence
        Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
        Floating Text - Change the lifespan of (Last created floating text) to 1.50 seconds

I used 2 triggers.
1st, to setup the variables and damage
2nd, is to make sure that if the hero kills a unit instanlly, it will still have a cooldown for that spell. Also the floating text stuff. You will need to disable permanence to enable the lifespan to work.
Hmm, i just read your post again, u meant a unit attacks, it will show the floating text, why not just use 100% critical strike? I cant seem to find the event "Damage Taken" to refer to the conditions and actions. Will look in to it.

Note that the above calculation will not be as accurate if the targeted unit has armor since it will display the damage that is dealt, but not taken.

Hope that helps.
- Jeff