HOW TO MAKE A WEAPON MOD [Rimworld] (custom weapon/gun)
Mod structure
Let's start with the mod structure.
Any mod is divided into 3 or more folders:
- About
- Defs
- Textures
The Defs folder contains scripts for weapons/technologies, etc.
The Textures folder contains all the textures of your mod.
Creating About.xml
Create a folder with any name and create 3 more folders with the names above in it.
In the About folder, create a text file and change its name and format to About.xml
There should be NO spaces in the packageId line!
supportedVersions - supported versions, i.e. 1.1 1.2 1.4 etc.
loadAfter - after which your mod will be loaded (In this case, after the official rimword content, it is better not to change it)
To add a preview, simply add the desired 640*360 image named Preview.png to the about folder (Optional)
If you have not created a folder with the mod in the rimworld mods folder, then move it there.
After creating this file, your mod will already be displayed in the mods menu.
Defs
Create a file with your name and xml extension, for example gun.xml
Paste the following script into it -
OR ASK ME A QUESTION
Ranged Defs
Research Defs
Create another xml file and insert the following code:
Textures
Weapon textures are usually 64*64 pixels, you can have more, but without the option enabled in the settings, the game will 'compress' your texture to 64*64.
I use Photoshop to create textures, but at worst, paint will do.
There is no specific algorithm for creating an ideal texture, but here are some tips from official and semi-official sources:
- It is better not to create details on the texture smaller than 3 pixels, if the contrast is low, because they will blend in with the environment
- Almost all vanilla textures have a stroke of 1 layer of black pixels, so that the texture is easier to distinguish.
- Too bright and prominent details, especially small ones, hurt the eye, it is better to adhere to a single style.
https://images.steamusercontent.com/ugc/10098245677582381428/3AB16ADFE672D125AF8C2EC3D45D37A56EFC0496/?imw=256&&ima=fit&impolicy=Letterbox&imcolor=%23000000&letterbox=false
AR
Sniper riffle
Two-handed sword
Grenade launcher
You can find more textures on the Internet, they were officially posted by the developer (they are not in the game files)
Also, additional information on mods, scripts, etc. is on the rimworld website (search for rimworld modding) there is information in English
Conclusion
THE MOST IMPORTANT THING!!! If you want to make any mod that does not require creating c# scripts, but do not know how to create it, then just find a similar mod in the workshop and change its Defs and textures for yourself. Mods from the steam workshop are stored in the steam/steamapps/worksop/content/294100 folder
If you want to upload your mod to the workshop, then in the modding tab your mod will have an advanced settings tab, through which your mod will be uploaded to steam (only the official version of the game)
This is a completely original guide written by me. I am not the most experienced modder, but I did, and most importantly, I figured out how to make mods for a wide variety of weapons. If you have any questions, ask them below.
Perhaps there will be more guides on custom clothing (here you will need to draw a lot of textures), plants and much more.
This guide was created by its original author on the Steam Community. Are you the author and want it removed? Request removal.