镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

VCS Global Variables Space is not Homogeneous #397

Open

Description

@x87

VCS Script

The same global variable indices (e.g. $5335) appear in different missions as different arrays. The arrays even have different sizes (e.g. $5335(0@,3) vs $5335(0@,100))
This contradicts the expectation that global variables are:

  • Uniquely assigned
  • Immutable in layout across the entire script

Reason

The SCM defines a boundary via:

"trueGlobals": 5330

This splits variables into two categories:

  • $2 … $5331 → true globals (unique, persistent)
  • $5332+ → reusable scratch variables

Scratch Variables:

  • Are not uniquely assigned per mission
  • Act as a shared memory region
  • Can be reinterpreted differently by each mission
  • Allow overlapping arrays with different sizes and purposes

Activity

  1. x87 commented on Apr 16, 2026

    @x87
    CollaboratorAuthor

    This affects how the disassembler outputs global variables falling within the "shared" global space, oftentimes with nonsensical indexes.

    {278887} $5332[0] = -973.8
    {278896} $5332[1] = -1104.73
    {278905} $5334[0] = 14.87
    {278914} $5334[1] = 0
    
  2. x87 commented on Apr 24, 2026

    @x87
    CollaboratorAuthor

    Same is true for LCS

  3. CookiePLMonster commented on May 5, 2026

    @CookiePLMonster

    If that's relevant for the disassembler, these variables are also zeroed when missions start. Conceptually they're identical to SA mission locals, just living inside the scratch space inside the main block.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions