RimWorld

RimWorld

[K]Extra Stone
Svela 11 Apr, 2022 @ 5:52pm
Attempted Compatibility For "[K]Extra Stone" and "Rock and Stone"
So, the mod "Rock and Stone" makes it so the player can build rock walls using stone chunks instead of neading to refine them. These stone walls act like naturally generated stone walls, such that they can be smoothed and mined. However, the original mod only works on base game stone types and not modded ones. After looking at the mods code, I attempted to create a compatibility patch for "[K]Extra Stone" but it didn't do anything. The way the mod works is that it adds a blueprint texture, a dropdown list in the architect menu to select what type of stone like how one would a basic wall, and an xml file that dictates the more indepbt details of how the mod should work in game. Using the "RaS_ThingDefs_Buildings_Patch" xml file in the mod's "Patches" folder I created the following code for the stone added by [K]Extra Stone:



<?xml version="1.0" encoding="utf-8" ?>
<Patch>
<Operation Class="PatchOperationFindMod">
<mods>
<li>[K]Extra Stone</li>
</mods>
<match Class="PatchOperationSequence">
<operations>

<Operation Class="PatchOperationInsert">
<xpath>*/ThingDef[defName = "Andesite"]/statBases</xpath>
<value>
<designationCategory>Structure</designationCategory>
<placingDraggableDimensions>1</placingDraggableDimensions>
<costList>
<ChunkAndesite>1</ChunkAndesite>
</costList>
<uiIconPath>Things/Building/Custom/Rock_MenuIcon</uiIconPath>
<uiIconColor>(112,118,118)</uiIconColor>
<designatorDropdown>Wall_Rock</designatorDropdown>
</value>
</Operation>

<Operation Class="PatchOperationAdd">
<xpath>*/ThingDef[defName = "Andesite"]/statBases</xpath>
<value>
<WorkToBuild>500</WorkToBuild>
</value>
</Operation>

<Operation Class="PatchOperationAdd">
<xpath>*/ThingDef[defName = "Andesite"]/building</xpath>
<value>
<blueprintGraphicData>
<texPath>Things/Building/Custom/Rock_Blueprint_Atlas</texPath>
</blueprintGraphicData>
</value>
</Operation>

<Operation Class="PatchOperationInsert">
<xpath>*/ThingDef[defName = "SmoothedAndesite"]/statBases</xpath>
<value>
<designationCategory Inherit="False"></designationCategory>
</value>
</Operation>
</Patch>



Unfortunately, this simply doesn't work. The original mod still only shows the base game's stone types in the Architect menu. At some point I thought that maybe I could just add the Rock and Stone folders to [K]Extra Stone's mod folder in an attempt to combine them, but all that did was cause my game to get stuck on a black screen upon start up. This attempt at combining them was done with both mods still active, though, so maybe I need to disable Rock and Stone in my mod list when I attempt to combine them, leaving the modified [K]Extra Stone mod enabled. What do you think?
< >
Showing 1-4 of 4 comments
Kuratheris  [developer] 11 Apr, 2022 @ 9:52pm 
Not sure this is the problem, but this is missing the closing tags for the beginning Operation Class, match Class, and operations. Put </operations>, </match>, then another </Operation> after the last </Operation> you have.
Svela 12 Apr, 2022 @ 2:25pm 
Like this?

<?xml version="1.0" encoding="utf-8" ?>
<Patch>
</Operation Class="PatchOperationFindMod">
<mods>
<li>[K]Extra Stone</li>
</mods>
</match Class="PatchOperationSequence">
</Operations>
Kuratheris  [developer] 13 Apr, 2022 @ 4:00pm 
Originally posted by Svela:
^

No, exactly what you had, but before </Patch> at the end put

</operations>
</match>
</Operation>

just like that
Last edited by Kuratheris; 13 Apr, 2022 @ 4:00pm
Svela 14 Apr, 2022 @ 3:40am 
Ah, so at the end of the entire chain of code, you mean? Like this first one?

<Operation Class="PatchOperationInsert">
<xpath>*/ThingDef[defName = "SmoothedAndesite"]/statBases</xpath>
<value>
<designationCategory Inherit="False"></designationCategory>
</value>
</Operation>
</operations>
</match>
</Operation>

</Patch>

Or this second one?

<Operation Class="PatchOperationInsert">
<xpath>*/ThingDef[defName = "SmoothedAndesite"]/statBases</xpath>
<value>
<designationCategory Inherit="False"></designationCategory>
</value>
</operations>
</match>
</Operation>

</Patch>

Sorry, I only know very little about code and modding bases off of observations and a tiny bit of coding lessons. I'm assuming you meant the first one I listed here, but I might need you to write out exactly what you mean if I still didn't get this right.
Last edited by Svela; 14 Apr, 2022 @ 3:42am
< >
Showing 1-4 of 4 comments
Per page: 1530 50