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,