-
Notifications
You must be signed in to change notification settings - Fork 18
Creating Mods
-
Start a new .NET 4 (or 4.5 if you want) library project
-
Link it against the Pathfinder.dll
- It is recommended you also at least link it against FNA.dll and HacknetPathfinder.exe.
-
You may need to go into the project options and set the project to target the x86 platform
-
Create a class that implements the
Pathfinder.ModManager.IMod
interface
-
Identifier - the mod unique identifier used for saving and execution of both the mod and its components, it may not actually be represented in game, it may have spaces but excess white-space will be trimmed when included. It also should not contain a period and if it starts with a number it will be replaced with an underscore.
-
Load - the first method loaded for the mod, its a preloading method that executes almost immediately after the game starts, it is suggested to avoid using this for most things unless absolutely necessary, as many game systems aren't even ready at this point.
-
LoadContent - the main loading method for everything, executes upon the main menu's LoadContent method and should be where general Pathfinder content should be loaded from
-
Unload - the method responsible for unloading mod systems, unnecessary for Pathfinder register content, which automatically handles itself, this would be more appropriate for less self-contained systems in game that would likely function via the Load method instead.
This creates a mod that creates a mymodcommand
that only says hello, which has a help description and will autocomplete.
public class MyMod : Mod
{
string Identifier => "MyModUID";
void Load() {}
void LoadContent() {
Pathfinder.Command.Handler.RegisterCommand("mymodcommand", (os, args) => os.write("hello"), "says hello", true);
}
void Unload() {}
}
Pathfinder.ModManager.Mod
is not ready for use so avoid.