How do you create floating text messages?
Moderator: Forum Moderators
Forum rules
- Please use [code] BBCode tags in your posts for embedding WML snippets.
- To keep your code readable so that others can easily help you, make sure to indent it following our conventions.
How do you create floating text messages?
I'd like to create floating messages like the ones telling you when you gain or lose hit points, or get affected by some status modification (like" slowed" or "poisoned").
Unfortunately I have no idea what they are called, so I can't search the WML reference; Could somebody please point me in the right direction?
What I want to do is to create a floating text just like the healing or wounding one, triggered by an event (moveto in this case).
Unfortunately I have no idea what they are called, so I can't search the WML reference; Could somebody please point me in the right direction?
What I want to do is to create a floating text just like the healing or wounding one, triggered by an event (moveto in this case).
- James_The_Invisible
- Posts: 534
- Joined: October 28th, 2012, 1:58 pm
- Location: Somewhere in the Northlands, fighting dark forces
- Contact:
Re: How do you create floating text messages?
It is called floating_text.
Another variation is using [unstore_unit] with attributes text and red, green, blue. The latter can be replaced by some {COLOR_*} macros (COLOR_HEAL, COLOR_HARM, COLOR_WHITE).
Another variation is using [unstore_unit] with attributes text and red, green, blue. The latter can be replaced by some {COLOR_*} macros (COLOR_HEAL, COLOR_HARM, COLOR_WHITE).
My content: For Power series
Ports: Danse Macabre Story of the Wose
Guides: How to translate your UMC
Ports: Danse Macabre Story of the Wose
Guides: How to translate your UMC
Re: How do you create floating text messages?
Perfect, that's what I was looking for! Thank you.James_The_Invisible wrote:It is called floating_text.
Why would I "[unstore_unit]"? I didn't store it...James_The_Invisible wrote:Another variation is using [unstore_unit]
I'm not too clear about what [unstore_unit] does. I thought, as the Wiki says "Creates a unit from a game variable, and activates it on the playing field." I'm not creating units, I'm just modifying an existing unit's health and status...
More precisely, what is wrong with:
Code: Select all
[event] # cursed hex
name=moveto
first_time_only=no
[filter]
x,y=15,3
side=1
[/filter]
[modify_unit]
[filter]
x,y=15,3
[/filter]
hitpoints=$($unit.hitpoints - 5)
status.poisoned=yes
status.slowed=yes
[/modify_unit]
[/event]
Re: How do you create floating text messages?
modify_unit uses storing and unstoring internally. So there is nothing wrong.
It works by storing unit, to that game variable, then changing values of that variable, and then unstoring, to update gamestate.
It works by storing unit, to that game variable, then changing values of that variable, and then unstoring, to update gamestate.
Re: How do you create floating text messages?
This isn't the way.kurt751 wrote: status.poisoned=yes
status.slowed=yes
- ForestDragon
- Posts: 1771
- Joined: March 6th, 2014, 1:32 pm
- Location: Ukraine
Re: How do you create floating text messages?
it'szookeeper wrote:This isn't the way.kurt751 wrote: status.poisoned=yes
status.slowed=yes
Code: Select all
[status]
<insert status name here>=yes
[status]
My active add-ons: The Great Steppe Era,XP Bank,Alliances Mod,Pestilence,GSE+EoMa,Ogre Crusaders,Battle Royale,EoMaifier,Steppeifier,Hardcoreifier
My inactive add-ons (1.12): Tale of Alan, The Golden Age
Co-creator of Era of Magic
My inactive add-ons (1.12): Tale of Alan, The Golden Age
Co-creator of Era of Magic
Re: How do you create floating text messages?
Thank you, I'm relieved!Ravana wrote:modify_unit uses storing and unstoring internally. So there is nothing wrong.
Jeez, I feel like I'm sleepwalking through a minefield...
General suggestion -
It would break with the monosyllabic trend of this site and look less "The Way you see is not the True Way", but I do think the "Building Scenarios" tutorial on the Wiki lacks a little section telling people how to do simple stuff, like (for instance, among others) harm or heal units, teleport, make multiple choice dialogues, and other stuff any scenario creator will most likely want to use sooner or later. With short examples to show what the syntax looks like. There is already some of that there, but the tutorial needs more.
Yes, I've read the opinion according to which making creation as difficult and tedious as possible will limit the amount of bad campaigns, but I don't subscribe to that point of view. It limits the overall amount of campaigns sure enough, but has no impact on quality. It only tests determination, not talent, and one can be determined and clueless at the same time. I'd even say those two fit quite well together.
Just my 2 cents worth.
Re: How do you create floating text messages?
Thank you for being precise...ForestDragon wrote:it'sto be preciseCode: Select all
[status] <insert status name here>=yes [status]
I wonder where I found my "status.something=yes" syntax. I most certainly didn't invent it.
Re: How do you create floating text messages?
(Sorry Ravana, new post because different topic)
Okay, everything works just fine, except that people apparently can't die this way. I had thought the game engine would automatically kill an unit if it drops below 0 hit points, but apparently it has to be done manually.
Is
Okay, everything works just fine, except that people apparently can't die this way. I had thought the game engine would automatically kill an unit if it drops below 0 hit points, but apparently it has to be done manually.
Is
[kill]
the right way to do this? Like [if] (<1hp) [then][kill] (location), animate=yes [/kill][/then][/if]?- James_The_Invisible
- Posts: 534
- Joined: October 28th, 2012, 1:58 pm
- Location: Somewhere in the Northlands, fighting dark forces
- Contact:
Re: How do you create floating text messages?
You mean from poison? Well, its description saysexcept that people apparently can't die this way.
That means that the poisoned unit's hp will not go below 1.This attack poisons living targets. Poisoned units lose 8 HP every turn until they are cured or are reduced to 1 HP. Poison can not, of itself, kill a unit.
(A bit off topic: It is possible ,under some circumstances, to have a unit with 0 or less hp. E. g. if you set it via debug mode, or some event-driven abilities are in place. That unit will die next time it is attacked.)
My content: For Power series
Ports: Danse Macabre Story of the Wose
Guides: How to translate your UMC
Ports: Danse Macabre Story of the Wose
Guides: How to translate your UMC
- ForestDragon
- Posts: 1771
- Joined: March 6th, 2014, 1:32 pm
- Location: Ukraine
Re: How do you create floating text messages?
also, if you want to harm a unit, just use this (the parts with '#' are comments):
Code: Select all
[harm_unit]
[filter]
x,y=$x1,$y1 #
[/filter]
amount=<insert amount>
kill=yes #this is done to make sure that it will kill a unit if he/she has low enough hp
animate=yes #to make sure the defend animation is triggered for the harmed unit
damage_type=<insert damage type>
poisoned=yes
slowed=yes
[/harm_unit]
My active add-ons: The Great Steppe Era,XP Bank,Alliances Mod,Pestilence,GSE+EoMa,Ogre Crusaders,Battle Royale,EoMaifier,Steppeifier,Hardcoreifier
My inactive add-ons (1.12): Tale of Alan, The Golden Age
Co-creator of Era of Magic
My inactive add-ons (1.12): Tale of Alan, The Golden Age
Co-creator of Era of Magic
Re: How do you create floating text messages?
No, from having hit points subtracted by aforementioned "cursed hex" trap. You can subtract as many hit points as you want, units remain alive even with negative hit point values.James_The_Invisible wrote:You mean from poison?
Re: How do you create floating text messages?
Great, that sounds simple and straightforward. Thanks a lot!ForestDragon wrote:also, if you want to harm a unit, just use this (the parts with '#' are comments):