RimWorld

RimWorld

PowerSwitch
268 Comments
Daemonjax Sep 20 @ 4:58pm 
For 1.4:
========== Def-injected translations load errors (1) ==========
Couldn't inject ResearchPowerConduitsInvisible.descriptionDiscovered into Verse.ResearchProjectDef (ResearchProjects_PowerSwitch_Invisible.xml): Field descriptionDiscovered does not exist in type Verse.ResearchProjectDef

So I just removed that one line from the english language file.
Cama zotz Aug 14 @ 8:00am 
What does this mod considers enemies? Because when i use the auto detect enemy, it's turns on even if i have no enemy on the map. Could it be the Alpha Animals mod? I played before and the auto detection worked but i started a new save with new mods. Just wondering if you know of any potential conflicts
Soup_UK Aug 1 @ 4:50am 
Hydra - that is a great idea!!
Hydra Jul 29 @ 11:30am 
Nice mod!
Been using it for a while now. Any chance instead of ranges have it coupled to zones? I.e. if a pawn is in a certain zone it activates?
Ninjaxas Jul 19 @ 6:50am 
I agree with the wall mounted option! It's more realistic too. A switch does not need to be full tile size.
Soup_UK Jul 15 @ 4:53am 
Hi! I'm a fan of your mod. I was wondering if it's possible to have a wall-mounted variant? This is more for aesthetic (than practical) reasons. :steamthumbsup:
Haplo_X1  [author] Jul 11 @ 2:11pm 
Done
The Byzarkandian Jul 11 @ 11:44am 
1.6?
Haplo_X1  [author] May 8 @ 11:53am 
You can do a pull request if you like, then I can merge it
Scentyz May 6 @ 7:40am 
Haplo_X1, should I make a push/fork/anything? All the code changes are just one block and one line. And thank you for the great mod!
Scentyz May 6 @ 7:36am 
also add this in your class scope (outside of the method) if anyone is using the fix

private int lastCheckedHour = -1;
Scentyz May 6 @ 7:33am 
I was using this mod along with Logic Switch. I am not sure if it resulted in any conflict, but this fix seems to have made the timer of this mod work for me, by flicking the switch only once per hour. The timer may not start to work immediately, but should do after an hour of in game time.
Scentyz May 6 @ 7:33am 
with

[code]
// Improved Timer switching
if (autoSwitchTimerActive)
{
int currentHour = GenLocalDate.HourInteger(Map);

if (currentHour != lastCheckedHour)
{
lastCheckedHour = currentHour;

if (currentHour == autoSwitchTimerOnTime && !flickableComp.SwitchIsOn)
{
flickableComp.SwitchIsOn = true; // No designator usage!
SetWantSwitchOn(true);
}

if (currentHour == autoSwitchTimerOffTime && flickableComp.SwitchIsOn)
{
flickableComp.SwitchIsOn = false; // No designator usage!
SetWantSwitchOn(false);
}
}
}
[/code]
Scentyz May 6 @ 7:32am 
ok I might have made a fix:

replace
[code]
// Timer switching
if (autoSwitchTimerActive)
{
// Time = Off-Time => Switch OFF
if (GenLocalDate.HourInteger(Map) == autoSwitchTimerOffTime && flickableComp.SwitchIsOn)
{
flickableComp.SwitchIsOn = false; // No designator usage!
SetWantSwitchOn(false);
}

// Time = On-Time => Switch ON
if (GenLocalDate.HourInteger(Map) == autoSwitchTimerOnTime && !flickableComp.SwitchIsOn)
{
flickableComp.SwitchIsOn = true; // No designator usage!
SetWantSwitchOn(true);
}
}
[/code]
Scentyz Apr 25 @ 9:30pm 
I too feel the timer function is buggy. Could you please link the repo of 1.5 for me to take a look at?
123caboom Apr 8 @ 9:03am 
Compatible to the wall mounted switch in „hold my switch“?
Shabazza Jan 11 @ 2:11pm 
Timer function is not working for me. It always stays on.
Shodan2072 Dec 19, 2024 @ 9:30am 
Is there any way this could be combined with [Og] Automatic Power Switch, to make the different controls turn on/off automatically?
Haplo_X1  [author] Dec 5, 2024 @ 9:45pm 
Did you add the mod midgame? Then you have to destroy, rebuild the power switch to get the new buttons
The King Nov 11, 2024 @ 6:15am 
My module loaded successfully but no buttons are displayed, Is there any chance of conflict with other mods? (mod1.4)
Haplo_X1  [author] Oct 3, 2024 @ 12:13pm 
If you add the mod to a running game, the powerswitch needs to be rebuild, else it continues to use the old switch.
PassingVillager Oct 1, 2024 @ 6:40am 
My module loaded successfully but no buttons are displayed, Is there any chance of conflict with other mods? (mod1.4)
神公子 Jun 1, 2024 @ 12:02pm 
1.5?
Bardock20687 May 2, 2024 @ 10:48am 
1.5??
тетеря, блин Apr 22, 2024 @ 7:50am 
1.5 🙏
Mike3223cz Nov 8, 2023 @ 6:39am 
Is there a mod that adds a "one-way" cable? Something like a Diode... It allows electricity one way, but not the other... Could be used to make a "Backup power supply".
smitty_the_smith Oct 10, 2022 @ 9:57am 
Is there a way to have Enemy Detection detect hostile animals?
jose.faunon Aug 22, 2022 @ 1:37pm 
This mod is great! May I ask you for make a wall mounted interruptor? I know the mod "wall stuff" have one, but it is not compatible
Haplo_X1  [author] Aug 15, 2022 @ 3:07pm 
That is an issue of the power switch: If it switches a wokbench off, this workbench will be ignored by the pawns.
AngryGuadalupe Aug 14, 2022 @ 11:47am 
When using motion detection, do workbenches without power prevent pawns from working on active bills? Or will pawns ignore that the workbench isn't powered and go to the workbench, activating the power?
Don Castillo Esteban Gonzales Jun 6, 2022 @ 3:42am 
Is there a way to put the switch with the motion detection inside a wall, facing a particular room? This would clean tings up and get rid of switches put randomly inside a room
Haplo_X1  [author] May 4, 2022 @ 9:43am 
You can add it all the time. It just will not apply to already built switches,but new ones should work.
Varulv16 May 3, 2022 @ 7:51am 
So is this mod early game compatiable or is a new game required?
Haplo_X1  [author] Apr 15, 2022 @ 7:13am 
Only if it changes the power switch.
Sundering Sober Sonder Sun Apr 15, 2022 @ 2:47am 
Does this conflict with the mod - LightsOut?
Kuchar Apr 4, 2022 @ 7:22am 
Is there an option to add that we can change auto on/off radius? sometimes 7 is too big for me and it is switching when pawn is in other room.
Haplo_X1  [author] Mar 10, 2022 @ 8:55am 
You can switch this behaviour in the mod options
Fwiffo Mar 10, 2022 @ 1:08am 
For some reason, the switch does not activate automatically on enemy detection in my game. Instead, it creates a job to flick it on/off manually instead.
Haplo_X1  [author] Jan 24, 2022 @ 1:22pm 
I've recompiled it against version 1.3.3200. In my tests the switch is now working. On your side too?
BippyMiester Jan 23, 2022 @ 4:54pm 
Can confirm that as of today, the mod is broken in 1.3. You can't set the time to turn the switch on or off, and the detection of hostile pawns, creatures, or enemies is hit or miss. Do not use the mod until its been updated, and make sure to BACK UP YOUR SAVE prior to you trying this mod. -1 vote from me.:steamthumbsdown:
smitty_the_smith Sep 3, 2021 @ 10:39pm 
Someone fixed the detection of hunting animals by the power switch. I don't know who to thank.
@Jarquafelmu It works now.
Disferente Aug 21, 2021 @ 8:50am 
Any chance to add so it can turn power off/on when it is raining?
-Mikhail- Aug 16, 2021 @ 1:21pm 
There may be a problem in the version for 1.3. The switch is not visible on the wall.
Athos56 Aug 9, 2021 @ 1:30pm 
Just as a heads up, I had a siege raid, even after the raiders charged the walls the enemy detection never triggered. It had worked as expected for the regular raid earlier. However, the motion detection works great for my hospital, saves me tones of power. Great mod.
Haplo_X1  [author] Jul 19, 2021 @ 8:32am 
Take a look on github..
Ex Ossibus Fumus Jul 18, 2021 @ 6:36pm 
Can anyone confirm if this is functional as is for 1.3? just wanna make sure i can still use this with the new DLC
potoum13 Jul 14, 2021 @ 1:55am 
BUG - I use a mod call Visual Exceptions... And it report an error when loading this mod.

System.InvalidOperationException: Field descriptionDiscovered does not exist in type Verse.ResearchProjectDef.
Jarquafelmu Jul 5, 2021 @ 5:25pm 
it would be nice if manhunting animals or animals in rage would trigger the enemy detection so that the turrets can fire at them
smitty_the_smith May 30, 2021 @ 11:35am 
Does anyone know of a way to cross two power lines without them connecting? I want a switched line and an unswitched line