[0.16.51] Some vanilla sprite images are 'Unknown'

Place to get help with not working mods / modding interface.
mophydeen
Filter Inserter
Filter Inserter
Posts: 529
Joined: Sun Nov 22, 2015 5:02 pm
Contact:

[0.16.51] Some vanilla sprite images are 'Unknown'

Post by mophydeen »

You can call this:

Code: Select all

        player.gui.top["auto-trash-toggle-button"].sprite = "utility/trash_bin"
        player.gui.top["auto-trash-toggle-button"].sprite = "technology/rocket-silo"
But not this:

Code: Select all

        player.gui.top["auto-trash-toggle-button"].sprite = "technology/character-auto-logistic-trash-slots"



Error while running event level::on_player_joined_game (ID 43)
Unknown sprite "technology/character-logistic-trash-slots"
Bilka
Factorio Staff
Factorio Staff
Posts: 3310
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: [0.16.51] Some vanilla sprite images are 'Unknown'

Post by Bilka »

Moved to modding help. Please stop (ab)using the bug report subforum to get modding help.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
mophydeen
Filter Inserter
Filter Inserter
Posts: 529
Joined: Sun Nov 22, 2015 5:02 pm
Contact:

Re: [0.16.51] Some vanilla sprite images are 'Unknown'

Post by mophydeen »

Bilka wrote: Wed Sep 26, 2018 10:10 pm Moved to modding help. Please stop abusing the bug report subforum to get fast modding help. Moved to modding help.


It's a bug because it won't call it.

There

I've tested 20+ images, with - and _ from achievements , technology etc. They work.

character-logistic-slots, character-auto-logistic-trash-slots and character-logistic-trash-slots don't.
Bilka
Factorio Staff
Factorio Staff
Posts: 3310
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: [0.16.51] Some vanilla sprite images are 'Unknown'

Post by Bilka »

mophydeen wrote: Wed Sep 26, 2018 10:15 pm character-logistic-slots, character-auto-logistic-trash-slots and character-logistic-trash-slots don't.
Nothing of the behavior that you describe is a bug in the game: None of those 3 strings are names of vanilla technologies, so it's correct that it throws an error.

In general, when something does not work in scripting, assume that it's your fault (post in modding help) before assuming it's the game's fault (posting in bug reports).
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
mophydeen
Filter Inserter
Filter Inserter
Posts: 529
Joined: Sun Nov 22, 2015 5:02 pm
Contact:

Re: [0.16.51] Some vanilla sprite images are 'Unknown'

Post by mophydeen »

It's in the same location as files that are called with technology/

Factorio/data/base/graphics/technology/

as such on can expect it works the same.
Bilka
Factorio Staff
Factorio Staff
Posts: 3310
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: [0.16.51] Some vanilla sprite images are 'Unknown'

Post by Bilka »

You are certainly putting too much time into expecting things to work a certain way instead of reading the documentation that states how it works: https://lua-api.factorio.com/latest/Con ... SpritePath
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7352
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: [0.16.51] Some vanilla sprite images are 'Unknown'

Post by bobingabout »

mophydeen wrote: Wed Sep 26, 2018 9:59 pm But not this:

Code: Select all

        player.gui.top["auto-trash-toggle-button"].sprite = "technology/character-auto-logistic-trash-slots"
are you sure it's not supposed to be this?

Code: Select all

        player.gui.top["auto-trash-toggle-button"].sprite = "technology/character-auto-logistic-trash-slots-1"
if I'm right(I might not be, I didn't even look at the game's code), then Bilka is right, and you need modding help, and it's not a game bug.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.
User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5210
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: [0.16.51] Some vanilla sprite images are 'Unknown'

Post by eradicator »

Let's look at the prototypes:

Code: Select all

    type = "technology",
    name = "auto-character-logistic-trash-slots",
    icon_size = 128,
    icon = "__base__/graphics/technology/character-auto-logistic-trash-slots.png",
The file name is "character-auto", but the technology is "auto-character". GUI sprite paths are determined by the name of the prototype, they are not affected by file names.
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.
User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7352
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: [0.16.51] Some vanilla sprite images are 'Unknown'

Post by bobingabout »

bobingabout wrote: Thu Sep 27, 2018 8:42 am if I'm right(I might not be, I didn't even look at the game's code), then Bilka is right, and you need modding help, and it's not a game bug.
eradicator wrote: Thu Sep 27, 2018 10:56 am Let's look at the prototypes:

Code: Select all

    type = "technology",
    name = "auto-character-logistic-trash-slots",
    icon_size = 128,
    icon = "__base__/graphics/technology/character-auto-logistic-trash-slots.png",
The file name is "character-auto", but the technology is "auto-character". GUI sprite paths are determined by the name of the prototype, they are not affected by file names.
I'm wrong and right at the same time, Bilka is right.
should be:

Code: Select all

        player.gui.top["auto-trash-toggle-button"].sprite = "technology/auto-character-logistic-trash-slots"
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.
Post Reply

Return to “Modding help”