wml for damage/heal floating text

Brainstorm ideas of possible additions to the game. Read this before posting!

Moderator: Forum Moderators

Forum rules
Before posting a new idea, you must read the following:
Post Reply
User avatar
Sapient
Inactive Developer
Posts: 4453
Joined: November 26th, 2005, 7:41 am
Contact:

wml for damage/heal floating text

Post by Sapient »

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."
User avatar
Noyga
Inactive Developer
Posts: 1790
Joined: September 26th, 2005, 5:56 pm
Location: France

Post by Noyga »

Perhaps adding an option to [print] to center the text over an unit ?
User avatar
Sapient
Inactive Developer
Posts: 4453
Joined: November 26th, 2005, 7:41 am
Contact:

Post by Sapient »

Noyga wrote:Perhaps adding an option to [print] to center the text over an unit ?
print is similar, but not quite the same. print doesn't float upwards, and it doesn't check the UI preferences.

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."
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Post by zookeeper »

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.
User avatar
Sapient
Inactive Developer
Posts: 4453
Joined: November 26th, 2005, 7:41 am
Contact:

Post by Sapient »

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.
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.
http://www.wesnoth.org/wiki/User:Sapient... "Looks like your skills saved us again. Uh, well at least, they saved Soarin's apple pie."
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Post by zookeeper »

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.
You're right; for example customized healing would need the feature to be usable in other events too.

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.
rusty
Inactive Developer
Posts: 21
Joined: January 7th, 2006, 12:26 am

Prefer an explicit option to unstore_init

Post by rusty »

zookeeper wrote:
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.
You're right; for example customized healing would need the feature to be usable in other events too.

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.
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).

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.
Post Reply