Typically, Gun_Revolver is right below Bullet_Revolver in XML, so hopefully this will be easy to find and copy. Use its "Find in Files" function to reference and copy Gun_Revolver to your XML file. When you find Bullet_Revolver, copy from its beginning all the way until its closing tag into your XML File.ġ0) Use your text editor. RimWorld holds copies of all of its weapons, items, buildings, etc. This makes it wildly easier to search for examples in RimWorld's Core. From there, you can enter a phrase to search for, and then you can enter the file path to search through. In Notepad++, if you press CTRL+SHIFT+F, you can go to the Find in Files screen. Use its "Find in Files" function to reference and copy Bullet_Revolver to your XML file.įor me, Find in Files is a function I use repeatedly. In RimWorld, it is often best to use the XML attribute ParentName="BaseBullet" when making a bullet, because it will copy XML code from a pre-existing BaseBullet ThingDef, which can save us time and key taps.ĩc) Use your text editor. Next we will fill out our XML file by copying an existing revolver's ThingDef and a revolver bullet ThingDef. This file will contain the blueprints (ThingDefs or Thing Definitions) for our new gun and bullets. RimWorld>Mods>PlagueGun>Defs>ThingDefs>RangedWeapon_PlagueGun.xml We're going to make Defs for our Plague Gun and Plague Bullet.Ħ) Make a new ThingDefs folder in your Defs folder.ħ) Make a new text file in your ThingDefs folder, and change it to RangedWeapon_PlagueGun.xml. Everything from characters, animals, floors, damages, buildings, and even diseases in RimWorld use Defs. This makes things easier for us, the modders. Instead of using hidden C# code, RimWorld will look up an XML Def and copy it to the game world. RimWorld uses something called Defs like blueprints for in-game objects. For the purposes of this tutorial, however, we will use the RimWorld standard structure. Defs/StrangeNewAlienGuns/MyGuns.xml will work. You can name your directories however you like under the /Defs/ subfolder. RimWorld will read your XML files in any directory. 5) Make a Defs folder in your Mod's directory.
0 Comments
|