[1.1.5] Why you banned custom sprite?

Bugs that are actually features.
Post Reply
yagaodirac
Fast Inserter
Fast Inserter
Posts: 152
Joined: Sun Jun 16, 2019 4:04 pm
Contact:

[1.1.5] Why you banned custom sprite?

Post 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?
Last edited by yagaodirac on Sat Dec 05, 2020 11:53 am, edited 1 time in total.

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: [1.1.5] Why you banned custom sprite?

Post by eradicator »

The SpritePath for custom sprites is "name" not "sprite.name".
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

yagaodirac
Fast Inserter
Fast Inserter
Posts: 152
Joined: Sun Jun 16, 2019 4:04 pm
Contact:

Re: [1.1.5] Why you banned custom sprite?

Post 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?

Rseding91
Factorio Staff
Factorio Staff
Posts: 13204
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [1.1.5] Why you banned custom sprite?

Post 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.
If you want to get ahold of me I'm almost always on Discord.

Post Reply

Return to “Not a bug”