Repository navigation
FAQ
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.
No. The FH2 classes do the hooks and memory for you. GameCode, HookFunction and PatchBytes are there for when you want to go further.
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.
Yes, in a project. Hosted mods get any package. NativeAOT mods get packages that work with NativeAOT. Scripts can't use packages.
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.
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?.
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.
Issues, with your platform.log and what you were doing.
Playing
Getting started
Writing mods
The FH2 classes
- Game
- Player
- Vehicle
- World
- Garage, CarCatalog, Profile
- UI and Hud
- Camera
- Audio
- ANNA
- Skills
- DebugOverlay
- Controller
- GameInput
- GameWindow
- Menus and UiElement
- SettingsTile
- ButtonIcons and Picture
- MapView, PhotoCamera, GarageCamera
More