Instalar Steam
iniciar sesión
|
idioma
简体中文 (chino simplificado)
繁體中文 (chino tradicional)
日本語 (japonés)
한국어 (coreano)
ไทย (tailandés)
Български (búlgaro)
Čeština (checo)
Dansk (danés)
Deutsch (alemán)
English (inglés)
Español de Hispanoamérica
Ελληνικά (griego)
Français (francés)
Italiano
Bahasa Indonesia (indonesio)
Magyar (húngaro)
Nederlands (holandés)
Norsk (noruego)
Polski (polaco)
Português (Portugués de Portugal)
Português-Brasil (portugués de Brasil)
Română (rumano)
Русский (ruso)
Suomi (finés)
Svenska (sueco)
Türkçe (turco)
Tiếng Việt (vietnamita)
Українська (ucraniano)
Comunicar un error de traducción
This is something that I've thought about before, but I ruled it out for a few reasons. Primarily I intended for this mod to model real-world things -- off switches on workbenches and light switches for rooms. You could make the argument that occupancy sensors exist, but that requires additional hardware and as such doesn't work well as a default for all rooms.
The Keep On feature was added as a means to address the disco problem, does that not address it for you? I typically leave my lights on in the kitchen and in high-traffic areas since they're pretty much always on anyway; for the big storage areas that I can't get rid of, I'll keep one of the lights on (or a couple if it's sufficiently big) so that as a pawn enters it isn't so jarring when the rest of the lights turn on. I find that it's a pretty nice setup for me.
The biggest part to consider here is that a static timeout time isn't likely to be a good solution. Some folks will feel it's too long, others too short; for some lights, a timeout of n ticks is right, for others it would be much too long. You could give users the option to customize this, which helps the first of those two example issues, but there's no amount of feasible configuration that is going to help with the second, at least trivially.
The feasible solution to the problem would be to add some kind of occupancy sensor building that would have a configurable delay so it could be set for each room individually. Further, a smarter solution might gather statistics about the room and how pawns are using it. For example, if a pawn leaves the room empty and then a pawn enters shortly thereafter, how long, on average, was the room empty? You could set the delay to somewhere around that average, which would keep the lights on for an appropriate time for that room without requiring users to micromanage the delay.
I don't think this would be a performance-intensive modification, but it would require a number of changes to how this mod is set up, since there's no way to delay things at the moment. It's entirely possible, but I definitely wouldn't have time to do this any time soon -- so I am unfortunately going to leave you with a "feel free to submit a PR" on it.
As a note, I could get behind a PR for an occupancy sensor, but I don't know that I'd approve a PR with a base timeout for all lights in general. If you feel strongly that that's the solution you'd like, I'd also definitely accept a PR that makes the modifications necessary for you to make your own mod that patches that behavior into my mod. Just because I won't add it doesn't mean you can't -- that's what modding is all about!
What are your thoughts?
anyway, those are super-useful thoughts, and I hadn't considered some of them. I'll think further, and see how I go writing my own logic to do the "is someone here, countdown timer" style thing.
if that turns out to be useful, I'll send you a PR for anything that makes integration better, should it come to that. :) if it turns out to be, well, a "great idea on paper, not so much in the game" then it'll just quietly walk away... haha.
If you were thinking about it, I would recommend NOT redoing the logic to see if someone is in a room, or the triggers for turning lights on and off, etc… as someone who wrote it once, it’s not worth it. I’d rather part my mod out into a Core package that other folks can use in their mods than have anyone try and do it again to get the same functionality. It would also lessen your burden since it would be on me to support all the different lights (not that I’m stoked about that, but it be like that sometimes).
If I were implementing these changes, I would change the dictionary of “can these be on” (I forget the name, it’s in Common.Resources I think?) to be an int instead of a bool, and have it represent the number of ticks until it turns off: let 0 be off (no ticks remaining), -1 be on (infinite ticks remaining), and n be a countdown of ticks before the light turns off, which gets decremented once per tick.
Then change the EnableLight function to take an int to set it to (default value of -1), and adjust the tick to decrement that value (probably add another method in Common.Lights for that). There are a couple ways you could get the tickwise behavior, but I don’t know if I have any readily available in my mod yet.
After that, I’d change the DisableAllLights code to check for the occupancy sensor and use that value instead of -1. Alternatively, if you wanted to make it your own mod (with or without the occupancy sensor) you could do a bool prefix patch on the DisableAllLights method and return true if you handled the lights. If you did it that way, you’d most likely still want to do the PR to change the dictionary to an int instead of a bool since that would make the rest much, much easier.
I think that would be the bulk of the work; the rest of the triggering events and enabling/disabling lights my mod could handle for you! I can also be a resource, if that would be helpful.