Frontend

The frontend object is automatically provided by the frontend game environment to script, and provides functionality specific to the frontend. The functions it provides may be called directly on the object in the following form. This interface is part of the UI - as such, the functions it provides may be called after the UICreated event is received.

Example:

frontend.<function_name>(<args>)
Loaded in Campaign Loaded in Campaign
Loaded in Battle Loaded in Battle
Loaded in Frontend Loaded in Frontend
Back to top

Functionality

frontend.start_named_battle(string key)

Starts a named battle specified by key from the battles table.

Parameters:

1

string

key

Returns:

  1. nil

defined in ../../common/UIDll/Source/FrontEnd/FrontendUIScriptInterface.cpp, line 179

frontend.start_campaign(string campaign key, string faction key, string political party key)

Starts the specified campaign, by string key from the campaigns table. A faction key from the factions table and a political party key from political_parties table.

Parameters:

1

string

campaign key

2

string

faction key

3

string

political party key

Returns:

  1. nil

defined in ../../common/UIDll/Source/FrontEnd/FrontendUIScriptInterface.cpp, line 197

frontend.load_campaign(string file path, [boolean from cloud])

Loads a campaign save file by name.

Parameters:

1

string

file path

2

boolean

optional, default value=false

from cloud

Returns:

  1. nil

defined in ../../common/UIDll/Source/FrontEnd/FrontendUIScriptInterface.cpp, line 220

frontend.continue_campaign([boolean from cloud])

Loads the most recently saved campaign game.

Parameters:

1

boolean

optional, default value=false

from cloud

Returns:

  1. nil

defined in ../../common/UIDll/Source/FrontEnd/FrontendUIScriptInterface.cpp, line 246

frontend.campaign_saves_exist()

Returns whether any singleplayer campaign save files exists.

Returns:

  1. boolean saves exist

defined in ../../common/UIDll/Source/FrontEnd/FrontendUIScriptInterface.cpp, line 269

frontend.campaign_saves_exist_mp()

Returns whether any multiplayer campaign save files exists.

Returns:

  1. boolean saves exist

defined in ../../common/UIDll/Source/FrontEnd/FrontendUIScriptInterface.cpp, line 283

frontend.register_scripted_startup_movie(string movie key)

Registers a startup movie to be played prior to the main menu being displayed. Any movie/movies registered using this command will be shown after the corporate movies.

Parameters:

1

string

Path/key of movie to play. This should be the path to the movie file from data/movies, minus the .ca_vp8 file extension, and an entry for the specified movie should exist in the videos table.

Returns:

  1. nil

defined in ../../common/UIDll/Source/FrontEnd/FrontendUIScriptInterface.cpp, line 297

Last updated 12/08/2022 11:56:59