Change image/filename rendered by "utility-sprites" during runtime?

Place to get help with not working mods / modding interface.
User avatar
repkid
Burner Inserter
Burner Inserter
Posts: 7
Joined: Sun Mar 03, 2019 1:22 pm
Contact:

Change image/filename rendered by "utility-sprites" during runtime?

Post by repkid »

I am trying to make a mod for visually impaired people and the first thing I'd thought to work on is changing the colour of pollution on the map screen. The filename of the pollution overlay can be set like so:

Code: Select all

 data.raw["utility-sprites"]["default"]["pollution-visualization"].filename = ".../filename.png" 
I'd like to be able to change to a different file or change the tint on the current one during runtime but can't seem to find any examples of this. Does anybody know?
Bilka
Factorio Staff
Factorio Staff
Posts: 3310
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: Change image/filename rendered by "utility-sprites" during runtime?

Post by Bilka »

You cannot change this runtime, do it in the data stage.
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
repkid
Burner Inserter
Burner Inserter
Posts: 7
Joined: Sun Mar 03, 2019 1:22 pm
Contact:

Re: Change image/filename rendered by "utility-sprites" during runtime?

Post by repkid »

Thanks for the quick reply! I'd like to set this as a "runtime-per-user" setting so that people can have seperate choices on the same server, do you know how to access these during the data stage?
Bilka
Factorio Staff
Factorio Staff
Posts: 3310
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: Change image/filename rendered by "utility-sprites" during runtime?

Post by Bilka »

repkid wrote: Tue Mar 05, 2019 3:07 pm Thanks for the quick reply! I'd like to set this as a "runtime-per-user" setting so that people can have seperate choices on the same server, do you know how to access these during the data stage?
They are not accessible. What you are trying to do is not possible.
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
repkid
Burner Inserter
Burner Inserter
Posts: 7
Joined: Sun Mar 03, 2019 1:22 pm
Contact:

Re: Change image/filename rendered by "utility-sprites" during runtime?

Post by repkid »

In that case I'll make a seperate mod for each type of colour blindness. Thanks for the help.
User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2905
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: Change image/filename rendered by "utility-sprites" during runtime?

Post by darkfrei »

Bilka wrote: Tue Mar 05, 2019 3:02 pm You cannot change this runtime, do it in the data stage.
https://lua-api.factorio.com/latest/Lua ... raw_sprite
sprite :: SpritePath
SpritePath
It is specified by string. It can be either the name of the sprite prototype defined in the data or path in form "type/name". Supported types are.
"item" - for example "item/iron-plate" is the icon sprite of iron plate
"entity" - for example "entity/small-biter" is the icon sprite of the small biter
"technology"
"recipe"
"item-group"
"fluid"
"tile"
"virtual-signal"
"achievement"
"equipment"
"file" - path to an image file located inside the current scenario. This file is not preloaded so it will be slower; for frequently used sprites, it is better to define sprite prototype and use it instead.
"utility" - sprite defined in the utility-sprites object, these are the pictures used by the game internally for the UI.
Post Reply

Return to “Modding help”