Editing Modding Tutorials/Plague Gun (1.1)
Jump to navigation
Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
− | This is a | + | This tutorial is a rewrite of the [[Plague Gun/Introduction|original]] by Jecrell ({{LudeonThread|33219}}), updated to 1.1 by dninemfive. |
== Introduction == | == Introduction == | ||
− | In this tutorial we will be using most of the tools available to a Rimworld | + | In this tutorial we will be using most of the tools available to a Rimworld modder to create a custom weapon, known as the Plague Gun. |
− | This weapon will, when its shots hit a living target, have a chance to apply the | + | This weapon will, when its shots hit a living target, have a chance to apply the Plague hediff ("health difference") to that target. |
− | To do this, we will create XML ThingDefs for the gun and projectile, create a C# assembly which determines what happens when the projectile hits a target, and link that behavior back to the XML. | + | To do this, we will create XML `ThingDefs` for the gun and projectile, create a C# assembly which determines what happens when the projectile hits a target, and link that behavior back to the XML. |
This tutorial will assume a basic familiarity with XML and C# syntax. It should be simple enough to follow if you're only a beginner. | This tutorial will assume a basic familiarity with XML and C# syntax. It should be simple enough to follow if you're only a beginner. | ||
Line 14: | Line 14: | ||
=== The Completed Mod === | === The Completed Mod === | ||
− | + | ||
+ | TODO: fork and update the repo, link here. | ||
== Required Items == | == Required Items == | ||
Line 22: | Line 23: | ||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
− | | [https://notepad-plus-plus.org/ Notepad++] or [https://atom.io Atom] or [https://www.sublimetext.com/ Sublimetext] or [https://code.visualstudio.com/ VSCode] || Use any text editor that allows you to edit XML files and use "Find in Files" for referencing. | + | | [https://notepad-plus-plus.org/ Notepad++] or [https://atom.io Atom] or{{br}}[https://www.sublimetext.com/ Sublimetext] or [https://code.visualstudio.com/ VSCode] || Use any text editor that allows you to edit XML files and use "Find in Files" for referencing. |
|- | |- | ||
| [https://visualstudio.microsoft.com/vs/community/ Visual Studio Community] || Use this or any other C# compiler to turn scripts into .dll files that RimWorld can use. | | [https://visualstudio.microsoft.com/vs/community/ Visual Studio Community] || Use this or any other C# compiler to turn scripts into .dll files that RimWorld can use. | ||
Line 29: | Line 30: | ||
|} | |} | ||
− | For more detailed recommendations, see [[Modding Tutorials/Recommended software|here] | + | For more detailed recommendations, see [[Modding Tutorials/Recommended software|here]]. |
== XML Stage == | == XML Stage == | ||
Line 35: | Line 36: | ||
In this stage we will set up the mod and create XML files which add our things to the database. | In this stage we will set up the mod and create XML files which add our things to the database. | ||
− | # | + | # Create a mod folder.{{br}}<small>RimWorld>Mods>PlagueGun</small> |
− | + | #* Go to your RimWorld's base folder. For myself, that is D<nowiki>:</nowiki>\SteamLibrary\steamapps\common\RimWorld\. Others may find it in C<nowiki>:</nowiki>\Program Files (x86)\Steam\steamapps\common\RimWorld or a custom directory. | |
− | #* | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
#* Go into the Mods folder. | #* Go into the Mods folder. | ||
− | #* Make a new folder with our mod's title: | + | #* Make a new folder with our mod's title: ''PlagueGun'' |
− | # Inside | + | |
− | + | # Inside ''PlagueGun'', make an ''About'' folder.{{br}}<small>RimWorld>Mods>PlagueGun>About</small> | |
− | + | ||
− | # Inside the | + | # Inside the ''About'' folder, make a new text file and rename it About.xml.{{br}}<small>RimWorld>Mods>PlagueGun>About>About.xml</small> |
− | |||
− | |||
#* You will need a good text editor to make a proper XML file -- see [[#Required Items|required items]]. I always make a .txt file first and change it to .xml. If you can't rename your file's type, make sure you have filetypes visible in your operating system's file view settings. | #* You will need a good text editor to make a proper XML file -- see [[#Required Items|required items]]. I always make a .txt file first and change it to .xml. If you can't rename your file's type, make sure you have filetypes visible in your operating system's file view settings. | ||
− | #* | + | #* About.xml is the file that shows your mod in the mod list inside the RimWorld game. It is also used when creating a Workshop upload for Steam. |
− | #* At the top of an XML file, always include this for RimWorld | + | #* At the top of an XML file, always include this for RimWorld.<source lang = "xml"><?xml version="1.0" encoding="utf-8"?></source> ''Note: the'' version '' tag should always be "1.0". It has no relation with the current RimWorld version.'' |
#* Then add the MetaData tags for the Workshop and in-game Mod list.<source lang ="xml"><ModMetaData> | #* Then add the MetaData tags for the Workshop and in-game Mod list.<source lang ="xml"><ModMetaData> | ||
<name>Test Mod - Plague Gun</name> <!-- The name of your mod in the mod list --> | <name>Test Mod - Plague Gun</name> <!-- The name of your mod in the mod list --> | ||
Line 66: | Line 58: | ||
</source> | </source> | ||
#* Save the file. | #* Save the file. | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− |