check if graphic for icon usage exists or use "placeholder" graphic
Posted: Mon Nov 05, 2018 1:49 am
How do i check if a graphic file with a given name exists inside a mod or directory in lua for factorio? and if it doesn't, use a different graphics file instead?
something like if "__modname__/graphics/technology/techname.png" exists then tech.icon="__modname__/graphics/technology/techname.png" else tech.icon="__modname__/graphics/technology/nographic.png" end
or:
tech.icon="__modname__/graphics/technology/techname.png" or "__modname__/graphics/technology/nographic.png"
neither seem to work
something like if "__modname__/graphics/technology/techname.png" exists then tech.icon="__modname__/graphics/technology/techname.png" else tech.icon="__modname__/graphics/technology/nographic.png" end
or:
tech.icon="__modname__/graphics/technology/techname.png" or "__modname__/graphics/technology/nographic.png"
neither seem to work