Page 1 of 1

[1.1.5] Why you banned custom sprite?

Posted: Sat Dec 05, 2020 11:32 am
by yagaodirac
I have no idea whether you know this detail.
In order to display a custom sprite in game, there seems a lot of methods which would work.
According to your docs, function rendering.draw_sprite needs a parameter named sprite . It's type is SpritePath. SpritePath accepts 2 forms, first is "type.name"., So I have 2 intuitive ways, one is type==entity, the other is type == sprite. But type = "entity"doesn't compile inside data.lua, while type = "sprite" is not accepted by the rendering.draw_sprite.

Then what should I do? A custom recipe with custom sprite only for a sprite?

In my opinion, the rendering.draw_sprite function shall receive anything with type == sprite.

Update: I deepcopied and modified a prototype from achievement. The lovely achievement of "so long and thanks for all the fish". Then call rendering.draw_sprite with this AcHiEvEmEnT. Fancy and Fantastic. Anyway, it works now.
Would you modify the function so that people could all it with real sprites?

Re: [1.1.5] Why you banned custom sprite?

Posted: Sat Dec 05, 2020 11:36 am
by eradicator
The SpritePath for custom sprites is "name" not "sprite.name".

Re: [1.1.5] Why you banned custom sprite?

Posted: Sat Dec 05, 2020 11:59 am
by yagaodirac
eradicator wrote: Sat Dec 05, 2020 11:36 am The SpritePath for custom sprites is "name" not "sprite.name".
Oh, my,,,, emmm. Yeah, it works. Thanks.

But to the Factorio staff, why not allow "sprite.name" as well?

Re: [1.1.5] Why you banned custom sprite?

Posted: Tue Dec 08, 2020 5:59 am
by Rseding91
yagaodirac wrote: Sat Dec 05, 2020 11:59 am
eradicator wrote: Sat Dec 05, 2020 11:36 am The SpritePath for custom sprites is "name" not "sprite.name".
Oh, my,,,, emmm. Yeah, it works. Thanks.

But to the Factorio staff, why not allow "sprite.name" as well?
Why would we allow a random different string? It's "name". Just use that if you want it to work.