Add a flag to LuaRendering.draw_animation that makes the animation stop on the last (or a specified) frame and display this frame indefinitely.
Usecase: I want to use draw_animation calls to add custom animations to a modded inserter and would like the animation to stop at each of the two endpoints (picking up/dropping off) until i invoke a new draw call when the state changes again.
Add ability to draw_animation to stop on last frame
-
- Inserter
- Posts: 20
- Joined: Tue May 01, 2018 3:29 pm
- Contact:
-
- Inserter
- Posts: 20
- Joined: Tue May 01, 2018 3:29 pm
- Contact:
Re: Add ability to draw_animation to stop on last frame
while i guess no answer probably means no, could i get a feedback on if this might happen or not?
This would help me with deciding how to implement the wanted behavior.
This would help me with deciding how to implement the wanted behavior.
Re: Add ability to draw_animation to stop on last frame
No answer could also mean they are still looking to see how feasible it is to add. It may need complex code or have a significant performance impact that needs investigating first.
Re: Add ability to draw_animation to stop on last frame
Something like this would be pretty easy to add, it just isn't a high priority. Your use case is very specific and pretty hacky, plus the devs are going for stable at the moment so they are more hesitant to implement new features.
I recommend trying to find another solution for your issue for now, then if it gets implemented in the future you can decide what method is better.
I recommend trying to find another solution for your issue for now, then if it gets implemented in the future you can decide what method is better.
Re: Add ability to draw_animation to stop on last frame
Boodals says it pretty well. The request raises the question of "how would this be useful for anything else". Since you can just spawn a sprite when the animation ends, so you can already do what you want, I am not seeing anything that would convince me to add this.
Another option for you is to set the animation speed to 0 and then animation offset to your frame count once the animation is "over".
Another option for you is to set the animation speed to 0 and then animation offset to your frame count once the animation is "over".
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
-
- Inserter
- Posts: 20
- Joined: Tue May 01, 2018 3:29 pm
- Contact:
Re: Add ability to draw_animation to stop on last frame
i can do that but it requires me too track the state of all animations continuously. my thought was that since the animation itself already knows at which frame it currently is, it would be better performance wise to just have the animation stop at a given frame than me adding a lot of overhead for tracking its state.Bilka wrote: Wed Aug 14, 2019 8:25 pm Since you can just spawn a sprite when the animation ends, so you can already do what you want, I am not seeing anything that would convince me to add this.
for other use cases: i guess any hypothetical modded entity that sometimes moves and sometimes just stays inmobile could benefit from such an option
in the end i am fine using the existing tools to get the behavior i want, my only concern was possible performance implications.
-
- Filter Inserter
- Posts: 587
- Joined: Sun Jun 09, 2019 10:40 pm
- Contact:
Re: Add ability to draw_animation to stop on last frame
I'd strongly advise waiting until they turn into real, concrete, and demonstrable, performance issues first. In almost every case the "possible" performance issues and the actual performance issues are entirely different sets. Until you have something to reliably demonstrate the problem -- which is critical to demonstrate you no longer have the problem after you try and fix it -- you can invest huge effort in fixing non-problems, and still have the performance tank somewhere.rude_grass wrote: Wed Aug 14, 2019 9:01 pm in the end i am fine using the existing tools to get the behavior i want, my only concern was possible performance implications.