Game module

Module for retrieving game version and level tables.

Structures

  • trx.game.Level

    Represents a level entry.

    Properties:

    • num: Integer ordinal number of the level.
    • name: String title of the level.
    • path: String file path of the level data.
    • type: Integer type identifier of the level.
  • trx.game.Settings

    Represents global engine settings.

    Properties:

    • lockout_option_ring: Whether to disallow the player from using the option ring in-game.
    • load_save_disabled: Whether to disable saving and loading the game.
    • play_any_level: Whether to show a full list of all levels in place of the New Game passport page.
    • demo_delay: The number of seconds to pass in the main menu before playing the demo.
    • cheat_keys: Whether to enable original game cheats (the ones where Lara turns around three times).

    Writable properties:

    • lockout_option_ring
    • load_save_disabled
    • play_any_level
    • demo_delay
    • cheat_keys

Functions

  • trx.game.version

    Returns the current game version integer. This is guessed from the level data.

  • trx.game.trx_version

    Returns the current TRX version string.

  • trx.game.current_level

    Retrieves the
    trx.game.Level
    that's currently loaded or nil.

  • #trx.game.settings

    Accesses the global engine settings.

  • #trx.game.levels

    #trx.game.demos

    #trx.game.cutscenes

    Returns the number of levels of the specific type.

  • trx.game.levels[num]

    trx.game.demos[num]

    trx.game.cutscenes[num]

    Retrieves the
    trx.game.Level
    of the specific type at the given index, or nil if out of range.

  • trx.game.play_level(num)

    Plays the specified level via game flow override or errors if invalid. If the Gym level is available, it's the level 1.

  • trx.game.play_cutscene(num)

    Plays the specified cutscene via game flow override or errors if invalid.

  • trx.game.play_demo(num)

    Plays the specified demo via game flow override or errors if invalid.