Developer Environment
One-time setup for building gregCore itself and C#/Lua mods. (Oxide equivalent: “Development Environment”.)
Requirements
Section titled “Requirements”- .NET 6 SDK (project targets
net6.0; on hosts with only .NET 8/10 useDOTNET_ROLL_FORWARD=Majorfor tests). - Local Data Center install + MelonLoader run once — populates
MelonLoader/Il2CppAssemblies/andMelonLoader/net6/. - Game reference assemblies in
references/(Il2CppInterop dummies copied from your local install — seeQUICKSTART.md§2). The framework was built on Linux (Proton-GE); Windows works identically. - Python 3 for
scripts/helpers (validate_version.py,generate_api_docs.py,validate_contracts.py).
Clone + build
Section titled “Clone + build”git clone https://github.com/mleem97/gregCore.gitcd gregCoredotnet build -c Release # artifact: bin/Release/net6.0/gregCore.dll# or dual-profile: ./build.sh --both (Releases/ output)DOTNET_ROLL_FORWARD=Major dotnet test # only needed without a .NET 6 runtimepython3 scripts/validate_version.py 1.2.3Single source of truth for the version is the VERSION file (currently 1.2.3); BuildInfo stamps -dev.0 on dev builds.
Key paths (repo root)
Section titled “Key paths (repo root)”| Path | What is here |
|---|---|
src/ |
Framework source, gregCore.* assemblies (see Core Overview) |
framework/greg_hooks.json |
Canonical hook registry (manifest v2, 2 pinned lifecycle hooks) |
game_hooks.json |
1,850 patchable methods in 22 groups (IL2CPP dump) |
references/ |
Game + loader assemblies (your local copy; never commit binaries) |
examples/ |
Working mods in 6 languages (Lua ×4, C#, JS, Python, Rust, Go) |
templates/csharp, templates/lua/example-mod |
Starter templates |
sdk/packs/ |
greg-{go,js,lua,python,rust}-sdk.zip (built via scripts/Create-SDK-Packs.ps1) |
tools/ |
GameApiGenerator (+ regenerate.sh/.ps1), GregCoverageScanner, FontAssetBundleBuilder, check-coverage.sh |
scripts/ |
27 helpers: build, release, mirror (gregMirror.Sync.sh), deploy (Deploy-Release-ToDataCenter.ps1, Deploy-Release-ToWorkshop.ps1), validation |
tests/ |
gregCore.Tests (unit tests) |
.forgejo/workflows, .gitea/workflows |
Identical CI + mirror (Forgejo = push source, GitHub = passive mirror) |
.codacy/ |
Local CLI config (lizard, opengrep, pylint, trivy) — no duplicate CI run |
.wiki/ |
This wiki (synced via scripts/Sync-Wiki.ps1) |
Lua-only setup (no .NET needed)
Section titled “Lua-only setup (no .NET needed)”- Install the game + gregCore per Player Installation.
- Write in any editor; iterate with the F12 REPL + hot-reload (
on_reload()). - Start from
templates/lua/example-mod/{main.lua, mod.json}orexamples/Lua/starter_template/.
C# mod setup
Section titled “C# mod setup”- Start from
templates/csharp/(ExampleMod.cs,GregHost.cswith theHasCoreprobe,GregMod.Template.csproj). - Reference
gregCore.dllwithPrivate=false(soft dependency — seedocs/modding/hard-dependency.mdfor when a hard dependency pays; the HexViewer playbook removed 351 lines by going hard). - Keep the JIT-split: never let a missing gregCore crash your mod at JIT time — probe
GregHost.HasCorefirst.
Decompiler / dump workflow (Oxide “Publicizer / Using Decompiler” equivalent)
Section titled “Decompiler / dump workflow (Oxide “Publicizer / Using Decompiler” equivalent)”- After a game update: run the game once with MelonLoader, re-copy interop assemblies into
references/. - Regenerate the API surface:
tools/GameApiGenerator/regenerate.sh(writessrc/gregCore.GameApi/Generated/). - Regenerate hooks if methods changed:
scripts/Generate-GregHooksFromIl2CppDump.ps1(refreshesgame_hooks.json); review intoframework/greg_hooks.json. - Validate:
scripts/validate_contracts.py(coverage semantics perdocs/modding/api/coverage.md) +python3 scripts/validate_version.py <VERSION>+ full test run. - Test vanilla-first: disable all mods, confirm the game loads, then enable yours.