How a mod can support both factorio 0.16 and 0.17
Posted: Fri Aug 02, 2019 11:57 am
Hello,
I search a way to detect the factorio base version at runtime.
For sample in data.lua
My need is how to get the factorio version string at runtime, during the data.lua step ?
Regards,
I search a way to detect the factorio base version at runtime.
For sample in data.lua
Code: Select all
local factorio_version = "0.16.51" -- HERE: how to get this version string !
local factorio_major_version = factorio_version:sub(1,4)
if factorio_major_version == "0.16" then
data:extend({
...CODE FOR 0.16...
}
elseif factorio_major_version == "0.17" then
data:extend({
...CODE FOR 0.17...
}
else
...RAISE AN ERROR, NOT COMPATIBLE...
end
Regards,