GetGameSnapshot Function #

Function Signature:

GetGameSnapshot()

Description: Retrieves the current game state snapshot, including details about both the player and the enemy. The snapshot provides information on the player's and enemy's states, the current frame count, and facing direction.

Returns:

  • GameSnapshot: A table containing the following fields:
    • self: The player's current state (of type PlayerSnapshot).
    • enemy: The enemy's current state (of type PlayerSnapshot).
    • frame_count: The current frame count of the game.
    • facing_bool: Boolean indicating the facing direction of the player.

GameSnapshot Structure:

  • self: (Type: PlayerSnapshot) The current state of the player.
  • enemy: (Type: PlayerSnapshot) The current state of the enemy.
  • frame_count: (Type: Integer) The total number of frames elapsed in the game.
  • facing_bool: (Type: Integer) Indicates the direction the player is facing. Typically 0 for one direction and 1 for the opposite.

PlayerSnapshot Structure:

Represents the snapshot of a player's current state and attributes.

  • move_timer: (Type: Integer) Timer for the current move.
  • move_id: (Type: Integer) Identifier for the current move.
  • simple_state: (Type: Integer) Simple state of the player.
  • attack_type: (Type: Integer) Type of attack currently used.
  • startup: (Type: Integer) Startup time of the current move.
  • startup_end: (Type: Integer) End time of the startup phase.
  • attack_damage: (Type: Integer) Damage dealt by the current attack.
  • complex_state: (Type: Integer) Complex state of the player.
  • damage_taken: (Type: Integer) Amount of damage taken.
  • recovery: (Type: Integer) Recovery time after the move.
  • frames_til_next_move: (Type: Integer) Frames until the next move.
  • char_id: (Type: Integer) Identifier for the character.
  • distance: (Type: Float) Distance from the enemy.
  • jump_flag: (Type: Integer) Flag indicating if the player is jumping.
  • throw_tech: (Type: Integer) Throwing technique used.
  • input_direction: (Type: Integer) Direction of input.
  • input_attack: (Type: Integer) Attack input.
  • stun_state: (Type: Integer) Stun state of the player.
  • hit_outcome: (Type: Integer) Outcome of the hit.
  • facing: (Type: Integer) Direction the player is facing.

Usage Example:

local gameSnapshot = GetGameSnapshot()

-- Access player and enemy states
local playerState = gameSnapshot.self
local enemyState = gameSnapshot.enemy

-- Access frame count and facing direction
local currentFrameCount = gameSnapshot.frame_count
local facingDirection = gameSnapshot.facing_bool

-- Example of using player state information
print("Player Move ID: " .. playerState.move_id)
print("Enemy Distance: " .. enemyState.distance)

Notes:

  • Use GetGameSnapshot() to get the latest information about the game state, which is useful for making decisions based on current player and enemy conditions.
  • The facing_bool field provides a quick way to check the player's facing direction, which can be useful for directional decisions in your script.

Feel free to adjust or add more details to the documentation as needed!