Modding Tutorials/Plague Gun (old)

From RimWorld Wiki
(Redirected from Plague Gun/Introduction)
Jump to navigation Jump to search


This tutorial was originally written by Jecrell. Thread.

Introduction[edit]

In this tutorial we're going to create a weapon that covers many different aspects of RimWorld's systems. This provides us with a clearer understanding of how RimWorld works for modding.

By following this tutorial, you will be able to do your own complex RimWorld modding in XML and C# in the same way that I can. I will give you all my tools and know-how.

This weapon will be known as The Plague Gun. When fired, if it hits its target, it will have a chance to make the target catch the plague.

To make this mod happen, we will need to create the ThingDefs in XML for the bullet and gun, and create a C# assembly that uses the Projectile class to define a new Impact event for our plague projectile.

This tutorial cannot fully teach XML and C#, and it can help you familiarize yourself a bit with them, but there are lots of free resources online to learn them.

  1. XML -> https://www.w3schools.com/xml/
  2. C# -> http://www.learncs.org/

The completed mod[edit]

For a working example, check out this GitHub repo.

See also[edit]

  1. Required Items
  2. XML Stage
  3. Connecting XML and C#
  4. C# Assembly Setup
  5. C# Coding
  6. Localisation