Factorio lua does not contain io / how to get image size dim
Posted: Sat Nov 21, 2015 4:11 pm
Hey all,
As you all know, in a resent update the new technology icons where implemented. This sadly broke my mod: https://forums.factorio.com/forum/vie ... 92&t=17219.
Up to now I just assumed all technology icons where 64x64 in size and this worked with all mods. Now with these icons being 128x128 for the base, and most (all) mods still using the old format this doesn't work. Assuming a 128x128 size will throw errors when mods are used and 64x64 will only show a quarter of the new tech icons.
Since the image dimensions are stored in the header of the image, I decided to try something (for me at least) advanced and read the image dimensions from this header. However, every time I try to use io.open(file) I get an error "attempt to index global 'io' (a nil value)".
To me this means the lua code in factorio doesn't contain the io module? Stating require "io" the same way as stating require "defines" doesn't work.
Or perhaps anyone has another idea to find image dimensions?
As you all know, in a resent update the new technology icons where implemented. This sadly broke my mod: https://forums.factorio.com/forum/vie ... 92&t=17219.
Up to now I just assumed all technology icons where 64x64 in size and this worked with all mods. Now with these icons being 128x128 for the base, and most (all) mods still using the old format this doesn't work. Assuming a 128x128 size will throw errors when mods are used and 64x64 will only show a quarter of the new tech icons.
Since the image dimensions are stored in the header of the image, I decided to try something (for me at least) advanced and read the image dimensions from this header. However, every time I try to use io.open(file) I get an error "attempt to index global 'io' (a nil value)".
To me this means the lua code in factorio doesn't contain the io module? Stating require "io" the same way as stating require "defines" doesn't work.
Or perhaps anyone has another idea to find image dimensions?