Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
Say... do you think it's a feature worth implementing in your mod? I didn't expect such a quick response from you (the author), so I was going to DIY a Frankenstein of those two myself.... but you can prob do it quicker and better :p
Lots of questions; what exactly are you envisioning of the feature?
If you’re looking to start doing some modding, I think my mod is pretty well-documented, and I could offer advice on how you can approach stuff if you’d like to try. I don’t have much time these days to work on this mod, so updates are usually pretty slow, especially for new features.
Feature would change the 'proximity' sensor of the lights to an adjustable timer (example: turns on at 6:00, turns off at 23:00) this feature is available in power switch mod so I will see if I can mash it into your mod.
Later on I will see if I can add heaters to do the same thing.
Also this would require a new tech (for more immersive experience)
I think it will feel more realistic and might get rid of the flickering issues people were experiencing...
I did attempt some dll modifications some time ago, but it's not my forte, so it might take me some time to wrap my head around this.
Thank you for offering help! I'm sure I will run into an issue ... or few lol. I will send you the finished product when and if I'm successful, that way you can see if it's worth implementing :)
Do you envision being able to schedule specific, individual lights, or entire rooms at once? I think the route I’d go is to modify my KeepOnComp to be schedulable, probably add some more buttons to it (which only show up after a certain research has been completed), then in the KeepOnComp’s KeepOn getter, I’d modify it to return true if it’s during the scheduled time, even if the Keep On option isn’t selected for that light.
That sounds like it would get the job done in a way specific to my mod, and the hard work would really be done automatically with the existing code.
I’ve tossed around that idea a few times, mostly thinking that I could have a proximity sensor building in a room that tracks the usage heuristics of that room, then delays turning lights off by an amount appropriate to that room automatically. That way high-traffic rooms would basically stay lit unless a pawn doesn’t enter for a long time, and low-traffic rooms would turn off instantly when a pawn leaves.
Issues with that are things like: what if they build two sensors in the same room (which do we take?); what if they build two sensors in adjacent rooms then knock the wall down (now the sensors would have different heuristics, so it kinda makes a difference which we take); how do I communicate the presence of a proximity sensor object to my mod in a performant way (it wouldn’t be acceptable to scan every room each tick on the DisablePowerDrawOnGet patch, for example)?
For the first two, an easy solution is to arbitrarily just always take the first or last one we find; for the last one, I’d imagine we would need to keep a list of all proximity sensor objects, then loop over those when deciding if we should turn off a light (checking if it’s in the same room as we’re looking to disable, Common.Lights.ShouldTurnOffAllLightsInRoom, would be a good start) since there will be relatively few compared to looping over the contents of a room.
The power swith mod:
https://github.com/HaploX1/RimWorld-PowerSwitch
Is under Creative Commons License Attribution-ShareAlike 4.0 https://creativecommons.org/licenses/by-sa/4.0/
So from what I understand the copyright shouldn't be a problem if you decide to implement this feature.
Regarding the proxy sensor: I was just crudely referring to the existing mechanic, since the lights turn off without pawn interaction, so it looks like a proximity sensor.
Thanks for your replies, it gives me more info about the mechanics of the code, something I struggle with the most as I don't find it intuitive like with other games and then I get stuck. So anything helps here :)
Adding new buildings should be super doable! Not sure how easy it would be to add a recipe that does that, but I can't imagine it's too tough.
In that case, the approach I'd take would be to make a subclass of KeepOnComp (you'd need to modify it to have virtual things, obviously), then make a new building that inherits from the vanilla light and simply gets that comp instead of the normal one. Then in that comp you'd return true from KeepOn so long as the timer was active.
That stops the light from turning off when pawns leave during the scheduled time, but it doesn't turn the light on/off automatically. For that you could do a number of things:
Option 1: keep a list of all ScheduledKeepOnComp objects that spawn and just check through them every so often and see if they're on and see if they're waiting to be shut off due to scheduling
Option 2: you could use the new delay-off system to schedule the time that the light should turn off (though you'd have to change how I do that since I use a queue and assume they're all scheduled in the order they should turn off, but you could use a sorted list for that) and let it be a "feature" that the light simply would never turn on until a pawn entered the room during the scheduled time ("saves power by waiting for the first pawn during the scheduled time"). Alternatively you could also add a new schedule on feature that does the same thing just for turning things on if you really wanted the schedule to be respected to a T.
Those are the two that jump out at me at least. The mechanics of RimWorld are definitely not intuitive, that's not just you.
(If you're curious, my inclination would be to do #2, but I'm not sure what the efficiency looks like on #1 and that's my primary concern)