RimWorld

RimWorld

[JPT] Burn It for Fuel
jptrrs  [developer] 5 Aug, 2019 @ 3:38pm
[obsolete] Do it yourself: How to make X a fuel?
Whether you want to burn some other resource from the base game or add something else from your favourite mod to the fuel list, you can easily roll up your sleeves and make it happen yourself. You can use Windows' Notepad to open a .xml file, right? That's all you're going to need. Just follow this steps:

1. Identify what is it you're going to add
You'll need to know what's the "defName" you're adding. You can either:

A: Activate the development tools in-game, click on the magnifying glass tool, turn on the first button (Deep Inspection Mode) and hover your mouse over the resource you want to identify. Take note of what shows up on the second line, between <def> and </def>. Case matters, ok?

OR

B: Look it up inside the xml files. For the base game, those are typically in C:\Program Files (x86)\Steam\steamapps\common\RimWorld\Mods\Core\Defs\ThingDefs_Items.
If you're adding something from a mod, you can typically find its folder at C:\Program Files (x86)\Steam\steamapps\workshop\content\294100\[that number showing up on your mod's page address]\Defs\ThingDefs. There, look for a file named something like "resources" (devs can use whatever name they like here). You're looking for a <defName>NameOfThatThing</defName>, but its usually easier to find the friendly text on <label>, the next line. You gotta copy the NameOfThatThing on <defName>, though, that's your guy.

(Note: you can also add a whole category of things to the fuel list. In that case, you're looking for a ThingCategoryDef, usually in their own separate folders.)

2. Write your own patch

1. Locate this mod's patch folder on your hard drive. Typically that's C:\Program Files (x86)\Steam\steamapps\workshop\content\294100\1823276856\Patches

2. On that folder, create a new text file and name it Patches_JustForMe.xml (NOT .txt, don't let windows fool you, turn on "File name extensions" to be sure). On that file, place the following code, replacing the spot I marked with []'s with the defName you identified before (remove the []'s, don't include <defName> and don't mess with anything else, ok?):

<?xml version="1.0" encoding="utf-8" ?> <Patch> <Operation Class="PatchOperationAdd"> <xpath>/Defs/ThingDef/comps/li[@Class = "CompProperties_Refuelable"]/../../building/fixedStorageSettings/filter/thingDefs</xpath> <!-- NOTE: replace "thingDefs" with "categories"to specify a whole category--> <value> <li>[NameOfThatThing]</li> <!--HERE! Note you can repeat this line if you want to add more than one thing--> </value> </Operation> </Patch>

3. Restart the game and enjoy!

And welcome to the most easily moddable game there is!

Note that, if you're including something from another mod, your patch will generate an error message if that other mod is no longer active. Also, I recommend you backup your file, as steam might overwrite it with every update.

PS: Post your patch on a comment below! If it's for a specific mod, I'll include it on the next update.
Last edited by jptrrs; 2 Feb, 2020 @ 1:13pm
< >
Showing 1-15 of 15 comments
LupineWitch 1 Sep, 2019 @ 7:35am 
I did everything according to your steps, yet my fuel list hasn't changed.
jptrrs  [developer] 1 Sep, 2019 @ 1:33pm 
Did you get any errors? Mind sharing your patch script?
LupineWitch 1 Sep, 2019 @ 2:51pm 
<?xml version="1.0" encoding="utf-8" ?>
<Patch>
<Operation Class="PatchOperationAdd">
<xpath>/Defs/ThingDef/comps/li[@Class = "CompProperties_Refuelable"]/../../building/fixedStorageSettings/filter/thingDefs</xpath> <!-- NOTE: replace "thingDefs" with "categories"to specify a whole category-->
<value>
<li>CoalOre</li> <!--HERE! Note you can repeat this line if you want to add more than one thing-->
</value>
</Operation>
</Patch>

didnt generate any errors tho and Thing def is correct
jptrrs  [developer] 1 Sep, 2019 @ 6:20pm 
What mod is this CoalOre from?
jptrrs  [developer] 3 Sep, 2019 @ 6:14pm 
Cool, @Nero!
Then I can't find any problem with this patch. If you open my own patch files you'll see its exactly the same procedure used for adding other modded resources. The only other thing that I can think of that could prevent it from working would be if it loads before BIFF. If you're including it with your mod, make sure it loads after mine.
LupineWitch 4 Sep, 2019 @ 1:12am 
OOOOH OK, I thoguht otherwise, that my defs should be present in game BEFORE your mod to patch take place, thanks for noting me!
LupineWitch 4 Sep, 2019 @ 4:40am 
Nope, the issue stil happen no matter where I put my mod in the load order.
LupineWitch 4 Sep, 2019 @ 5:10am 
And The patch.xml I have written is in yours mod's folder so it should load after oreprocessing,
shouldnt it?
jptrrs  [developer] 4 Sep, 2019 @ 12:16pm 
Ok, I downloaded your mod, set up the patch and it worked right away. But I realized I have overlooked something on my instructions. Are you ready?....the FILE NAME MUST start with "patches". I bet that was the issue. Yeah, I know...
I've corrected the instructions now. Sorry about that.
https://imgur.com/RbAd6dj
Last edited by jptrrs; 6 Sep, 2019 @ 9:22pm
ZJK 9 Dec, 2019 @ 11:41pm 
What would need to be done in change the value of the said item being added? For reference, what would I need to change to make my added item require twice as much of it compared to wood?
jptrrs  [developer] 19 Dec, 2019 @ 6:36am 
That would be cool, @ZJK, but since the game wasn't designed for that sort of balacing, its not possible. We're stuck with 1:1.
Muad'Dib 24 Jan, 2020 @ 5:03pm 
Here's a patch for Simple Chains: Lumbers
https://pastebin.com/U2Bc8WnM

By the way, since one of your patches looks for PlantMatter, a lot of things that maybe shouldn't be burned can be used as fuel. Synthread, hyperweave but more importantly, if you are using SeedsPlease, things like seeds can become fuel. As can other plants like Wheat, Leather being fuel is kinda weird, too. Do you know of any way of excluding certain things inside the PlantMatter category?

The patch above makes only Firewood as a fuel, as green lumber wouldn't be too flammable and logs are just too big.
jptrrs  [developer] 24 Jan, 2020 @ 5:31pm 
Cool! I might incorporate that! Thanks!
But I'm currently working on an idea with the potential to make this kinds of requests totally obsolete...
Last edited by jptrrs; 24 Jan, 2020 @ 6:00pm
Muad'Dib 24 Jan, 2020 @ 5:41pm 
Good luck then and thanks for the mod, you rock
< >
Showing 1-15 of 15 comments
Per page: 1530 50