Two questions regarding animate_unit
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.
Two questions regarding animate_unit
1. How to display the animation used when the unit is recruiting other units as a leader? Liches have such animations, yet https://wiki.wesnoth.org/InterfaceActio ... te_unit.5D doesn’t list an appropriate value of flag for such an animation. I tried flag=recruiting, but this won’t work
2. Is there any way to avoid the camera being automatically centered on the animated unit?
2. Is there any way to avoid the camera being automatically centered on the animated unit?
Re: Two questions regarding animate_unit
In answer to your first question, this is the code the ancient lich uses, (in general the best way, rather than using the wiki, is to go into the base games install directory and find an example of the code being used in the mainline game):
As for that second question i unfortunately do not know
Code: Select all
[recruiting_anim]
[filter_second]
race=undead
[/filter_second]
start_time=-300
[frame]
image="units/undead-necromancers/ancient-lich-magic-[1,2].png:75"
[/frame]
[frame]
image="units/undead-necromancers/ancient-lich-magic-3.png"
halo=halo/undead/black-magic-[1~5].png:[75*4,50]
[/frame]
sound_start_time=-75
[sound_frame]
sound=magic-dark-big.ogg
[/sound_frame]
[frame]
image="units/undead-necromancers/ancient-lich-magic-[2,1].png:50"
[/frame]
[frame]
image="units/undead-necromancers/ancient-lich.png:1"
[/frame]
[/recruiting_anim]
Creator of: The Reign of The Lords Era,The Gnats Franken Dungeon.
Re: Two questions regarding animate_unit
I tried the same thing a little while ago, and couldn't figure it out. For liches, their ranged attack animation isn't too different, so maybe you could use it instead?Marcgal wrote:1. How to display the animation used when the unit is recruiting other units as a leader? Liches have such animations, yet https://wiki.wesnoth.org/InterfaceActio ... te_unit.5D doesn’t list an appropriate value of flag for such an animation. I tried flag=recruiting, but this won’t work
Also... does [recall] animate the leader? I don't think so, but maybe. If so, maybe you can use it to work around the problem?
EDIT: Or, if you're really desperate, you could use [modify_unit] with an [object] to make a new animation that looks the same as the recruiting one, but which you can use in [animate_unit].
I assume you want the camera to stay wherever it happened to be before the animation? I don't know any way, but if there was a specific different unit you wanted the camera to center on, here's an untested idea that might work. Since [animate_unit] allows you to use [animate] to do multiple units at once, I assume the camera stays focused on the unit animated by [animate_unit] (the outermost tag). So you could "animate" the unit that the camera should focus on with a standing animation or something that won't actually do anything, and use an [animate] tag to make the animation that you originally wanted.Marcgal wrote:2. Is there any way to avoid the camera being automatically centered on the animated unit?
As you can see, I don't really know the answers, I'm just brainstorming some hacky work-arounds, like I always do when I get stuck.
The last few months have been nothing but one big, painful reminder that TIMTLTW.
Creator of Armory Mod, The Rising Underworld, and Voyage of a Drake: an RPG
Creator of Armory Mod, The Rising Underworld, and Voyage of a Drake: an RPG