Repository navigation
Write the perk effect function parameters Mutagen reads - #718
Open
WhiskyTangoFawks wants to merge 4 commits into
Open
WhiskyTangoFawks wants to merge 4 commits into
WhiskyTangoFawks wants to merge 4 commits into
Conversation
xEdit defines EPFB, EPF2 and EPF3 as function parameters any perk effect can carry, and Mutagen reads them onto every effect. Its writers wrote EPFB only for an entry point and EPF2 and EPF3 only for an activate choice, so a rewrite dropped them from any other effect. A Fallout 4 Add Activate Choice entry point that left out EPF3 also threw on read, though APerkEffect.Flags is already nullable, and its writer threw on a null Flags. - Fallout 4 and Starfield write each of the three for any effect that holds it. An activate choice without EPF3 reads as null Flags, from a full import and from an overlay, and a choice with null Flags writes no EPF3 rather than throwing. - Skyrim writes EPF2 for any effect that holds it. Its Flags is a non-nullable PerkScriptFlag, so the model cannot say whether an effect had EPF3, and EPF3 stays written for an activate choice alone. Skyrim already took EPF3 as optional on read. - The activate choice's own ButtonLabel and Flags initialisers go: the code after the switch assigns both for every effect. - EPFT and EPFD on a quest or ability effect are still read and discarded. Fallout 4's masters and a 500-plugin Fallout 4 load order carry neither. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Fallout 4, Skyrim and Starfield tests build the perk effects through the API, write the mod to the test file system and reread it, in place of hand-assembled bytes and the copied parse and write helpers. The perk writers test for an entry point effect once: the shared EPFB, EPF2 and EPF3 writes move into one method, called between an entry point's EPFT and EPFD and on its own for every other effect. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
WhiskyTangoFawks
force-pushed
the
fix/perk-entry-point-function-parameters
branch
from
October 24, 2026 14:56
20603d3 to
824fc1f
Compare
Noggog
approved these changes
Oct 30, 2026
Noggog
left a comment
Member
There was a problem hiding this comment.
Making it nullable, as in Fallout 4 and Starfield, would close that, at the cost of an API change. Happy to do that here or separately if you'd like.
These types of API changes are acceptable within reason. Throw em in. In my view they're in a separate category than API changes to say, ILinkCache. Record definitions will always be evolving over time, realistically. Nature of this specific beast
Skyrim's APerkEffect.Flags was a non-nullable PerkScriptFlag, so the model could not say whether an effect held EPF3, and the writer wrote it for an activate choice alone. A rewrite dropped EPF3 from any other effect, and gave an activate choice without one an all-zero EPF3. Flags is now nullable, as in Fallout 4 and Starfield, as review agreed. It holds a value exactly when EPF3 is present, and EPF3 is written after EPF2 for any effect that holds it, in xEdit's order. APerkEffect_Generated.cs is the Skyrim generator's output. Breaking: IAPerkEffectGetter.Flags is IPerkScriptFlagGetter?, and a new effect has no Flags. Built by CI rather than locally. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The activate choice is the one Skyrim effect whose EPF3 behaviour changed: a choice without Flags now writes no EPF3 where it wrote an all-zero one. Fallout 4 and Starfield already test both cases. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
Done: Skyrim's |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
xEdit defines EPFB, EPF2 and EPF3 as function parameters any perk effect can carry, and Mutagen reads them onto every effect. Its writers wrote EPFB only for an entry point and EPF2 and EPF3 only for an activate choice, so a rewrite dropped them from any other effect. Separately, a Fallout 4 Add Activate Choice entry point with no EPF3 (e.g. FTS_FastTravelSettlement.esp) threw on read, though
APerkEffect.Flagsis already nullable, and its writer threw on a nullFlags.Flags, from a full import and from an overlay, and nullFlagswrites no EPF3.APerkEffect.Flagsis now nullable, as in Fallout 4 and Starfield, and holds a value exactly when EPF3 is present.ButtonLabelandFlagsinitialisers go; the code after the switch already assigns both for every effect.Breaking: Skyrim's
IAPerkEffectGetter.FlagsisIPerkScriptFlagGetter?, and a new Skyrim effect has noFlags.Behaviour change for code-built records: an effect of any kind that sets
PerkEntryID,ButtonLabelorFlagsnow writes them, where before they were dropped. An activate choice with nullFlagswrites no EPF3, where before Fallout 4 and Starfield threw and Skyrim wrote an all-zero EPF3.Still read and discarded, unchanged: EPFT and EPFD on a quest or ability effect. Fallout 4's masters and a 500-plugin Fallout 4 load order carry neither.
PerkFunctionParametersTestscovers, for Fallout 4 and Starfield, an ability carrying the parameters and an activate choice with and without EPF3, by full import, overlay, and write then reread through the other path. For Skyrim, whose full import and overlay share one effect parser, it covers an ability with a button label, and an ability and an activate choice with and without EPF3, by write then reread.