I'm looking at your code here and you have 49 frames for your idle animation? Hm. If it's just a single frame repeated 49 times you can use `repeat_count = 49` with `frame_count = 1` and a single image.
So the idle_animation field is a bit of a misnomer: it's not actually
animated. Basically it means that when you transition from active to idle, the animation will pause on the shared frame number.
However! If you have fluid boxes, which I see that you do: basically the code logic can't tell the machine has gone to "sleep" due to the fluid logic, so idle_animation is never used:
posila wrote: ↑Tue Sep 15, 2020 10:33 am
The problem is the assembler has fluidboxes on it, so it doesn't go to sleep, and therefore the rendering doesn't consider the machine to be "idle".
It is definitelly an issue, I'll think about performance implications of making more expensive checks for being idle in rendering.
working_visualisations by contrast
does know when an assembling machine has gone idle, even with fluid boxes, and so will turn off the animation unless you tell it to always_draw.
animation can be used here to be the idle state, since working_visualisation draws on top of animation, however you need to build your sprites specifically for this scenario, e.g. you have working_visualization be the animated portion of your sprite, and animation the non-animated portions, otherwise you have two sprites layered on top of each other.
This entity here
https://github.com/Arch666Angel/mods/bl ... achine.lua is the one that was giving me trouble for much the same reasons you're experiencing, and I ended up constructing it with the following layers (but ALL in working_visualisations, though I don't remember why anymore):
working_vis 1: The "idle" state, set to `always_draw = true`
- hr-strand-casting-machine-idle-state.png (236.65 KiB) Viewed 3478 times
working_vis 2: The "recipe mask", which is colored with the recipe tint property, and set to `always_draw = true`
- hr-strand-casting-machine-recipe-mask.png (94.75 KiB) Viewed 3478 times
working_vis 3: The actual animation, which is drawn above the "idle" and "recipe mask" states when the machine is active
- hr-strand-casting-machine-animation-frame.png (185.06 KiB) Viewed 3478 times
working_vis_4: The light that lights up the machine at night, which is likewise animated:
- hr-strand-casting-machine-light-frame.png (44.06 KiB) Viewed 3478 times
I don't know what your model looks like that you're trying to setup, I could give you pointers or ideas if you were to post it.