Add ability to draw_animation to stop on last frame

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Post Reply
rude_grass
Inserter
Inserter
Posts: 20
Joined: Tue May 01, 2018 3:29 pm
Contact:

Add ability to draw_animation to stop on last frame

Post by rude_grass »

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.

rude_grass
Inserter
Inserter
Posts: 20
Joined: Tue May 01, 2018 3:29 pm
Contact:

Re: Add ability to draw_animation to stop on last frame

Post by rude_grass »

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.

User avatar
mat1k
Long Handed Inserter
Long Handed Inserter
Posts: 55
Joined: Sat Dec 22, 2018 8:48 am
Contact:

Re: Add ability to draw_animation to stop on last frame

Post by mat1k »

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.

Boodals
Fast Inserter
Fast Inserter
Posts: 129
Joined: Sun Feb 11, 2018 7:10 pm
Contact:

Re: Add ability to draw_animation to stop on last frame

Post by Boodals »

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.

Bilka
Factorio Staff
Factorio Staff
Posts: 3132
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: Add ability to draw_animation to stop on last frame

Post by Bilka »

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".
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

rude_grass
Inserter
Inserter
Posts: 20
Joined: Tue May 01, 2018 3:29 pm
Contact:

Re: Add ability to draw_animation to stop on last frame

Post by rude_grass »

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.
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.

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.

slippycheeze
Filter Inserter
Filter Inserter
Posts: 587
Joined: Sun Jun 09, 2019 10:40 pm
Contact:

Re: Add ability to draw_animation to stop on last frame

Post by slippycheeze »

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.
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.

Post Reply

Return to “Modding interface requests”