# Table `Flow`

Functions that (mostly) don't directly impact in-game mechanics.

Used for setup in gameflow.lua, settings.lua and strings.lua; some can be used in level scripts too.

## gameflow.lua

AddLevel(level) | Add a level to the Flow.
SetIntroImagePath(path) | Image to show when loading the game.
SetTitleScreenImagePath(path) | Image to show in the background of the title screen.
EnableLaraInTitle(enabled) | Enable or disable Lara drawing in title flyby.
EnableLevelSelect(enabled) | Enable or disable level selection in title flyby.
EnableHomeLevel(enabled) | Enable or disable Home Level entry in the main menu.
EnableLoadSave(enabled) | Enable or disable saving and loading of savegames.

## gameflow.lua or level scripts

EnableFlyCheat(enabled) | Enable or disable the fly cheat.
EnablePointFilter(enabled) | Enable or disable point texture filter.
EnableMassPickup(enabled) | Enable or disable mass pickup.
GetLevel(index) | Returns the level by index.
GetCurrentLevel() | Returns the level that the game control is running in that moment.
EndLevel([index][, startPos]) | Finishes the current level, with optional level index and start position index provided.
GetStatistics(game) | Get game or level statistics.
SetStatistics(statistics, game) | Set game or level statistics.
GetGameStatus() | Get current game status, such as normal game loop, exiting to title, etc.
GetFreezeMode() | Get current freeze mode, such as none, full, spectator or player.
SetFreezeMode(freezeMode) | Set current freeze mode, such as none, full, spectator or player.
SaveGame(slotID) | Save the game to a savegame slot.
LoadGame(slotID) | Load the game from a savegame slot.
DeleteSaveGame(slotID) | Delete a savegame.
DoesSaveGameExist(slotID) | Check if a savegame exists.
GetSecretCount() | Returns the player's current per-game secret count.
SetSecretCount(count) | Sets the player's current per-game secret count.
AddSecret(index) | Adds one secret to current level secret count and also plays secret music track.
SetTotalSecretCount(total) | Total number of secrets in game.
FlipMap(flipmap) | Do FlipMap with specific group ID.
GetFlipMapStatus([index]) | Get current FlipMap status for specific group ID.

## settings.lua

SetSettings(settings) | Set provided settings table to an engine.
GetSettings() | Get settings table from an engine.

## strings.lua

SetStrings(table) | Set string variable keys and their translations.
GetString(string) | Get translated string.
IsStringPresent(string) | Check if translated string is present.
SetLanguageNames(table) | Set language names for translations.

## gameflow.lua

These functions are called in gameflow.lua, a file loosely equivalent to winroomedit's SCRIPT.DAT. They handle a game's 'metadata'; i.e., things such as level titles, loading screen paths, and default ambient tracks.

AddLevel(level)
  Add a level to the Flow.

  ### Parameters:

  - level Level a level object
SetIntroImagePath(path)
  Image to show when loading the game. Must be a .jpg or .png image.

  ### Parameters:

  - path string the path to the image, relative to the TombEngine exe
SetTitleScreenImagePath(path)
  Image to show in the background of the title screen. Must be a .jpg or .png image. (not yet implemented)

  ### Parameters:

  - path string the path to the image, relative to the TombEngine exe
EnableLaraInTitle(enabled)
  Enable or disable Lara drawing in title flyby. Must be true or false

  ### Parameters:

  - enabled bool true or false
EnableLevelSelect(enabled)
  Enable or disable level selection in title flyby. Must be true or false

  ### Parameters:

  - enabled bool true or false
EnableHomeLevel(enabled)
  Enable or disable Home Level entry in the main menu. ()

  ### Parameters:

  - enabled bool True or false.
EnableLoadSave(enabled)
  Enable or disable saving and loading of savegames. ()

  ### Parameters:

  - enabled bool True or false.

## gameflow.lua or level scripts

EnableFlyCheat(enabled)
  Enable or disable the fly cheat. ()

  ### Parameters:

  - enabled bool True or false.
EnablePointFilter(enabled)
  Enable or disable point texture filter. Must be true or false

  ### Parameters:

  - enabled bool true or false
EnableMassPickup(enabled)
  Enable or disable mass pickup. Must be true or false

  ### Parameters:

  - enabled bool true or false
GetLevel(index)
  Returns the level by index. Indices depend on the order in which AddLevel was called; the first added will have an ID of 0, the second an ID of 1, and so on.

  ### Parameters:

  - index int of the level

  ### Returns:

  Level the level indicated by the id
GetCurrentLevel()
  Returns the level that the game control is running in that moment.

  ### Returns:

  Level the current level
EndLevel([index][, startPos])
  Finishes the current level, with optional level index and start position index provided. If level index is not provided or is zero, jumps to next level. If level index is more than level count, jumps to title. If LARA_START_POS objects are present in level, player will be teleported to such object with OCB similar to provided second argument.

  ### Parameters:

  - index int level index (default 0) (optional)
  - startPos int player start position (default 0) (optional)
GetStatistics(game)
  Get game or level statistics. For reference about statistics class, see Flow.Statistics.

  ### Parameters:

  - game bool if true, returns overall game statistics, otherwise returns current level statistics (default: false)

  ### Returns:

  Statistics statistics structure representing game or level statistics
SetStatistics(statistics, game)
  Set game or level statistics. For reference about statistics class, see Flow.Statistics.

  ### Parameters:

  - statistics Statistics statistic object to set
  - game bool if true, sets overall game statistics, otherwise sets current level statistics (default: false)
GetGameStatus()
  Get current game status, such as normal game loop, exiting to title, etc.

  ### Returns:

  GameStatus the current game status
GetFreezeMode()
  Get current freeze mode, such as none, full, spectator or player.

  ### Returns:

  FreezeMode the current freeze mode
SetFreezeMode(freezeMode)
  Set current freeze mode, such as none, full, spectator or player.
  Freeze mode specifies whether game is in normal mode or paused in a particular way to allow custom menu creation, photo mode or time freeze.

  ### Parameters:

  - freezeMode FreezeMode new freeze mode to set.
SaveGame(slotID)
  Save the game to a savegame slot.

  ### Parameters:

  - slotID int ID of the savegame slot to save to.
LoadGame(slotID)
  Load the game from a savegame slot.

  ### Parameters:

  - slotID int ID of the savegame slot to load from.
DeleteSaveGame(slotID)
  Delete a savegame.

  ### Parameters:

  - slotID int ID of the savegame slot to clear.
DoesSaveGameExist(slotID)
  Check if a savegame exists.

  ### Parameters:

  - slotID int ID of the savegame slot to check.

  ### Returns:

  bool true if the savegame exists, false if not.
GetSecretCount()
  Returns the player's current per-game secret count.

  ### Returns:

  int Current game secret count.
SetSecretCount(count)
  Sets the player's current per-game secret count.

  ### Parameters:

  - count int new secret count.
AddSecret(index)
  Adds one secret to current level secret count and also plays secret music track. The index argument corresponds to the secret's unique ID, the same that would go in a secret trigger's Param.

  ### Parameters:

  - index int an index of current level's secret (must be from 0 to 31).
SetTotalSecretCount(total)
  Total number of secrets in game. Must be an integer value (0 means no secrets).

  ### Parameters:

  - total int number of secrets
FlipMap(flipmap)
  Do FlipMap with specific group ID.

  ### Parameters:

  - flipmap int (ID of flipmap group to actuvate / deactivate)
GetFlipMapStatus([index])
  Get current FlipMap status for specific group ID.

  ### Parameters:

  - index int Flipmap group ID to check. If no group specified or group is -1, function returns overall flipmap status (on or off). (optional)

  ### Returns:

  int Status of the flipmap group (true means on, false means off).

## settings.lua

These functions are called in settings.lua, a file which holds global settings, such as system settings, flare color or animation movesets.

SetSettings(settings)
  Set provided settings table to an engine.

  ### Parameters:

  - settings Settings a settings table
GetSettings()
  Get settings table from an engine.

  ### Returns:

  Settings current settings table

## strings.lua

These functions used in strings.lua, which is generated by TombIDE. You will not need to call them manually.

SetStrings(table)
  Set string variable keys and their translations.

  ### Parameters:

  - table tab array-style table with strings
GetString(string)
  Get translated string.

  ### Parameters:

  - string key key for translated string
IsStringPresent(string)
  Check if translated string is present.

  ### Parameters:

  - string key key for translated string
SetLanguageNames(table)
  Set language names for translations. Specify which translations in the strings table correspond to which languages.

  ### Parameters:

  - table tab array-style table with language names

generated by TEN-LDoc (a fork of LDoc 1.4.6)