how do i make a gun mod

Started by Austintrollinski, September 22, 2017, 05:57:08 PM

Previous topic - Next topic

Austintrollinski

i want to make a gun mod for a faction am going to make but am not sure where to start and this is my first attempted to make a gun

CannibarRechter

#1
You need to make some art for the gun (well, only if you want it to look different). Then you should go down into the Core\Defs directory, and go into ThingDefs_Misc subdirectory. From there, open Weapons_Guns.xml. You will see pairs of ThingDefs: 1 for the bullet, 2 for the gun.

As for your own mod, create a subdirectory for you mod in the Mods directory.

So for example, under the Mods directory you might make one named "Austintrollinski". Under that, you need:

1. A directory called About. In this directory you need a file called "About.xml". Just explore a few mods to see what goes in it. One thing of note: don't be overly specific with the "targetVersion". For example, unless you KNOW you need a specific patch level, a mod is fine with this:


<targetVersion>0.17.0</targetVersion>


That says that the Mod will work with any A17 release of the game, and doesn't care about minor versions.

Anyway, after you have created the About directory, create a Defs directory.

Easiest way to make a gun mod is to simply copy the Weapons_Gun.xml file to your Defs directory, and then delete everything you don't need. I.e., just keep your new Bullets def, and your Gun def.

Just a few tidbits. The file begins with this:


<?xml version="1.0" encoding="utf-8" ?>
<ThingDefs>


And ends with this:



</ThingDefs>


You gotta leave those parts in.

You'll notice that some items have tech level requirements. You'll need to play around with those, if you want your weapon available early. Look for <techLevel> in the XML.
CR All Mods and Tools Download Link
CR Total Texture Overhaul : Gives RimWorld a Natural Feel
CR Moddable: make RimWorld more moddable.
CR CompFX: display dynamic effects over RimWorld objects

Albion

There actually is already a quite extensive tutorial on how to mod a gun and even make it do extra stuff.
Here is the link to the tutorial

You'll only need part I. to III. to do most gun modifications.

I also recommend to just download some other mods which do kind of the same thing as you want to do and check out what they did and how/why they did it that way. Helped me a lot myself and there are a lot of gun mods out there.