Skip to content

Rework FormExtraData - #278

Merged
korri123 merged 16 commits into
xNVSE:masterfrom
WallSoGB:FormExtraDataUpdate
Sep 4, 2026
Merged

korri123 merged 16 commits into
xNVSE:masterfrom
WallSoGB:FormExtraDataUpdate

Conversation

@WallSoGB

@WallSoGB WallSoGB commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Sigh, a deliberate ABI change due to design flaws of the previous one.
Changes:

  • The ExtraData system is now available in GECK
  • ExtraData is now versioned, through virtual getters
  • ExtraData now has reserved space and virtual methods, for possible future use
  • ExtraData name is now a virtual getter, instead of being a member variable, in order to not increase class size due to above change
  • Map removal now issues events, to let the ExtraData know it has been removed, and why. The events are:
    • Manual removal (directly through NVSE's API)
    • Form deletion (triggered by TESForm's destructor)
    • Reference's insertion into the garbage collector (game considers this as equal to form deletion, so for the sake of FormID lifespan consistency, so do we)

The new ExtraData implementation is handled by new, tweaked variants of previous functions.
Backwards compatibility with previous ExtraData is maintained by using a separate map and functions. The separation is deliberate, in order to not leave NVSE plugins guessing if the ExtraData they found is using the old or new standard. The old class declaration has been moved into the LegacyFormExtraData.h file.

Changes to the class and enum names make an accidental upgrade not possible, requiring an explicit intervention when updating NVSE headers.

@korri123
korri123 merged commit 05f6d4f into xNVSE:master Sep 4, 2026
1 check passed
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.

2 participants