|Plague Gun/Introduction has been deprecated or removed completely from the game; it is no longer applicable to current versions|
|This page is suggested to be moved. Reason: move to Modding Tutorials, also consider merging into single page.|
This page is obsolete for the current version of RimWorld and is kept as a resource for modders of previous versions. For the current version see: Plague Gun (1.1)
This tutorial was originally written by Jecrell. Thread.
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.
The completed mod
For a working example, check out this GitHub repo.
- The Plague Gun <- You are here.
- Original Thread