Command Version from Lua

All discussions & material related to Command's Lua interface

Moderators: RoryAndersonCDT, michaelm75au, angster, MOD_Command

Post Reply
jkgarner
Posts: 175
Joined: Thu Apr 30, 2020 12:42 pm

Command Version from Lua

Post by jkgarner »

Is it possible to determine which version of command is running from Lua?

A change made between
P.E. Student Version 1.14.5.5
and
P.E. Student Version 1.15.2
which breaks my code.
(specifically the directory from which the lua scripts execute.)

As I start pushing out scenarios using my code, I need to be able to
determine which version of the software is running to make my code adaptive, so that it still works across multiple versions.


KnightHawk75
Posts: 1850
Joined: Thu Nov 15, 2018 7:24 pm

RE: Command Version from Lua

Post by KnightHawk75 »

GetBuildNumber() for the x.x.x.x or x.x # I forget which it is.

As for detecting pro.. if io then ... pro... else ...retail... end comes to mind, though I'm hoping some day that changes.
jkgarner
Posts: 175
Joined: Thu Apr 30, 2020 12:42 pm

RE: Command Version from Lua

Post by jkgarner »

In my current version,

Code: Select all

print(GetBuildNumber())
outputs:
v1.15.2

In my previous version,

Code: Select all

print(GetBuildNumber())
outputs:
v1.14.5.5

I can work with this.
Post Reply

Return to “Lua Legion”