Have is_valid_sprite_path work without a player

Post Reply
User avatar
Therenas
Factorio Staff
Factorio Staff
Posts: 232
Joined: Tue Dec 11, 2018 2:10 pm
Contact:

Have is_valid_sprite_path work without a player

Post by Therenas »

Currently, you can call is_valid_sprite_path on a LuaGui, which means you need to have a reference to a player to be able to call it. In my use case, I'd like to check on_init/on_config_changed if certain entities/items/recipes even have a sprite, and exclude them from a list right away. That way, I won't have to worry about an entity without a sprite in my code down the line.

This is however not possible, as I don't have a player on_init and on_config_changed. I would prefer that you could check for sprites without a player, having it in game would probably be appropriate. Now I don't know exactly how is_valid_sprite_path works, it might require a player that it can check against? Not sure, but I'd like to know if it is possible, and possibly have it changed around, if it is.

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

Re: Have is_valid_sprite_path work without a player

Post by Rseding91 »

Ok.
If you want to get ahold of me I'm almost always on Discord.


Post Reply

Return to “Implemented mod requests”