Page 1 of 1
Change image/filename rendered by "utility-sprites" during runtime?
Posted: Tue Mar 05, 2019 2:53 pm
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?
Re: Change image/filename rendered by "utility-sprites" during runtime?
Posted: Tue Mar 05, 2019 3:02 pm
by Bilka
You cannot change this runtime, do it in the data stage.
Re: Change image/filename rendered by "utility-sprites" during runtime?
Posted: Tue Mar 05, 2019 3:07 pm
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?
Re: Change image/filename rendered by "utility-sprites" during runtime?
Posted: Tue Mar 05, 2019 3:22 pm
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.
Re: Change image/filename rendered by "utility-sprites" during runtime?
Posted: Tue Mar 05, 2019 3:29 pm
by repkid
In that case I'll make a seperate mod for each type of colour blindness. Thanks for the help.
Re: Change image/filename rendered by "utility-sprites" during runtime?
Posted: Tue Mar 05, 2019 4:12 pm
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.