Any problems (mis?)using CompProperties_AffectedByFacilities?

Started by 5thHorseman, July 31, 2018, 12:43:00 PM

Previous topic - Next topic

5thHorseman

Disclaimer: I am *totally* new to modding Rimworld. I've dabbled in modding other games to certain extents so am not afraid of xml files. Though, I learned xpathing about 30 minutes ago.

I have a very small patch file, that works and does what I want with no apparent side effects:
<?xml version="1.0" encoding="utf-8" ?>
<Patch>
<Operation Class="PatchOperationAdd">
  <xpath>*/ThingDef[defName = "PowerSwitch"]/comps</xpath>
  <value>
<li Class="CompProperties_AffectedByFacilities">
<linkableFacilities>
<li>PowerConduit</li>
<li>WaterproofConduit</li>
</linkableFacilities>
</li>
  </value>
</Operation>
</Patch>

When you have power switches selected, you can now easily select power lines as well. This makes doing power a tiny bit easier.
If I were to expand this so that power lines had switches, it would be even better. And if - say - generators had power lines, tables had chairs, walls had doors... You get the idea.

Is there any problem anybody can forsee to my doing this? My concern is that the code seems to be for defining buildings that help the building in which it's defined. I got the code from beds, that allow you to easily place dressers and end tables. Work benches similarly allow you to easily place tool chests. Am I somehow adding this helper functionality, even if it's not actually helping? Is that inherently a bad thing? Would it cause any problems or perhaps slow things down because there are so many "helper" interactions?

I want to go whole hog with this and enable this for basically everything that could benefit from it.
Toolboxifier - Soil Clarifier
I never got how pawns in the game could have such insanely bad reactions to such mundane things.
Then I came to the forums.