wml for damage/heal floating text
Moderator: Forum Moderators
Forum rules
Before posting a new idea, you must read the following:
Before posting a new idea, you must read the following:
wml for damage/heal floating text
I think it would be nice if WML supported displaying floating HP damage/heal numbers depending on the preference being enabled. This would make some custom WML abilities seem more realistic, such as a draining aura for a dark paladin, the bloodlust ability, or just any effect that harms or heals.
http://www.wesnoth.org/wiki/User:Sapient... "Looks like your skills saved us again. Uh, well at least, they saved Soarin's apple pie."
print is similar, but not quite the same. print doesn't float upwards, and it doesn't check the UI preferences.Noyga wrote:Perhaps adding an option to [print] to center the text over an unit ?
It would be best to have an action tag with a unit filter, optional sound, and damage, then let the game check preferences and use the correct color.
http://www.wesnoth.org/wiki/User:Sapient... "Looks like your skills saved us again. Uh, well at least, they saved Soarin's apple pie."
This is something that would basically only need to be supported in attacker_hits and defender_hits events. Although a general way of printing a line floating upwards out from a unit at any time might not be any more difficult to do. But anyway, it would be very nice to have for all sorts of custom abilities.
Actually, I particularly want to use it in side turn events. The C++ code shouldn't be terribly difficult since it would be copying code that already exists.zookeeper wrote:This is something that would basically only need to be supported in attacker_hits and defender_hits events. Although a general way of printing a line floating upwards out from a unit at any time might not be any more difficult to do. But anyway, it would be very nice to have for all sorts of custom abilities.
http://www.wesnoth.org/wiki/User:Sapient... "Looks like your skills saved us again. Uh, well at least, they saved Soarin's apple pie."
You're right; for example customized healing would need the feature to be usable in other events too.Sapient wrote:Actually, I particularly want to use it in side turn events. The C++ code shouldn't be terribly difficult since it would be copying code that already exists.
I'd suggest giving [print] a new optional key, floating=yes, which would make the text specified to be floated above the unit (specified by a [filter]) just like damage and healing are. If the key was used, duration in the same tag would become meaningless, but size and red, green, blue could probably still apply (size wouldn't be necessary however, assuming that all the floating stuff is the same size currently). Of course the whole thing could be done by creating a new tag, such as [print_float], but I suppose it doesn't make much difference.
Prefer an explicit option to unstore_init
Since the idea is to enable the same animations as healing/damaging, and the only way I know that WML can do this is [unstore_unit], I'd recommend a "show_hp_change=yes" optional key to unstore_unit, which does the healing/damaging animation (whatever that may be: it's currently a slow HP change plus floating text, unless turbo on).zookeeper wrote:You're right; for example customized healing would need the feature to be usable in other events too.Sapient wrote:Actually, I particularly want to use it in side turn events. The C++ code shouldn't be terribly difficult since it would be copying code that already exists.
I'd suggest giving [print] a new optional key, floating=yes, which would make the text specified to be floated above the unit (specified by a [filter]) just like damage and healing are. If the key was used, duration in the same tag would become meaningless, but size and red, green, blue could probably still apply (size wouldn't be necessary however, assuming that all the floating stuff is the same size currently). Of course the whole thing could be done by creating a new tag, such as [print_float], but I suppose it doesn't make much difference.
Now, if we really just want floating text, that's something else. But if we want to make it exactly like healing or damaging, we'd best have WML say that.
My 2c,
Rusty.