New method VP_GetScenario() (1147.10)

All discussions & material related to Command's Lua interface

Moderators: RoryAndersonCDT, michaelm75au, angster, MOD_Command

Post Reply
User avatar
michaelm75au
Posts: 12464
Joined: Sat May 05, 2001 8:00 am
Location: Melbourne, Australia

New method VP_GetScenario() (1147.10)

Post by michaelm75au »

Here are the details on this new method (Command Lua to be updated yet)
Method:

VP_GetScenario()
Exposes current scenario information.

Returns Scenario (wrapper)

Wrapper:
Scenario

Details of the current scenario
Note the mixed case of the field names

Fields:
FileName string Name of the scenario file (.scen/.save)
Title string Title
ScenSetting string The setting of the scenario
ScenDate number Year of setting
Difficulty number Difficulty rating
Complexity number Complexity rating
StartTime datetime Starting time
Duration time Length of scenario as days:hours:minutes:seconds
CurrentTime datetime Current scenario time
DBUsed string Name of database being used
SaveVersion string Game version last saved under
CampaignScore number Current campaign score
CampaignSessionID string Current campaign session id
CampaignID string Campaign guid
InCampaignMode boolean Currently in standalone or campaign mode
StartTimeNum number Starting time as a number (of seconds) equivalent
DurationNum time Length of scenario as a number (of seconds) equivalent
CurrentTime datetime Current scenario time as a number (of seconds) equivalent
guid string Scenario GUID
PlayerSide string Current player GUID
HasStarted boolean Scenario in play
TimeCompression number Compression mode
Sides number Number of sides in scenario
Michael
KnightHawk75
Posts: 1850
Joined: Thu Nov 15, 2018 7:24 pm

RE: New method VP_GetScenario() (1147.10)

Post by KnightHawk75 »

Thank you for this addition, very helpful.

Also, is this 1147.10, or in a forthcoming update?
User avatar
michaelm75au
Posts: 12464
Joined: Sat May 05, 2001 8:00 am
Location: Melbourne, Australia

RE: New method VP_GetScenario() (1147.10)

Post by michaelm75au »

* Added: [Lua] VP_GetScenario method (Exposes some scenario data such as duration, start time, complexity & difficulty, DB file used etc)

in 1147.10
Michael
tiag
Posts: 131
Joined: Thu Jun 21, 2018 8:33 am

RE: New method VP_GetScenario() (1147.10)

Post by tiag »

Thank you, Michael. This is what was missing for the AI to adapt tactics depending on the scenario.
Post Reply

Return to “Lua Legion”