Skip to content

alextd/cookiecutter-rimworld-mod-development

 
 

Repository files navigation

cookiecutter-rimworld-mod-development

Hey yea so I forked this and update it for myself, so go ahead and use it, sure, but all this "how to" stuff is probably old, and, unsupported.

A cookiecutter project that builds the basic Rimworld mod development file structure and sets up a sane build environment.)

Table of Contents

Install/Setup

Windows Command Prompt

Required Programs
Usage (inside Rimworld/Mods folder)
  1. cookiecutter gh:alextd/cookiecutter-rimworld-mod-development
  2. [Answer the prompts]
  3. Open the folder you just created and double-click the ModName.sln file
  4. In the Solution Explorer view on the right, right click RimWorldWin and click Set as Startup Project

Microsoft Visual Studio Integration

Required Programs
Install (if no File -> New -> From Cookiecutter... option is available)
  1. Open up VS Installer (In Visual Studio -> Tools -> Gets Tools and Features)
  2. Click Modify
  3. Click Individual Components
  4. Scroll to Development activities
  5. Click the Cookiecutter template support checkbox
  6. Click Modify
Usage
  1. Open Visual Studio
  2. File -> New -> From Cookiecutter...
  3. Search for rimworld
  4. Double-click alextd/cookiecutter-rimworld-mod-development
  5. Change the Template Options:
    • Create To => [...]/RimWorld/Mods
    • Mod name
    • Author (Use your Steam username for automatic linking of mod to profile) (can change later in About-Release.xml)
    • Mod Description (not required, can change later in About-Release.xml)
    • A few more options are available
  6. Create and Open Project

Basic Features

Folder Structure

This cookiecutter builds the entire standard mod folder structure, with empty folders as the default. namespace_name is automatically calculated.

  • {{cookiecutter.mod_name}}
    • About
      • About.xml
      • About-Release.xml
      • Preview.png
    • Assemblies
    • Defs
    • Languages
    • Patches
    • Sounds
    • Source
      • Properties
        • AssemblyInfo.cs
      • namespace_name.cs
      • namespace_name.csproj
    • Textures
    • namespace_name.sln

VS Setup Automation

  • Links Rimworld and UnityEngine .dlls for importing in code
  • Sets build events to automate file management of About-$Version.xml for tagging development versions.
  • Clears the default set trace constant
  • Creates a VS solution with correctly defined paths
  • Clicking Start ▶️ will preform the designated build sequence and start Rimworld.exe tied to a Visual Studio resource monitor.

Advanced Features

Debug/Release Versioning

This cookiecutter setup takes full advantage of VS debug/release versions

  • Debug mode
    • Built in-place
    • About.xml is for debug and development only
    • About.xml has a "- Dev Build" tag to be easily distinguishable in the mod list
    • The resulting .dll is placed in "{{cookiecutter.mod_name}}/Assemblies"
  • Release mode
    • About-Release.xml is copied to "{{cookiecutter.mod_name}} - Release/About/About.xml" and does not include the "- Dev Mode" tag in its title
    • Building creates or updates the Release version of the mod. Solely the essential files are copied into a separate Release mod folder for a clean version of the mod.

About

A cookiecutter project that builds the basic Rimworld mod development file structure and build environment.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 88.1%
  • Python 11.9%