[closed] Merge unit animaions
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.
- ZombieKnight
- Posts: 283
- Joined: June 27th, 2022, 2:26 pm
- Location: Czech Republic
[closed] Merge unit animaions
Hi,
My code that gives unit "explosion" animation halo:
I'd like to give unit animation "explosion" which should be unit's defend animation + my custom halo
An idea how to do so?
My code that gives unit "explosion" animation halo:
Code: Select all
[effect]
apply_to = new_animation
[animation]
apply_to=explosion
[frame]
halo="projectiles/fireball-impact-[1~16].png:[60*16]"
[/frame]
[/animation]
An idea how to do so?
Last edited by ZombieKnight on April 20th, 2024, 9:58 am, edited 1 time in total.
I had saurian in profile before, but I've merged my discord profile with forum one...
Working on campaign Bandits from Brown Hills
Working on campaign Bandits from Brown Hills
- beetlenaut
- Developer
- Posts: 2832
- Joined: December 8th, 2007, 3:21 am
- Location: Washington State
- Contact:
Re: Merge unit animaions
The [animation] tag doesn't support "apply_to." All tags ONLY support specific keys and subtags. You can specify an "id" though, which can be selected by an event. (If you are new to WML, animations are not the easiest thing to start with.)
Campaigns: Dead Water,
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
- ZombieKnight
- Posts: 283
- Joined: June 27th, 2022, 2:26 pm
- Location: Czech Republic
Re: Merge unit animaions
I won't call myself new... I'd like to merge six dwarven cannon smokes into one, without editing ~16 images.
#explosion animation was solved using lua animations.
Can I merge more halo's? (Maybe like ~SCALE())
#explosion animation was solved using lua animations.
Can I merge more halo's? (Maybe like ~SCALE())
I had saurian in profile before, but I've merged my discord profile with forum one...
Working on campaign Bandits from Brown Hills
Working on campaign Bandits from Brown Hills
- Celtic_Minstrel
- Developer
- Posts: 2290
- Joined: August 3rd, 2012, 11:26 pm
- Location: Canada
- Contact:
Re: Merge unit animaions
…what are you talking about? Yes it does. The
[animation]
tag is rarely actually used for animations though, so you won't see it very often. None of the animation tags that are generally used support apply_to
– only [animation]
specifically. For this specific use-case, [extra_anim]
is usually used, which takes flag
instead of apply_to
for the same meaning.I'm afraid you're going to have to manually duplicate the content of the unit's defend animation. Look up the definition of theZombieKnight wrote: ↑April 16th, 2024, 3:11 pm I'd like to give unit animation "explosion" which should be unit's defend animation + my custom halo
An idea how to do so?
DEFENSE_ANIM
macro, copy-paste it into your explosion animation, and modify it as needed. And if needed, add the extra [frame]
tag described here (maybe rename the tag to [flash_frame]
though).- ZombieKnight
- Posts: 283
- Joined: June 27th, 2022, 2:26 pm
- Location: Czech Republic
Re: Merge unit animaions
Oh, the thing is idk what unit will be animation explosion given in advance(depends on my "best ranged target" finder).
I had saurian in profile before, but I've merged my discord profile with forum one...
Working on campaign Bandits from Brown Hills
Working on campaign Bandits from Brown Hills
- Celtic_Minstrel
- Developer
- Posts: 2290
- Joined: August 3rd, 2012, 11:26 pm
- Location: Canada
- Contact:
Re: Merge unit animaions
Since the default defend animation is pretty formulaic, you might be able to get away with just substituting
Given that your animation is very simple, there might be another alternative, as long as you're not using it on something like a Mage of Light (or if you're okay with an illuminates halo disappearing). You could use the following effect instead of the one in your opening post:
I'm not sure how well that'll work, but it could be worth a try.
$this_unit
appropriately into the definition of the DEFENSE_ANIM
macro (which requires you to use [modify_unit]
to add the animation), and otherwise do just as I described above. However, it really depends on what set of units could possibly receive the animation, and how their defend animations are constructed. It may be necessary to make a different version of the explosion for every unit.Given that your animation is very simple, there might be another alternative, as long as you're not using it on something like a Mage of Light (or if you're okay with an illuminates halo disappearing). You could use the following effect instead of the one in your opening post:
Code: Select all
[effect]
apply_to=halo
halo="projectiles/fireball-impact-[1~16].png:[60*16]"
[/effect]
- ZombieKnight
- Posts: 283
- Joined: June 27th, 2022, 2:26 pm
- Location: Czech Republic
Re: Merge unit animaions
I'm using lua.add.hex_overlay now, but its glitchy...
I'll stick with it for now, if I won't find a repair until release, I'll try these too (tho the'll maybe glitchy too)
I'll stick with it for now, if I won't find a repair until release, I'll try these too (tho the'll maybe glitchy too)
I had saurian in profile before, but I've merged my discord profile with forum one...
Working on campaign Bandits from Brown Hills
Working on campaign Bandits from Brown Hills
- ZombieKnight
- Posts: 283
- Joined: June 27th, 2022, 2:26 pm
- Location: Czech Republic
Re: Merge unit animaions
Btw can I use ~BLIT to make an animation from two animations?
I had saurian in profile before, but I've merged my discord profile with forum one...
Working on campaign Bandits from Brown Hills
Working on campaign Bandits from Brown Hills
- Celtic_Minstrel
- Developer
- Posts: 2290
- Joined: August 3rd, 2012, 11:26 pm
- Location: Canada
- Contact:
Re: Merge unit animaions
BLIT works on images, not animations. So no.
- ZombieKnight
- Posts: 283
- Joined: June 27th, 2022, 2:26 pm
- Location: Czech Republic
Re: Merge unit animaions
Aaand any idea how to merge more animation halos into one?
(I'd like my unit attack animation "smoke bomb" = gun smoke into all six directions)
(I'd like my unit attack animation "smoke bomb" = gun smoke into all six directions)
I had saurian in profile before, but I've merged my discord profile with forum one...
Working on campaign Bandits from Brown Hills
Working on campaign Bandits from Brown Hills
- Celtic_Minstrel
- Developer
- Posts: 2290
- Joined: August 3rd, 2012, 11:26 pm
- Location: Canada
- Contact:
Re: Merge unit animaions
It's pretty likely that that's not possible (short of image editing).
- ZombieKnight
- Posts: 283
- Joined: June 27th, 2022, 2:26 pm
- Location: Czech Republic
Re: Merge unit animaions
It has to be!
I really don't like the idea of putting over 100 offseted images together
I really don't like the idea of putting over 100 offseted images together
I had saurian in profile before, but I've merged my discord profile with forum one...
Working on campaign Bandits from Brown Hills
Working on campaign Bandits from Brown Hills
- Celtic_Minstrel
- Developer
- Posts: 2290
- Joined: August 3rd, 2012, 11:26 pm
- Location: Canada
- Contact:
Re: Merge unit animaions
Well, it's possible in a unit animation. Maybe you could also try putting several items on the same hex, each with a different halo.
- ZombieKnight
- Posts: 283
- Joined: June 27th, 2022, 2:26 pm
- Location: Czech Republic
Re: Merge unit animaions
Jup that is possible... but how to put it into:
Any idea?
Code: Select all
[effect]
apply_to=new_animation
I had saurian in profile before, but I've merged my discord profile with forum one...
Working on campaign Bandits from Brown Hills
Working on campaign Bandits from Brown Hills
- ZombieKnight
- Posts: 283
- Joined: June 27th, 2022, 2:26 pm
- Location: Czech Republic
Re: Merge unit animaions
I've found a solution... just put there [missile1_frame] ... [missile6_frame] and different halos in there ...
What's weird is that there's nowhere a word about your frame tags in the documentation.
What's weird is that there's nowhere a word about your frame tags in the documentation.
I had saurian in profile before, but I've merged my discord profile with forum one...
Working on campaign Bandits from Brown Hills
Working on campaign Bandits from Brown Hills