> For the complete documentation index, see [llms.txt](https://botiv.gitbook.io/rdr2/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://botiv.gitbook.io/rdr2/chess-and-checkers-game.md).

# Chess & Checkers Game

<mark style="color:orange;">**This script is compatible with all frameworks.**</mark>

<mark style="color:green;">Here is an excerpt from the config.lua file : (parts of the excerpt are hidden) :</mark>

```lua
Config = {}

-- Enable or disable debug mode
Config.DEBUG = false

-- Key bindings for various actions during the game
Config.Play = keys["U"]         -- Key to play your turn
Config.Moves = keys["E"]        -- Key to show/hide possible moves
Config.Cancel = keys["R"]       -- Key to cancel/leave the game
Config.Yes = keys["RIGHT"]      -- Key to confirm/accept (Right Arrow)
Config.Insult = keys["DOWN"]    -- Key to taunt the opponent (Down Arrow)
Config.No = keys["LEFT"]        -- Key to decline/refuse (Left Arrow)
Config.Camera = keys["C"]       -- Key to switch camera view
Config.Gamemode = keys["G"]     -- Key to switch game mode (Chess/Checkers)

-- Game options
Config.RestartDelay = 20         -- Auto-restart delay (in seconds) after stalemate or checkmate
Config.CanPlayEnemyTurn = true   -- Allow player to play the enemy's turn (useful for solo practice)
Config.ShowPossibleMoves = true  -- Allow showing possible moves on the board

-- Texts displayed in the UI (can be customized or translated)
Config.Txt = {
    Chess = "Chess",
    Play = "Play",
    Cancel = "Leave",
    ShowMoves = "Show/Hide Moves",
    Promotion = "Promotion",
    PromotionSub = "Select a piece",
    MatchNul = "Draw",
    RepeatPos = "Position repeated three times",
    NoLegalMoves = "No legal move available",
    Checkmate = "Checkmate!",
    White = "white",
    Black = "black",
    WinColor = "%s wins!",   -- %s will be replaced with "white" or "black"
    Insult = "Taunt",
    Yes = "Yes!",
    No = "No!",
    Camera = "Camera",
    CheckerEnd = "Finish!",
    GameModeChess = "Chess",
    GameModeCheckers = "Checkers"
}

-- Chess board positions (world coordinates)
Config.ChessGames = {
    -- hidden
}

-- Camera angles for each chess game
Config.CameraAngles = {
  -- hidden
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://botiv.gitbook.io/rdr2/chess-and-checkers-game.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
