Expose entity graphics within LuaEntityPrototype

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
BurninSun
Long Handed Inserter
Long Handed Inserter
Posts: 82
Joined: Fri Mar 16, 2018 4:54 am
Contact:

Expose entity graphics within LuaEntityPrototype

Post by BurninSun »

I want to use rendering.draw_animation or rendering.draw_sprite to draw my own copies of entities. Currently, the only way to get those graphics is by iterating entities and copying their graphic information into an animation/sprite prototype during data stage.

I would like LuaEntityPrototype to have an attribute of sprite or animation which returns something which can be passed directly to rendering.draw_animation/sprite.
Rseding91
Factorio Staff
Factorio Staff
Posts: 16551
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Expose entity graphics within LuaEntityPrototype

Post by Rseding91 »

There's no simple or generic way to make this work on the engine side. Near every entity has some special rendering logic in how it eventually shows in-game. That makes it impossible to simply map an entity to "draw sprite/animation" without hand-written logic for every case (functionally copying the drawing code from each entity).
If you want to get ahold of me I'm almost always on Discord.
Post Reply

Return to “Modding interface requests”