Skip to content

Add prevalidated portable flag script commands - #109

Closed
Roxas2712 wants to merge 22 commits into
UNDERdecoded:mainfrom
Roxas2712:codex/portable-script-flags
Closed

Roxas2712 wants to merge 22 commits into
UNDERdecoded:mainfrom
Roxas2712:codex/portable-script-flags

Conversation

@Roxas2712

@Roxas2712 Roxas2712 commented Oct 22, 2026 •

Copy link
Copy Markdown

Depends on #108 and its API prerequisites; merge those first and rebase before merging. Isolated commit 20fd4f6b0f4cd6c2546a5f447172aebc5f109f85 (focused diff).

Add set_flag/clear_flag/check_flag/wait_flag and setflag/clearflag aliases to the bounded portable script language. Validate and copy all references (including unreachable rows) and check all referenced flag stores before any prefix executes. Reuse #108's private/native addressing, ownership, native storage and Gen3 targeted visibility synchronization.

Flag conditions feed existing conditional jumps. wait_flag yields once, resumes on true or an optional whole 0–36000-frame timeout, and returns its boolean condition result. Omitted timeout waits until signaled/cancelled. Existing foreground ownership, overlay pausing, session invalidation, one-shot completion and runner cleanup remain in force. Resolve the already active world for native flag synchronization without asking the loader to bootstrap Game. Unknown native verbs remain rejected.

Commands and reproduction. Gen1's pinned API does not implement the host's scripts capability-query surface; the identical shared mod uses the common world/queueScript query, with host verb metadata tested separately.

Validation

  • 134/134 targeted flag-program checks: both aliases/branches, late signal, finite/indefinite/zero waits, copied rows, malformed stores/timeouts/references, no prefix effects on refusal, foreign overlay pausing, native flags and stale-session/owner cancellation.
  • Existing 5268/5268 portable dialogue checks remain passing; native flag suite 18,348/18,348 remains passing in the full run.
  • 80 cross-engine comparisons /160 isolated loader runs at clean exact feature head against clean pinned Gen1 79ea62f45fb2ea8f65d081a109431e4eb1bbdb36. Same public-only flag program under both production loaders for Red, Blue, Yellow, Gold, Silver, Crystal, FireRed and Emerald. Uses the actual native condition/runner paths; synthetic world/store fixtures.
  • Full ROM-free run: 83/93 engine, SDK3/3, B30 PASS. All 27 complete FAIL lines match the fresh series baseline exactly, in order.
  • All-PR integration through Map API 3 native flags to version-correct VM storage #108 plus this commit (047de5a2dc37508b98d603aa75fc3b2ee443baac): 88/98 engine, SDK3/3, B30 PASS; same exact baseline failures. All80 comparisons/160runs pass on the clean combined tree.
  • Changed Lua formatting and diff checks pass. No ROM story progression/rendered gameplay equivalence is claimed; already executed native writes are not transactional rollback.

Unchanged failing suites: gate_fingerprint, gate_meta_coverage, quit_thread_shutdown, rebind_capture_bug510, rebind_swap_clear_bug589, soft_reset_bug563, tool_mod_hooks, update_check_tests, update_tests, wide_battle_layout. Full test entry remains nonzero due to those baseline failures.

Hosted CI

Published open/non-draft at the tested head. API 3 contracts and ci currently conclude action_required pending maintainer fork-workflow approval. Hosted CI is not green; validation above ran locally.

# Conflicts:
#	src/mods/Loader.lua
# Conflicts:
#	docs/modding.md
#	src/mods/Loader.lua
#	src/world/WorldAPI.lua
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant