Skip to content

feat(lua): add pocket dimension travel bindings#8363

Draft
scarf005 wants to merge 2 commits intocataclysmbn:mainfrom
scarf005:fix/pocket-dimension-lua-api
Draft

feat(lua): add pocket dimension travel bindings#8363
scarf005 wants to merge 2 commits intocataclysmbn:mainfrom
scarf005:fix/pocket-dimension-lua-api

Conversation

@scarf005
Copy link
Copy Markdown
Member

@scarf005 scarf005 commented Mar 23, 2026

Purpose of change (The Why)

Sky Island needs Lua-visible dimension helpers to move its home island into a pocket dimension without reimplementing engine-side travel logic.

Describe the solution (The How)

  • add gapi.get_current_dimension_id() and gapi.place_player_dimension_at( { ... } )
  • add Map:get_bound_dimension() and Map:is_out_of_bounds()
  • document example usage in the Lua cookbook in English, Korean, and Japanese

Example:

local entered = gapi.place_player_dimension_at({
  dimension_id = "sky_island_home",
  target_omt = Tripoint.new(0, 0, 0),
  world_type = "pocket_dimension",
  bounds_min_omt = Tripoint.new(-2, -2, 0),
  bounds_max_omt = Tripoint.new(2, 2, 0),
})

Testing

  • cmake --build --preset linux-full --target astyle
  • cmake --build --preset linux-full --target cataclysm-bn-tiles cata_test-tiles
  • ./out/build/linux-full/tests/cata_test-tiles "[lua]"
  • deno fmt docs/en/mod/lua/guides/cookbook.md docs/ko/mod/lua/guides/cookbook.md docs/ja/mod/lua/guides/cookbook.md

Checklist

Mandatory

Optional

  • This is a C++ PR that modifies JSON loading or behavior.
    • I have documented the changes in the appropriate location in the docs/ folder.
  • This is a PR that modifies lua scripts or the lua API.

Co-authored-by: chatgpt-codex-connector[bot] <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com>\nAssisted-by: openai/gpt-5.4 on opencode
@github-actions github-actions bot added src changes related to source code. tests changes related to tests lua PRs and issues related to Lua scripting labels Mar 23, 2026
Co-authored-by: chatgpt-codex-connector[bot] <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com>\nAssisted-by: openai/gpt-5.4 on opencode
@github-actions github-actions bot added the docs PRs releated to docs page label Mar 23, 2026
@scarf005 scarf005 marked this pull request as draft March 23, 2026 03:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs PRs releated to docs page lua PRs and issues related to Lua scripting src changes related to source code. tests changes related to tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant