Checking if a file exists or is installed

Place to get help with not working mods / modding interface.
Post Reply
User avatar
DRY411S
Filter Inserter
Filter Inserter
Posts: 727
Joined: Sun Mar 13, 2016 9:48 am
Contact:

Checking if a file exists or is installed

Post by DRY411S »

I want to assign an icon to an item-group that I am creating dynamically in my code.

The logic is this:

Current item-group icon is __modname__/...
Do I have an icon for this mod in my mods graphics folder? It would be __mymod__/modname/...
If I do, use it otherwise use a default.

I want to check for the icon by seeing if the file exists.

Is there a way I can do this that would work on all Factorio platforms that use different filesystems? Windows, Mac, steam machines, Linux...

Post Reply

Return to “Modding help”