Skip to content
Bartholomew Ho edited this page Nov 9, 2026 · 1 revision

Why OnInit and not Sub New?

The SDK makes your class first, and only then registers it with the platform under the name in Info. Until that's done, your mod has no name, no log and no settings, so in Sub New (a constructor) Log, AddSetting and the like have nothing to attach to.

OnInit runs right after registration, when all of that works. Hosted mods also get a fresh copy for each reload, and OnInit runs on each one with IsReload telling you which it is.

Keep the constructor empty, or don't write one.

Do I need to know reverse engineering?

No. The FH2 classes do the hooks and memory for you. GameCode, HookFunction and PatchBytes are there for when you want to go further.

C# or VB.NET?

Whichever you know. Both build hosted and NativeAOT mods, and use the same classes. VB can't write some low-level things (pointers, function pointers), so its hooks take delegates instead. See Your first mod in VB.

Can I use NuGet packages?

Yes, in a project. Hosted mods get any package. NativeAOT mods get packages that work with NativeAOT. Scripts can't use packages.

Does it work online?

Set OfflineOnly = true in your ModInfo and the mod is held back while you play online. Platform.NET does this per hosted mod, so other hosted mods keep running.

Do my players need .NET?

For a NativeAOT build, no: just the platform. For a hosted mod or a script, they need the .NET 10 runtime (x64) and Platform.NET. See Hosted or NativeAOT?.

Can I convert a C++ platform mod?

Yes. Everything in fh2mod.h is on Mod and ModPlatform, one method per function, so the platform's own docs apply as written. Most of a mod's hooks and memory reads can usually be replaced by the FH2 classes.

Where do I report bugs?

Issues, with your platform.log and what you were doing.

Clone this wiki locally