Currently, Nixie Tubes works by some trickery involving a fake "car", because setting its rotation controls the animation state. Unfortunately, the fake car also confuses the map display with arrow pointers where there shouldn't be any.
The easiest solution would be to have the ability to set an animatable entity's animation frame directly.
The ablity to programatically set an animated entity's animation frame at runtime
Re: The ablity to programatically set an animated entity's animation frame at runtime
I am behind this but I'm not to sure how... workable it is...
it works well when FPS==UPS but on my computer I get 57/60 to 27/57 or worse. in these cases, if the animation is updated each tick, some frames will jump 2 animation-frames, worst case could be 6+ animation frames skipped per frame. at just the right skippage, it could play the animation in reverse or seemed paused.
The part that I could really get behind would be to change the picture/sprite. though, right now the way to do that is cars (nixie way) and animations.
it works well when FPS==UPS but on my computer I get 57/60 to 27/57 or worse. in these cases, if the animation is updated each tick, some frames will jump 2 animation-frames, worst case could be 6+ animation frames skipped per frame. at just the right skippage, it could play the animation in reverse or seemed paused.
The part that I could really get behind would be to change the picture/sprite. though, right now the way to do that is cars (nixie way) and animations.
Will code for Food. I also have 11+ mods!
Re: The ablity to programatically set an animated entity's animation frame at runtime
I too would see use in a system for "defining" animation frames. In fact, if they decoupled animations from the specific entitys, it could lead to some much more interesting graphic options, both for the vanilla game and mods.
Lets take the Roboport's "spinner" on the top.
the current Prototype for it is as follows.
Lets say all animations were added to their own table, and tweaked a bit to be non-entity-dependent. It would be great if you could pass something like ani = entity.animations["base_animation"] to work with the animations. It could have vars like ani.animation_speed to allow dynamic changing of animation speed (im working harder, so show it). or ani.animated to define if the animation is actually cycling. combine the previous with an ani.frame_count to allow setting a specific frame, so in the example of Nixie Tubes, showing a certain "number". And maybe something like an ani.visible which could allow animations to be "toggled off" (or changed to a different animation by toggling one off at the same time another is toggled on.)
Lets take the Roboport's "spinner" on the top.
the current Prototype for it is as follows.
Code: Select all
base_animation =
{
filename = "__base__/graphics/entity/roboport/roboport-base-animation.png",
priority = "medium",
width = 42,
height = 31,
frame_count = 8,
animation_speed = 0.5,
shift = {-0.5315, -1.9375}
},
Re: The ablity to programatically set an animated entity's animation frame at runtime
I do like that, the ability to even change the animation is pretty nifty...
Will code for Food. I also have 11+ mods!
- Ranakastrasz
- Smart Inserter
- Posts: 2174
- Joined: Thu Jun 12, 2014 3:05 am
- Contact:
Re: The ablity to programatically set an animated entity's animation frame at runtime
This is absolutely manditory. Currently, my shield pulse mod uses 20 seperate entities displayed in or out of sequence, which is ridiculous.
My Mods:
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16
Re: The ablity to programatically set an animated entity's animation frame at runtime
This is how this problem was solved: I have added animations to LuaRendering, so you can now draw any animation anywhere and anytime you want :)DaCyclops wrote: Tue Sep 22, 2015 1:19 am In fact, if they decoupled animations from the specific entitys, it could lead to some much more interesting graphic options, both for the vanilla game and mods.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.