The problem is with synchronising animation on different tiles of an object, and in fact I suppose that animations are only running for one tile of my 2-tile objects, for whatever reason.
First, let´s take a look into the specs:
The second sentence makes no sense to me. It suggests that animations won´t run on tiles were you don´t "activate" it by means of the "built tile trigger and callback 159" recipe. But IMO this interpretation would be a contradiction to what the spec says in the following:action0 objects wrote: (3) - Setting this flag [bit6 - Object has animation] will allow the object's animation counter to be increased, must be set if you plan to make use of animations. Like stations you must enable animation on a per tile basis by means of the "built tile" trigger and callback 159.
I.e., you´ll have to "suppress" animations for tiles you don´t want to be animated, precisely because animations are run on *all* tiles, even for those you don´t want!action0 objects wrote: Since you can't have properties for individual object tiles, this property applies for every tile of the object. If you don't want to animate some tiles ...
Suppressing "unwanted" animation is usually being done by using var40 (get tile position inside object) and returning 0xFD for CB 159.
So far so good.
Now, w/r to the original problem, Yexo and frosch told me (in bugs.openttd.org):
Yexo wrote: You should also enable the animation callback for the tiles that are updated via var63.
The actual return value from the animation callback doesn't matter, as long as it's run the
tile will be marked dirty (and therefor redrawn).
But this is what I don´t understand at all. I *am* using CB159 to start the animation depending on some random value, and I think in this particular way the animation is started for *all* the tiles:frosch wrote: In this case CB 159 has to return FE on construction for all tiles which depend on some animation state.
Code: Select all
// start animation if on last frame (1/5 chance)
2030 * 0 02 0f 14 81 10 00 FF 01
01 80 00 33 // start on frame1
fd 80 // do nothing
2031 * 0 02 0f 15 81 43 00 FF 01
14 00 00 00 // first frame, start
fd 80
[...]
2036 * 0 02 0f 3c 85 0C 00 FF FF 02
15 00 59 01 59 01 // start animation
19 00 58 01 58 01 // handle anim frames
12 00 // graphics
2037 * 0 03 0f 01 13 01
ff 13 00
3c 00
I.e., from my understanding of nfo, something like:
Code: Select all
2029 * 0 02 0f 1e 81 40 10 FF 01
01 80 00 00 // back
fe 80 // front
// start animation if on last frame (1/5 chance)
2030 * 0 02 0f 14 81 10 00 FF 01
1e 00 00 33 // explicitly check which tile we are at
fd 80 // do nothing
And even with the code above, it´s not possible getting the animation to run for a second tile, which can be easily verified from the inspection window.
Moreover, I can´t understand how it should be possible to return 0xFE for CB159 "on construction", because there doesn´t seem to exist means to get that particular event for objects? At least, there´s nothing about that in the specs. [edit: this info has now been added by frosch]
So, in conclusion, I´d like to get some clarification from a developer how multi-tile animations for objects should be handled. The information given in the specs isn´t only incomprehensible but seems also be misleading in some way. (Or there´s even a bug somewhere.)
regards
Michael