RimWorld Guide

Modding Rimworld for RimWorld

Modding Rimworld

Overview

Best practices for mod development

Introduction

This guide will take us through using the best methods of saving progress, the software development workflow envisioned and supported, to publishing and maintaining a mod. It’s about a twenty minute read.

Here’s what you’ll need to do the job; the software and accounts are free

If you’re reading this, then likely you already have Steam and Rimworld installed, and an account on Steam. Getting the rest in place will probably take around 1/2 an hour. If you get it done in under 15 minutes, then

A more in-depth tutorial on how to use the computer’s software install features and create accounts on their websites is

Setup

Visual Studio Code

This editor has an optional built-in improvement over the process of File->Save, even better than auto-save: Always save. What you are seeing is what is stored on disk. Great tech upgrade guys.

Additional XML code completion and error checking, search in store for redhat.vscode-xml
Rimworld XML coloring mod, search in store for madeline.rwxml-lang-serv

Github

This storage facility has an associated issues tracker for handling bugs, feature requests and other issues. Here is an example issue,[github.com] resolved over the course of a couple days. I like to think of that example as Baby’s First Issue, because the blame lies outside the mod. This is definitely not the norm.

View post on imgur.com

[i.imgur.com]
Because in this line of work you’ll have your fill.
It helps to think of bugs as the garbage generated by any production process.

On most bug hunts you are the detective at a crime scene. And you can collect evidence for your wall of clues. With your detective super-power you can tag anything as a clue related to an issue. You can bring to light a trail of evidence that forms a narrative.

It’s so automated that simply mentioning issue #1 is enough to generate a link, and poof: There’s another entry on the detective’s wall of clues.

So, can we just go right ahead and sign you up for one of our secret Nightstalker decoder rings?[en.wikiquote.org]

Hello, World

Our first goal is to have everything related to the mod stored in one folder, inside

SteamsteamappscommonRimWorldMods

This will expedite testing the mod on the local machine, saving progress on GitHub and distributing the mod on Steam.

So we create a home for our new mod: ..ModsHelloWorld

Let’s start populating our new HelloWorld mod folder. First order of business, tell Git to treat this location as a repository. This will set up an invisible .git folder to hold git-related stuff.

In Visual Studio Code

  1. File -> close current workspace
  2. Source Control (3rd button down on the left) -> Open Folder… ModsHelloWorld
  3. Source Control -> Initialize Repository

Save the workspace
File -> Save workspace as… ModsHelloWorldHello World.code-workspace

We now have the spark of an idea for a mod: There’s a folder with something in it.

Quick, save it before it melts

We’ll gather our changes, package them up with a label describing them, and push it out to GitHub.

Staging changes involves choosing which changed files go into a Commit package. Most of the time the answer is all changed files. There’s a quick select all button right here:

For the description “Initial commit” is a good choice.
Then click the checkmark above to tie the bundle together as a commit. This is undo-able if I wish to edit.

Publishing a new project to GitHub from within Visual Code editor

First time pushing a commit to GitHub needs a little startup housekeeping to automatically set up the project on GitHub and link to it. Press the cloud button and select publish

From now on, we can just click the “…” button and select Push to send a new commit to GitHub.

Skeleton framework

Next up, the About folder and it’s three files that describe the mod. Below are linked examples of all three that can be copy/pasted and edited. They are commented.

About.xml example[github.com]

Manifest.xml example[github.com]

View post on imgur.com

[i.imgur.com]

We now have the necessary file setup to qualify as a mod.
Stage a new commit with these changes, call it maybe “Skeleton framework” and push it to GitHub.

Making a Release

In Visual Studio Code:
In ..AboutManifest.xml, set a new version number.
Stage a commit maybe called “Pre-Release version XXX” and push it to GitHub

Browse to [link][YOURNAME]/HelloWorld/releases and start a new release
Tag it with the version number, tick the pre-release checkbox and publish it.

After publishing the new release version on GitHub
In Rimworld, switch to developer mode and open the mods manager. Select your mod and click the author’s upload button.

Go to your published items in Steam/Workshop and marvel at your handiwork.

PS: Subscribing to your own mods results in two copies of the mod existing on the local machine, so make sure you want that before subscribing.

SteamSolo.com