need 1.11.2 animation help
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.
need 1.11.2 animation help
Ok, here is the macro that I use to control standing animations for the dragons in my 'Library of Kratemaqht' campaign. The problem is that my alternate 'eating' and 'sleeping' standing animations are not working anymore after updating. There have been some big changes to the animation system in 1.11.2, and if anyone knows what needs to be changed to make this work again, I would be very grateful. These animations are really important to the story and the impact of the dragons.
I have edited out many frames for brevity. I do like the new animation notations with the ~, it is especially useful when you have alot of frames, I even found an error upon posting in this macro caused by the confusion of so many frames.
I have edited out many frames for brevity. I do like the new animation notations with the ~, it is especially useful when you have alot of frames, I even found an error upon posting in this macro caused by the confusion of so many frames.
Code: Select all
#define DRAGON_STANDING_ANIM DRAGON_NAME
[standing_anim]
[frame]
image="units/dragons/{DRAGON_NAME}-base.png"
duration=50
[/frame]
[/standing_anim]
[standing_anim]
[filter]
[filter_wml]
[variables]
sleeping=true
[/variables]
[/filter_wml]
[/filter]
[frame]
image="units/dragons/{DRAGON_NAME}-sleep-base.png"
duration=50
[/frame]
[/standing_anim]
[standing_anim]
[filter]
[filter_wml]
[variables]
eating=true
[/variables]
[/filter_wml]
[/filter]
[frame]
duration=50
image="units/dragons/{DRAGON_NAME}-eat-01.png"
[/frame]
[frame]
duration=50
image="units/dragons/{DRAGON_NAME}-eat-02.png"
[/frame]
[frame]
duration=50
image="units/dragons/{DRAGON_NAME}-eat-03.png"
[/frame]
... lots of frames
[frame]
duration=50
image="units/dragons/{DRAGON_NAME}-eat-73.png"
[/frame]
[/standing_anim]
[standing_anim]
start_time=0
terrain_type={DRAGON_UNWALKABLE_TERRAINS}
submerge=0.01
[frame]
duration=50
image="units/dragons/{DRAGON_NAME}-fly-01.png"
[/frame]
[frame]
duration=50
image="units/dragons/{DRAGON_NAME}-fly-02.png"
[/frame]
[frame]
duration=50
image="units/dragons/{DRAGON_NAME}-fly-03.png"
[/frame]
... lots of frames
[frame]
duration=50
image="units/dragons/{DRAGON_NAME}-fly-27.png"
[/frame]
[/standing_anim]
[pre_movement_anim]
start_time=0
terrain_type=!,{DRAGON_UNWALKABLE_TERRAINS}
[frame]
duration=50
image="units/dragons/{DRAGON_NAME}-liftoff-01.png"
[/frame]
[frame]
duration=50
image="units/dragons/{DRAGON_NAME}-liftoff-02.png"
[/frame]
[frame]
duration=50
image="units/dragons/{DRAGON_NAME}-liftoff-03.png"
[/frame]
... lots of frames
[frame]
duration=50
image="units/dragons/{DRAGON_NAME}-liftoff-22.png"
[/frame]
[/pre_movement_anim]
[movement_anim]
start_time=0
submerge=0.01
[frame]
duration=50
image="units/dragons/{DRAGON_NAME}-fly-01.png"
[/frame]
[frame]
duration=50
image="units/dragons/{DRAGON_NAME}-fly-02.png"
[/frame]
[frame]
duration=50
image="units/dragons/{DRAGON_NAME}-fly-03.png"
[/frame]
... lots of frames
[frame]
duration=50
image="units/dragons/{DRAGON_NAME}-fly-27.png"
[/frame]
[/movement_anim]
[post_movement_anim]
terrain_type=!,{DRAGON_UNWALKABLE_TERRAINS}
start_time=0
[frame]
duration=50
image="units/dragons/{DRAGON_NAME}-landing-01.png"
[/frame]
[frame]
duration=50
image="units/dragons/{DRAGON_NAME}-landing-02.png"
[/frame]
[frame]
duration=50
image="units/dragons/{DRAGON_NAME}-landing-03.png"
[/frame]
...
[frame]
duration=50
image="units/dragons/{DRAGON_NAME}-landing-15.png"
[/frame]
[/post_movement_anim]
[idle_anim]
terrain_type=!,{DRAGON_UNWALKABLE_TERRAINS}
start_time=0
[frame]
duration=50
image="units/dragons/{DRAGON_NAME}-tongue-01.png"
[/frame]
[frame]
duration=50
image="units/dragons/{DRAGON_NAME}-tongue-02.png"
[/frame]
[frame]
duration=50
image="units/dragons/{DRAGON_NAME}-tongue-03.png"
[/frame]
... lots of frames
[frame]
duration=50
image="units/dragons/{DRAGON_NAME}-tongue-21.png"
[/frame]
[/idle_anim]
#enddef
Last edited by cephalo on March 28th, 2013, 5:09 pm, edited 1 time in total.
Re: need 1.11.2 animation help
I am not entirely sure but I believe it would become something like the following:
Rename the images 01-09 to 1-9. I don't think the engine supports leading zeros.
Code: Select all
[standing_anim]
[frame]
image="units/dragons/{DRAGON_NAME}-base.png:50"
[/frame]
[/standing_anim]
[standing_anim]
[filter]
[filter_wml]
[variables]
eating=true
[/variables]
[/filter_wml]
[/filter]
[frame]
image="units/dragons/{DRAGON_NAME}-eat-[1~73].png:50"
[/frame]
[/standing_anim]
Re: need 1.11.2 animation help
To be clear, the only thing that is actually broken is the selection criteria. The [filter_wml] that used to work, no longer works. When I set the dragon to eating or sleeping, nothing happens. Only the base frame animation is played. I tried changing the order of the different standing animations, but that didn't help either.
Re: need 1.11.2 animation help
Sounds like a bug.
I have experienced a bit around with different settings and the following works fine:
So maybe a standing animation without filter overrides the others or the problem is elsewhere.
BTW, when I remove one animation (leaving with only one - filtered - animation) I get a Segmentation faul as soon I scroll to the Gryphons.
I have experienced a bit around with different settings and the following works fine:
Code: Select all
[standing_anim]
[filter]
[filter_wml]
[variables]
fly=yes
[/variables]
[/filter_wml]
[/filter]
start_time=0
layer=60
[frame]
image="units/monsters/gryphon-flying-[5,4,5].png:[100,200,100]"
[/frame]
[/standing_anim]
[standing_anim]
[filter]
[not]
[filter_wml]
[variables]
fly=yes
[/variables]
[/filter_wml]
[/not]
[/filter]
start_time=0
layer=60
[frame]
image="units/monsters/gryphon-flying-[1~8].png:150"
[/frame]
[/standing_anim]
BTW, when I remove one animation (leaving with only one - filtered - animation) I get a Segmentation faul as soon I scroll to the Gryphons.
Re: need 1.11.2 animation help
you could ask for help in this thread:
http://forums.wesnoth.org/viewtopic.php?f=10&t=38198
http://forums.wesnoth.org/viewtopic.php?f=10&t=38198
Re: need 1.11.2 animation help
Hi. I am somewhat responsible for the changes to the syntax, and it does support leading zeros (see here).trewe wrote:I am not entirely sure but I believe it would become something like the following:
Rename the images 01-09 to 1-9. I don't think the engine supports leading zeros.Code: Select all
... [frame] image="units/dragons/{DRAGON_NAME}-eat-[1~73].png:50" [/frame] ...
Please add a start time.cephalo wrote:To be clear, the only thing that is actually broken is the selection criteria. The [filter_wml] that used to work, no longer works. When I set the dragon to eating or sleeping, nothing happens. Only the base frame animation is played. I tried changing the order of the different standing animations, but that didn't help either.
Sounds like a bug though. Can I ask 2 questions (normally would be on bug tracker, but code is moving to GIT from SVN at the moment).
1.)The old syntax should still work. Does it?
2.) Does it work if you use the new syntax, but split it so that the first frame is separate from the rest (if so then there might be some extra 'smartness' that needs to be taken out of the game engine seeing it is one frame and playing it as a static image). i.e.
Code: Select all
[standing_anim]
[frame]
image="units/dragons/{DRAGON_NAME}-base.png:50"
[/frame]
[/standing_anim]
[standing_anim]
[filter]
[filter_wml]
[variables]
eating=true
[/variables]
[/filter_wml]
[/filter]
start_time=0
[frame]
image="units/dragons/{DRAGON_NAME}-eat-01.png:50"
[/frame]
[frame]
image="units/dragons/{DRAGON_NAME}-eat-[02~73].png:50"
[/frame]
[/standing_anim]
Re: need 1.11.2 animation help
I have not actually attempted the new notation in any way, because I didn't wan't to muddy the waters without understanding what is going on. The animations that do play seem to play correctly. My only issue is that my alternate animations are not being chosen like they were last version. Can I assume that this is unintended behavior, and not something we are expected to change in our wml?
EDIT: Also, what would be an appropriate start time for a looping animation? Zero?
EDIT: Also, what would be an appropriate start time for a looping animation? Zero?
Re: need 1.11.2 animation help
That is unintended behaviour. All the old syntax should work exactly the same as before. I'm thinking of putting up a small Wiki page with examples of how to get unit animation WML going easily with the new syntax and where it might be appropriate to convert old syntax.cephalo wrote:I have not actually attempted the new notation in any way, because I didn't wan't to muddy the waters without understanding what is going on. The animations that do play seem to play correctly. My only issue is that my alternate animations are not being chosen like they were last version. Can I assume that this is unintended behavior, and not something we are expected to change in our wml?
Standing animations in default mostly start at time 0. If you do not specify this I think this is where it should start, but you are relying then on the engine to create a parameter for you.cephalo wrote:EDIT: Also, what would be an appropriate start time for a looping animation? Zero?
Just want to confirm that the problem occurs with the old syntax applied fully and 1.11.2?
Re: need 1.11.2 animation help
Yes, this used to work, and now does not, and I have not changed anything. It might not even be related to the changes you made, but it's a start. I wish I could send you the relevant files, but the dragon is a complicated beast with 400+ frames. You'll probably want to confirm this with something alot simpler.
If you need to, you can use the 1.10 version of Library of Kratemaqht in 1.11.2 as far as the dragon goes, it's the same. In 1.10 thru 1.11.1 the dragon eats in the first scenario, in 1.11.2 he does not eat. If you change the location of the player's leader to the commented out coords (I had to test these things initially of course) you can test it fairly quickly.
If you need to, you can use the 1.10 version of Library of Kratemaqht in 1.11.2 as far as the dragon goes, it's the same. In 1.10 thru 1.11.1 the dragon eats in the first scenario, in 1.11.2 he does not eat. If you change the location of the player's leader to the commented out coords (I had to test these things initially of course) you can test it fairly quickly.
Re: need 1.11.2 animation help
Hmm, I tried to put a 'not' filter on my base anim as per your example, and it did not fix the problem in my case. Yuck, that indicates it might not be a simple problem. I only specified 'not eating' however, not 'not everything'. I'm not actually sure how to do that though, because there is a built in terrain filter also in case of needing to fly in place etc.trewe wrote:Sounds like a bug.
I have experienced a bit around with different settings and the following works fine:So maybe a standing animation without filter overrides the others or the problem is elsewhere.Code: Select all
[standing_anim] [filter] [filter_wml] [variables] fly=yes [/variables] [/filter_wml] [/filter] start_time=0 layer=60 [frame] image="units/monsters/gryphon-flying-[5,4,5].png:[100,200,100]" [/frame] [/standing_anim] [standing_anim] [filter] [not] [filter_wml] [variables] fly=yes [/variables] [/filter_wml] [/not] [/filter] start_time=0 layer=60 [frame] image="units/monsters/gryphon-flying-[1~8].png:150" [/frame] [/standing_anim]
BTW, when I remove one animation (leaving with only one - filtered - animation) I get a Segmentation faul as soon I scroll to the Gryphons.
Re: need 1.11.2 animation help
Tested. See attached. Doing a "debug", "inspect" I found that the variable was not set. Works for me in 1.11.2 when it is set.cephalo wrote:Yes, this used to work, and now does not, and I have not changed anything... If you need to, you can use the 1.10 version of Library of Kratemaqht in 1.11.2 as far as the dragon goes, it's the same. In 1.10 thru 1.11.1 the dragon eats in the first scenario, in 1.11.2 he does not eat. If you change the location of the player's leader to the commented out coords (I had to test these things initially of course) you can test it fairly quickly.
I also tried with the new syntax and it works fine for me.
EDIT:
Can't go past commenting on the dragon. He's a really nice looking dragon you've got there.
- Attachments
-
- 01_Cold_Mountain.cfg
- (19.59 KiB) Downloaded 78 times
Re: need 1.11.2 animation help
I'm.... so confused. How am I failing to set the variable? I know I set it in a way that worked before. It's supposed to be set when Shifty wakes up from his nap, and cleared again if he messes with the dragon. How exactly did you set the variable? Thanks for the help with my... problem.
EDIT: Hmm, when I inpect the unit, I am seeing that the variable is set, eating=true, yet I am not seeing the animation. How are you seeing it? There is a point when Shifty moves to a gold pile, the dragon comes, he faints and when he wakes up, the dragon is supposed to be 'friendly' and eating Shifty's friends. When I inspect at that point, I see that the variable is set properly.
EDIT: Hmm, when I inpect the unit, I am seeing that the variable is set, eating=true, yet I am not seeing the animation. How are you seeing it? There is a point when Shifty moves to a gold pile, the dragon comes, he faints and when he wakes up, the dragon is supposed to be 'friendly' and eating Shifty's friends. When I inspect at that point, I see that the variable is set properly.
Re: need 1.11.2 animation help
All I did is copy the capaign from 1.10, copy some builder macros from wesnoth 1.10 data/terrain-builder/builder.cfg that you use (you probably shouldn't use macros that say INTERNAL), and made the changes to the file that I attached. The dragon appears bottom-right from the start and is "eating" properly for me with 1.11.2.cephalo wrote:I'm.... so confused. How am I failing to set the variable? I know I set it in a way that worked before. It's supposed to be set when Shifty wakes up from his nap, and cleared again if he messes with the dragon. How exactly did you set the variable? Thanks for the help with my... problem.
EDIT: Hmm, when I inpect the unit, I am seeing that the variable is set, eating=true, yet I am not seeing the animation. How are you seeing it? There is a point when Shifty moves to a gold pile, the dragon comes, he faints and when he wakes up, the dragon is supposed to be 'friendly' and eating Shifty's friends. When I inspect at that point, I see that the variable is set properly.
Re: need 1.11.2 animation help
So for you, the 1.10 version works right out the box with the macros that you added. Hmm, I wonder if I am still missing some of those macros. The only one I know about is the ANIMATION_08_INTERNAL used for my burning villages and I replaced that one in the version of my campaign that I am using with the new syntax. (I'm sure I didn't know exactly what INTERNAL meant in this context) I said I didn't change anything, but I forgot about this one thing. What macros did you port over exactly? The only changes in my scenario file that I noticed were moving the leader, was that all it was?Coffee wrote:
All I did is copy the capaign from 1.10, copy some builder macros from wesnoth 1.10 data/terrain-builder/builder.cfg that you use (you probably shouldn't use macros that say INTERNAL), and made the changes to the file that I attached. The dragon appears bottom-right from the start and is "eating" properly for me with 1.11.2.
EDIT: I went ahead and replaced my scenario with the one you posted, and I still don't get the animation. There must be something different about your environment. I use Windows btw.
Re: need 1.11.2 animation help
Yes. I copied the ANIMATION_08_INTERNAL macro across into a new file in utils.cephalo wrote:So for you, the 1.10 version works right out the box with the macros that you added. Hmm, I wonder if I am still missing some of those macros. The only one I know about is the ANIMATION_08_INTERNAL used for my burning villages and I replaced that one in the version of my campaign that I am using with the new syntax. (I'm sure I didn't know exactly what INTERNAL meant in this context) I said I didn't change anything, but I forgot about this one thing. What macros did you port over exactly? The only changes in my scenario file that I noticed were moving the leader, was that all it was?
The change was what you had commented out for testing -- changing the type of unit "Don" to "Anicient Feral Dragon" and setting variables initialization. Look at this unit bottom-right from the start and you should see it chomping?