Fantasy Life I ModTemplate
A template for creating mods for Fantasy Life I using C++
Requirements
- CMake
- MSVC or CLang
- x64 build configuration
Building the mod
- Clone or download this repository
$ git clone --recurse-submodules https://github.com/ReDevCafe/FantasyLifeI-ModTemplate MyMod
- Use CMake to configure and generate project files
$ mkdir build
$ cmake -S . -B build -DCMAKE_BUILD_TYPE=ReleaseConfiguring Mod Info
Tip
You can customize your mod's metadata directly in the resource/Mod.json:
Installing the mod
- Build the project
$ cmake --build build --config Release --target package_mod
- After building place the .fliarchive inside Game/Content/Mods
Note
Fantasy Life I/ ├── Mods/ | └── MyMod.fliarchive
Troubleshooting
-
ModLoader returns
Missing CraftMod in 'mymod'this means you forgot to add the following lines at the ned of your code:
MOD_EXPORT ModBase* CraftMod() { return new MyMod(); }
Here's how your code should look:
class MyMod : public ModBase { public: void OnPreLoad() override {} void OnPostLoad() override {} // Your additional code here } MOD_EXPORT ModBase* CraftMod() { return new MyMod(); }
-
ModLoader returns
Failed to load: 'mymod'This usually means the program was not compiled correctly. If you made changes to the
CMakeLists.txtfile, try reverting them to the original state.