How to control building animations

Place to get help with not working mods / modding interface.
Xeon257
Inserter
Inserter
Posts: 46
Joined: Wed Sep 24, 2025 6:25 pm
Contact:

How to control building animations

Post by Xeon257 »

Hello. I’m looking for a way to turn a building’s animation on and off through scripting.

For example, I would like the entity to remain in an idle (non-animated) state normally, and then start playing its animation when the player “turns on the power” through a dialogue interaction.

I don’t have much knowledge about 2D graphics, and I haven’t experimented much with entity prototypes yet, so I’m not sure how I should approach this.
Could I ask for some advice?
I am not able to write in English myself, so I am using ChatGPT for help. Please excuse any awkward phrasing.
Xeon257
Inserter
Inserter
Posts: 46
Joined: Wed Sep 24, 2025 6:25 pm
Contact:

Re: How to control building animations

Post by Xeon257 »

To clarify my question a bit—what I’m really trying to understand is whether there is any API that allows enabling or disabling an entity’s animation directly, or if there are other commonly used methods to control animations in practice.

At the moment, the only idea I have is to base the entity on an assembling machine and register a recipe that produces nothing, so that I can control the animation by starting or stopping the crafting process. But I’m not sure if this is the proper or recommended approach.
I am not able to write in English myself, so I am using ChatGPT for help. Please excuse any awkward phrasing.
User avatar
Silari
Filter Inserter
Filter Inserter
Posts: 602
Joined: Sat Jan 27, 2018 10:04 pm
Contact:

Re: How to control building animations

Post by Silari »

Does the disabled_by_script property not work for that? Far as I know it disables animations too.
Post Reply

Return to “Modding help”