HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Floating Text.

09-29-2003, 12:00 AM#1
Das Jank
I need to make a trigger that when player 1 kills a unit it creats floating text above the dying units head displaying the units Point Value for a few seconds and then disappearing. If at all possible maybe it move up and fade out but that might be to complicated. Could anyone write up a quick trigger that might do this?
09-29-2003, 12:33 AM#2
Ligature
That is... rather a sickening trigger... the moving upwards at least. Pity you can't set the Z velocity of a floating text...

The creating text above a dead unit should be pretty easy...

E - [Generic unit event] A unit dies
C - [player comparison] killing unit equal to Player 1
A - create floating text above dying unit [properties up to you] that reads (string(point value of dying unit)
A - set N = N + 1
A - set FloatingTextArray(N) = Last created floating text
A - wait x seconds
A - destroy FloatingTextArray(1)
A - set N = N - 1
A - for integer A = 1 to N do actions:
A - set FloatingTextArray(integer A) = FloatingTextArray(integer A + 1)

I THINK this should work... anyone see a problem with it?
09-29-2003, 01:06 AM#3
MarSara
That wont scroll the text up, like Critical strike does, and the last element of the array will be duplicated so, after your Left-Shift the array, you need to set Array(N) = 0 and you need N = N - 1 as the last line.
09-29-2003, 01:15 AM#4
Ligature
why bother cleaning up the last member of the array? will it free up memory to set it to zero?
09-29-2003, 01:21 AM#5
MarSara
It is a good programming habit to get into, otherwise the data in that index becomes "undefined" rather than 0.
09-29-2003, 01:26 AM#6
Das Jank
Ligature - Ok thanks for all the help, I got it to scroll up by adding a Velocity to it.

MarSara - I moved the Set N = N - 1 to the last line but where do I need to put the Array(N) = 0??
09-29-2003, 01:29 AM#7
Ligature
Wow... can you set the Z velocity of a floating text? How'd you do it?
09-29-2003, 01:33 AM#8
Das Jank
Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees

that the default of what it does when you add it and its just about right.
09-29-2003, 01:41 AM#9
Ligature
Ah, thanks. Unfortunately the map I'm working on uses weird camera angles so it probably won't work... glad it worked out for you tho!

// Ligature