-
Notifications
You must be signed in to change notification settings - Fork 5
Basics
The first steps in implementing the AtomicFramework in a mod is writing the Plugin class many mods have.
Instead of extending BaseUnityPlugin, however, you extend Mod from the AtomicFramework namespace.
Mod automatically adds some of the helpful BepInEx attributes, however, you must still add BepInPlugin.
In order for AtomicFramework to ensure your mod is handled properly, the Mod class takes in a Mod.Options struct in its constructor.
The struct has sane defaults, but these defaults are potentially restrictive.
AtomicFramework supports disabling mods, and is forwards compatible with reloading mods.
Due to the unimplemented nature of reloading, do not support this to prevent potential unforeseen incompatibilities.
To enable disabling, set Mod.Options.runtimeOptions to Mod.Options.Runtime.TOGGLEABLE.
AtomicFramework automatically negotiates mod lists between servers and clients.
Currently the default is REQUIRES_HOST which requires the host have the mod.
To support client side only mods, change Mod.Options.multiplayerOptions to Mod.Options.Multiplayer.CLIENT_ONLY.
Options SERVER_ONLY and CLIENT_ONLY are not currently implemented.
The repository (default empty) allows AtomicFramework to automatically update your mod.
To do so after the game has launched requires the unimplemented RELOADABLE.
The repository is a string of format GITHUB_USER/GITHUB_REPO.
This feature is currently unimplemented.
(It mostly exists, but some features are still in flux.)
Currently, loading events are accessed through LoadingManager.
The events are basic C# events listened by delegates.
The events are documented thoroughly in the source files, but for the sake of reference, a basic list will follow:
-
GameLoadedThe main menu has loaded. This previously also meant most other features were loaded, but this has since changed. -
NetworkReadyThe game's network manager has loaded. The framework manager should also have loaded by this point, but to be safe, verifyMod.Networkingis not null. -
MissionLoadedThe mission has more or less loaded. All players are available, but NOBlackBox swears a few items are still unloaded. -
MissionUnloadedThe mission has been unloaded, either by exit or disconnect.