Skip to content

RussDev7/CastleForge-ExampleCommunityMod

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

CastleForge-ExampleCommunityMod

Preview

A starter CastleForge community mod repository that demonstrates a clean mod structure, config loading, command registration, embedded dependency handling, and a reusable Harmony patch bootstrap.

Best for: mod authors who want a practical example they can clone, rename, and turn into their own standalone CastleForge mod project.


What this repository is

CastleForge-ExampleCommunityMod is a standalone, community-facing adaptation of the official CastleForge Example sample.

It is meant to show what a clean third-party CastleForge mod repository can look like when it lives outside the main CastleForge repo.

This repository includes:

  • a ready-to-read starter README
  • a simple sample mod project
  • config creation and loading
  • command registration examples
  • Harmony bootstrap / unpatch flow
  • embedded dependency resolution helpers
  • a lightweight project layout you can rename and expand

Repository layout

CastleForge-ExampleCommunityMod/
├─ README.md
├─ .gitignore
└─ ExampleCommunityMod/
   ├─ Embedded/
   │  ├─ 0Harmony.dll
   │  ├─ EmbeddedExporter.cs
   │  └─ EmbeddedResolver.cs
   ├─ Patching/
   │  └─ GamePatches.cs
   ├─ Properties/
   │  └─ AssemblyInfo.cs
   ├─ Startup/
   │  └─ ECMConfig.cs
   ├─ _Images/
   │  ├─ ExampleCommands.gif
   │  ├─ ExampleConfig.png
   │  ├─ ExampleHarmony.png
   │  └─ Preview.png
   ├─ ExampleCommunityMod.cs
   └─ ExampleCommunityMod.csproj

What this example demonstrates

Startup and shutdown flow

  • ModBase entrypoint
  • safe Start() initialization
  • clean shutdown / Harmony unpatching

Command wiring

  • CommandDispatcher registration
  • example command handlers
  • help registry hookup

Config lifecycle

  • create config file on first run
  • parse and validate values
  • apply settings into fast runtime statics

Embedded dependency handling

  • embedded managed DLL resolution
  • optional native DLL preload/export pattern
  • a reusable embedded resource extraction helper

Patch bootstrap structure

  • centralized patch registration
  • best-effort patch application
  • isolated unpatching by Harmony ID

Important note

This repository is still intentionally a starter / teaching example, not a feature-heavy finished gameplay mod.

Some handlers and patch containers are left lightweight on purpose so mod authors can replace the sample logic with their own real implementation.


Developing with CastleForge

This sample is designed to be used alongside the main CastleForge project.

In practice, most authors will either:

  • keep this repository as the source repo for their mod and adapt the project references to their local CastleForge setup, or
  • copy/rename the project into their own CastleForge workspace while using this repository as the public-facing source history for the mod.

Because CastleForge projects commonly rely on shared ReferenceAssemblies, ModLoader, and ModLoaderExtensions, you may want to align the project references in ExampleCommunityMod.csproj with your own local workspace layout before building.


Suggested next steps

If you want to turn this into a real mod, the usual first changes are:

  1. replace the sample command logic with real gameplay behavior
  2. add real [HarmonyPatch] classes under Patching/
  3. update the config keys and defaults in ECMConfig.cs
  4. replace the preview image and README screenshots
  5. publish releases from this repo
  6. add a catalog entry to CastleForge-CommunityMods

Community catalog relationship

When you are ready to list the mod publicly in the community catalog, create a submission folder in CastleForge-CommunityMods that includes:

  • mod.json
  • README.md
  • preview.png or preview.gif

That catalog repo is for discovery.
This repo is the actual source repository for the mod.


Summary

CastleForge-ExampleCommunityMod is a clean standalone example repo that shows how to structure a third-party CastleForge mod project with commands, config, embedded dependencies, and Harmony patch scaffolding.

About

Example CastleForge community mod with config and Harmony patching.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages