Page 1 of 1

[SOLVED][0.18.18] Compatibility with older versions

Posted: Mon Apr 13, 2020 3:18 am
by XaLpHa89
I am able to start multiple servers with the same scenario. The function "game.reset_time_played()" does not yet exist in 0.17.79. I am looking for a variable (script.version, game.version, global.version) with which I can bridge the function. The only variable I found is _VERSION, this is the Lua version, but it doesn't help me.

Re: [0.18.18] Compatibility with older versions

Posted: Mon Apr 13, 2020 8:44 am
by Pi-C
XaLpHa89 wrote: Mon Apr 13, 2020 3:18 am I am able to start multiple servers with the same scenario. The function "game.reset_time_played()" does not yet exist in 0.17.79. I am looking for a variable (script.version, game.version, global.version) with which I can bridge the function. The only variable I found is _VERSION, this is the Lua version, but it doesn't help me.
You have access to the active mods, and considering that the game basically is the base mod, you should be able to get the game version this way:

Code: Select all

local version = game.active_mods["base"]