Skip to content

How to Loop Over All FormKeys #168

Answered by Noggog
Noggog asked this question in Q&A
Discussion options

You must be logged in to vote

Mod objects or Major Records contain a ContainedFormLinks property, which returns an enumerable of all the FormKeys they contain.

foreach (var formLink in state.PatchMod.ContainedFormLinks)
{
    // Print entries like
    // 0123456:Skyrim.esm -> IArmorGetter
    System.Console.WriteLine($"{formLink.FormKey} -> ({formLink.Type})");
}

Replies: 1 comment

Comment options

Noggog
Jan 21, 2021
Maintainer Author

You must be logged in to vote
0 replies
Answer selected by Noggog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant