Help on animate_unit tag

The place to post your WML questions and answers.

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.
User avatar
pyrophorus
Posts: 533
Joined: December 1st, 2010, 12:54 pm

Help on animate_unit tag

Post by pyrophorus »

Hi everybody !

Here is the code which bothers me:

Code: Select all

	[event]
		name=side turn
		first_time_only=no
		[filter_condition]
			[not]
				[have_unit]
					id=Lestiviel
				[/have_unit]
			[/not]
		[/filter_condition]
		[unstore_unit]
			variable=Lestiviel_back
			find_vacant=yes
		[/unstore_unit]
		[animate_unit]
			flag=healing
			hit=yes
			text="Reappearing !"
			[filter]
				id=Lestiviel
			[/filter]
			with_bars=yes
		[/animate_unit]		
	[/event]
First part works correctly (i.e. the unit whose id is Lestiviel come back in the game), but the anim fires not. No anim, no text, nothing...

Actually, I would like to start a custom anim in this event, but I don't know exactly how to declare such an animation. Using a [extra_anim] tag seems to get the anim played forever. Can I use any tag to define an animation (like [my_defend]) ?
(IMHO, the wiki lacks some non-trivial examples here).

Thanks in advance !

LS
User avatar
Astoria
Inactive Developer
Posts: 1007
Joined: March 20th, 2008, 5:54 pm
Location: Netherlands

Re: Help on animate_unit tag

Post by Astoria »

pyrophorus wrote:Hi everybody !

Here is the code which bothers me:

Code: Select all

	[event]
		name=side turn
		first_time_only=no
		[filter_condition]
			[not]
				[have_unit]
					id=Lestiviel
				[/have_unit]
			[/not]
		[/filter_condition]
		[unstore_unit]
			variable=Lestiviel_back
			find_vacant=yes
		[/unstore_unit]
		[animate_unit]
			flag=healing
			hit=yes
			text="Reappearing !"
			[filter]
				id=Lestiviel
			[/filter]
			with_bars=yes
		[/animate_unit]		
	[/event]
First part works correctly (i.e. the unit whose id is Lestiviel come back in the game), but the anim fires not. No anim, no text, nothing...

Actually, I would like to start a custom anim in this event, but I don't know exactly how to declare such an animation. Using a [extra_anim] tag seems to get the anim played forever. Can I use any tag to define an animation (like [my_defend]) ?
(IMHO, the wiki lacks some non-trivial examples here).

Thanks in advance !

LS
Use a foo_anim tag in your unit .cfg.
Formerly known as the creator of Era of Chaos and maintainer of The Aragwaithi and the Era of Myths.
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Re: Help on animate_unit tag

Post by zookeeper »

And once again you should actually ignore the above. Giving people broken WML advice really seems to be in vogue these days...
Anonymissimus
Inactive Developer
Posts: 2461
Joined: August 15th, 2008, 8:46 pm
Location: Germany

Re: Help on animate_unit tag

Post by Anonymissimus »

hit should be hits (but the key doesn't make sense for a healing animation) and text= should be translatable but both probably don't break the thing.

I'd try triggering [foo_anim] with flag=foo then.
projects (BfW 1.12):
A Simple Campaign: campaign draft for wml startersPlan Your Advancements: mp mod
The Earth's Gut: sp campaignSettlers of Wesnoth: mp scenarioWesnoth Lua Pack: lua tags and utils
updated to 1.8 and handed over: A Gryphon's Tale: sp campaign
User avatar
SkyOne
Posts: 1310
Joined: January 3rd, 2009, 7:23 pm

Re: Help on animate_unit tag

Post by SkyOne »

That is possible to happen. The game does not recognize the unit id to animate the unit as well right after unstoring it.
If I were you, the first thing I would try was to spread the event, like unstore unit in a new turn [event], then animate the unit in a side turn [event].
Not so sure though.
Fate of a Princess/feedback thread: "What is in own heart that is the most important, not who you are."
Drake Campaign: Brave Wings/feedback thread, Naga Campaign: Return of the Monster, Saurian Campaign: Across the Ocean
Northern Forces - now on 1.12 server
User avatar
pyrophorus
Posts: 533
Joined: December 1st, 2010, 12:54 pm

Re: Help on animate_unit tag

Post by pyrophorus »

Thanks for your replies,

Sorry, I made the modifications you suggested, but it doesn't work...

I'm sure the [animate_unit] don't work and I can't see why. The unit exists, as you can see, and the healing anim too (Elvish Shaman).

LS
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Re: Help on animate_unit tag

Post by zookeeper »

Well, test whether the fact that you're triggering it in a side turn event and right after unstoring the unit has anything to do with it. Does it work in a simple moveto event, for example?
User avatar
SkyOne
Posts: 1310
Joined: January 3rd, 2009, 7:23 pm

Re: Help on animate_unit tag

Post by SkyOne »

If nothing works, you can install another same unit (Elvish Shaman?) before unstoring Lestiviel with the same name (but different id, like "Lestiviel 2"), then animate it. After the healing animation, just [kill] her, then unstore real Lestiviel right after it on the same hex. This must work (although this is the final attempt).

In this case, you probably have to set variable the unit by depending on her level in post advance [event](s) previously.
The HP and EP does not show (I think) during the animation, so it won't be a problem.
Fate of a Princess/feedback thread: "What is in own heart that is the most important, not who you are."
Drake Campaign: Brave Wings/feedback thread, Naga Campaign: Return of the Monster, Saurian Campaign: Across the Ocean
Northern Forces - now on 1.12 server
User avatar
Kapoue_II
Posts: 203
Joined: October 11th, 2010, 9:41 am

Re: Help on animate_unit tag

Post by Kapoue_II »

Can you check your .sterr (or run wesnoth via terminal if you use mac/linux) to give us the exact error message?
User avatar
pyrophorus
Posts: 533
Joined: December 1st, 2010, 12:54 pm

Re: Help on animate_unit tag

Post by pyrophorus »

Hi everybody !

Thanks for the great support (if professional software were supported like that, it would be fantastic !).

I tried everything and here are the conclusions:
- Skyone's solution is the only one which works with a regular animation (defend or healing).
- customs anims defined with [foo_anim], and flag=foo or flag=foo_anim don't work in any case.
- The situation is exactly the same in a moveto event (triggered by another unit of course).

I don't know if this is important but all events are embedded in a unit type declaration not directly in the scenario.

Sorry, I didn't try to run Wesnoth in terminal.

Cheers,

LS
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Re: Help on animate_unit tag

Post by zookeeper »

For what it's worth, this works just fine for me:

Code: Select all

    [event]
        name=moveto
        first_time_only=no

        [filter]
            side=1
        [/filter]

      [animate_unit]
         flag=healing
         hits=yes
         text="Reappearing !"
         [filter]
            x,y=$x1,$y1
         [/filter]
         with_bars=yes
      [/animate_unit]
   [/event]
And just to make sure: using arbitrary animation tag names like [foo_anim] has never been supported.
User avatar
Reepurr
Posts: 1088
Joined: August 29th, 2010, 5:38 pm

Re: Help on animate_unit tag

Post by Reepurr »

zookeeper wrote:using arbitrary animation tag names like [foo_anim] has never been supported.
What about [extra_anim]?
"What do you mean, "a dwarvish dragonguard with marksman is overpowered"?"

Story of a Drake Outcast | The Nonsense Era
Played HttT-Underground Channels? Thought it was rubbish? Help us develop it here!
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Re: Help on animate_unit tag

Post by zookeeper »

Reepurr wrote:
zookeeper wrote:using arbitrary animation tag names like [foo_anim] has never been supported.
What about [extra_anim]?
It works because it's not an arbitrary name.
User avatar
pyrophorus
Posts: 533
Joined: December 1st, 2010, 12:54 pm

Re: Help on animate_unit tag

Post by pyrophorus »

@zookeeper
... using a location filter instead of unit filter ? I probably try this to investigate.
Here, it's not easy to use because the unit disappears when attacked and shows again later, so other units can go on its original hex meanwhile. Using find_vacant=yes allow to find a free hex, but unit's coordinates are uncertain. I would have to store the unit again to get the final coordinates. Not very smart...

BTW, can you tell us more about [extra_anim] tag ? The wiki is rather silent about it.
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Re: Help on animate_unit tag

Post by zookeeper »

pyrophorus wrote:@zookeeper
... using a location filter instead of unit filter ? I probably try this to investigate.
Huh? x,y=$x1,$y1 is as much of a unit filter as id=Lestiviel is.
pyrophorus wrote:BTW, can you tell us more about [extra_anim] tag ? The wiki is rather silent about it.
Not much to tell, and it should be easy enough to find out by trying.

If your unit has an animation like this:

Code: Select all

[extra_anim]
    flag=myanim
    ...
Then presumably you trigger it like this:

Code: Select all

[animate_unit]
    flag=myanim
    ....
Post Reply