RimWorld

RimWorld

LightsOut
DrNiggle 17 Oct, 2023 @ 2:47pm
Compatibility with GloomyFurniture
This is the mod:
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=1558635181

The option to keep lights on/off does not appear for Wall Lights, nor do Wall Lights turn off when pawns leave the room.

The code in Gloomy's Fire.xml states:
<!-- Wall Lamp --> <ThingDef Abstract="True" Name="WallLightBase" ParentName="BuildingBase"> <thingClass>Building</thingClass> ...
and the Wall Lights themselves all state:
<ThingDef ParentName="WallLightBase"> <defName>GL_Wall_LampE</defName> ...
If the wall lights are inheriting comps from BuildingBase already, then this mod should work with these lights, right?

I tried making a simple patch based on your code to see if that wasn't the case:
<Patch> <Operation Class="PatchOperationConditional"> <xpath>/Defs/ThingDef[@Name="WallLightBase"]/comps</xpath> <nomatch Class="PatchOperationAdd"> <xpath>/Defs/ThingDef[@Name="WallLightBase"]</xpath> <value> <comps> <li> <compClass>LightsOut.ThingComps.KeepOnComp</compClass> </li> </comps> </value> </nomatch> <match Class="PatchOperationAdd"> <xpath>/Defs/ThingDef[@Name="WallLightBase"]/comps</xpath> <value> <li> <compClass>LightsOut.ThingComps.KeepOnComp</compClass> </li> </value> </match> </Operation> </Patch>
But the Gloomy Wall Lights still don't have an on/off option or turn off when pawns leave the room.

The Gloomy street lights and table-top lanterns which use only the BuildingBase parent work perfectly fine with your mod. What am I missing?

Thanks for this mod and for all your work supporting it. :llama:
< >
Showing 1-4 of 4 comments
juanlopez2008  [developer] 17 Oct, 2023 @ 6:09pm 
Without looking, it’s likely the same issue as with all of the various wall lights: there’s no good vanilla way to make a light source come from a different cell than the building. Every time someone makes a new wall light mod, they create a new custom offset glower, which unfortunately tends to require specific C# patches to support.

I tried to make handling that generic, so it typically does manage to locate and patch custom glowers, but there must be something about this one that makes it harder to detect.

Patching the KeepOnComp onto something will unfortunately never work, as my mod removes it from any building it can’t find a supported glower on to avoid cases where the comp shows even when the mod doesn’t work. That also helps troubleshoot things like this, where I can be certain that it’s not being detected as a light.

I don’t know when I will have time to look into this :(
DrNiggle 17 Oct, 2023 @ 7:15pm 
I really appreciate your response.

You're correct in that Gloomy has it's own custom glower and Gloomylynx.dll handles it. W/r/t KeepOnComp, that makes sense; I respect your codes elegance.

This isn't a game-breaking problem and I understand we all have real lives. If you ever get around to adding GL_Wall_Lamp's to your script then one day I'll load up my colony and get a pleasant surprise. Cheers.
juanlopez2008  [developer] 18 Oct, 2023 @ 6:41am 
You could always add support if you’d like, the mod is open source and I am more than happy to review pull requests. I imagine it would essentially be the same as the Murmur and VE wall light patches I already have, just for that specific scenario
DrNiggle 18 Oct, 2023 @ 4:28pm 
I had the same thought after my post yesterday; I was doubtful I'd be able to contribute, but since you've pointed me towards your VE code, I gave it a shot. I am not a talented C coder, and this might be a terrible idea!
< >
Showing 1-4 of 4 comments
Per page: 1530 50