[1.2] PowerSwitch

Started by Haplo, April 10, 2014, 03:31:29 PM

Previous topic - Next topic

Haplo

Update: Hopefully I've found the cause of the error with the motion detector.
I'm not 100% sure as I couldn't reproduce it here, but.. I hope for the best 8)

thefinn

Motion Detector still making lights flicker.

:(

In fact, I'm not entirely sure it's the motion detector - I notice the switch doesn't turn green when this issue happens, just that the light flickers - for whatever reason...

Kinda drives u crazy.

harpo99999

Quote from: thefinn on December 29, 2014, 01:40:15 AM
Motion Detector still making lights flicker.

:(

In fact, I'm not entirely sure it's the motion detector - I notice the switch doesn't turn green when this issue happens, just that the light flickers - for whatever reason...

Kinda drives u crazy.
I also see this with the 1.82 switch, but it only happens after about 1 hour of play time, so it is going to be a bugger to find and fix

Kane Hart

This is for sure going be one the first mods I install! Thank you.

Small addon idea down the road might be some sort of circuit breaker. I really hate that whole overload fire thing with Battery's and might be a unique way to get rid of it for people who don't enjoy that event.

thefinn

Quote from: harpo99999 on December 29, 2014, 04:41:56 AM
Quote from: thefinn on December 29, 2014, 01:40:15 AM
Motion Detector still making lights flicker.

:(

In fact, I'm not entirely sure it's the motion detector - I notice the switch doesn't turn green when this issue happens, just that the light flickers - for whatever reason...

Kinda drives u crazy.
I also see this with the 1.82 switch, but it only happens after about 1 hour of play time, so it is going to be a bugger to find and fix

Yeah it fixes it with a quick (or not) reload. So, might not even be the mod at fault ?

IIzTrollin

Is there a tutorial somewhere on how to use the switches i seem to not know how to use the room detector.

harpo99999

#126
first place a switch,  and do the 'automatic switch' research, and if you want the auto enemy operation or timer operation, then do the time switch research, and for auto enemy switch then the 'automatic enemy switch' research, and left click on the switch, and in the bottom left you will see the swtich modes ie on/off, automatic, enemy automatic on, enemy automatic off, and time on  and time off..
haplo, after a reload of the game that I had started after installing 1.82 switch in the mods stack, I got a large group of the error that I had mentioned before, link to the log/save/world and active mods file https://dl.dropboxusercontent.com/u/8023186/output_log.rar

Haplo

Sorry it took me a while to be back at my computer.
Thank you for the files. I've looked into your output_log file and your crashing error is this one:


NullReferenceException: Object reference not set to an instance of an object
  at Verse.Find.get_ListerPawns () [0x00000] in <filename unknown>:0
  at Injector.hivemind.hivetopawn () [0x00000] in <filename unknown>:0
  at Injector.hivemind.execute () [0x00000] in <filename unknown>:0
  at Injector.injector.Update () [0x00000] in <filename unknown>:0
(Filename:  Line: -1)


This doesn't look like it is a cause from the power switch. I don't have anything named Injector in my code.
Plus the hive name looks like it is most likely caused by this mod: Apothecarius.

harpo99999

Quote from: Haplo on January 02, 2015, 11:15:28 AM
Sorry it took me a while to be back at my computer.
Thank you for the files. I've looked into your output_log file and your crashing error is this one:


NullReferenceException: Object reference not set to an instance of an object
  at Verse.Find.get_ListerPawns () [0x00000] in <filename unknown>:0
  at Injector.hivemind.hivetopawn () [0x00000] in <filename unknown>:0
  at Injector.hivemind.execute () [0x00000] in <filename unknown>:0
  at Injector.injector.Update () [0x00000] in <filename unknown>:0
(Filename:  Line: -1)


This doesn't look like it is a cause from the power switch. I don't have anything named Injector in my code.
Plus the hive name looks like it is most likely caused by this mod: Apothecarius.
that error is from the hivemind in apocatherius(that I have not used(the hive mind part, the rest is used)), and I did not get a crash, just the flickering of lights and heaters attached to power cables isolated by swtiches set to motion detect (room), I have not seen the flickering on switches set to motion detect (distance).
and this is the error
(Filename: C:/BuildAgent/work/d63dfc6385190b60/artifacts/StandalonePlayerGenerated/UnityEngineDebug.cpp Line: 49)

Platform assembly: C:\Users\ross\Desktop\RimWorld\RimWorld657Win\RimWorld657Win_Data\Managed\Boo.Lang.dll (this message is harmless)
Exception ticking PowerSwitch198927: System.IndexOutOfRangeException: Array index is out of range.

  at Verse.RegionGrid.GetValidRegionAt (IntVec3 c) [0x00000] in <filename unknown>:0

  at Verse.RoomQuery.RoomAtFast (IntVec3 c) [0x00000] in <filename unknown>:0

  at ModCommon.Radar+<>c__DisplayClass11.<FindAllPawnsInRoom>b__10 (Verse.Pawn p) [0x00000] in <filename unknown>:0

  at System.Linq.Enumerable+<CreateWhereIterator>c__Iterator1D`1[Verse.Pawn].MoveNext () [0x00000] in <filename unknown>:0

  at System.Linq.Enumerable.Count[Pawn] (IEnumerable`1 source) [0x00000] in <filename unknown>:0

  at PowerSwitch.Building_PowerSwitch.SearchForPawnInRoom () [0x00000] in <filename unknown>:0

  at PowerSwitch.Building_PowerSwitch.Tick () [0x00000] in <filename unknown>:0

  at Verse.TickList.SingleTick () [0x00000] in <filename unknown>:0

Haplo

Ok, that is indeed a problem from the power switch..
Hopefully the new version prevents that error.
Can you try this version and tell me if it works better, please?
PowerSwitch - 1.8.3 (test)

Rock5

#130
You know what's really annoying? Having to place a switch, bit of conduit then the light, for every light you want automated, while trying to avoid accidentally attaching the light to the wrong conduit. What would be great is if there was a light with a sensor. Then you could just attach it like a regular light but it would only turn on if the sensor goes off. Or maybe make it a light upgrade.

Actually you know what would be really great is if you could somehow just add these new controls globally to all electrical devices. I'm assuming there is somewhere where shared attributes of electrical devices is stored, after all all electrical devices have a power switch and it wouldn't make sense to repeat that with very electrical device.
Rock5 [B18] Mods
- Butchers Can Count Meat
- Sun Lamp Planner
- JTZoneButtons
- RimSearch
- JTExport

harpo99999

sorry rocks, but NOT all electrical devices have a power switch, eg refrigerators, freezers, air conditioners, lights(usually have switches remote from the light near doorways),stoves, clocks, solar panel systems, water heaters(in the REAL world at least and usually have a circuit breaker/fuse in the power board/meter box) and for relocatable items they usually plug into a power point that has a switch on it.
but the items that DO have a power switch on them it is usually a convinience item on the most accessable part of the item and frequently does not completely remove power to the item, but puts the item into a lower power state with a quicker startup.

haplo, I will test the new version tomorrow

Rock5

#132
You do realize that I'm talking about the game, not real life? :) All electrical devices in the game, not including power sources, have power switches. So I reasoned there should be a location where this commonly shared button is described. Maybe there you can add extra common buttons such as the sensor buttons. Then again maybe not, I don't know. I would at least love to see a sensor light.
Rock5 [B18] Mods
- Butchers Can Count Meat
- Sun Lamp Planner
- JTZoneButtons
- RimSearch
- JTExport

thefinn

Quote from: Rock5 on January 03, 2015, 05:17:26 AM
You know what's really annoying? Having to place a switch, bit of conduit then the light, for every light you want automated, while trying to avoid accidentally attaching the light to the wrong conduit. What would be great is if there was a light with a sensor. Then you could just attach it like a regular light but it would only turn on if the sensor goes off. Or maybe make it a light upgrade.

Actually you know what would be really great is if you could somehow just add these new controls globally to all electrical devices. I'm assuming there is somewhere where shared attributes of electrical devices is stored, after all all electrical devices have a power switch and it wouldn't make sense to repeat that with very electrical device.

Yeah totally agree, having a light that could do the job of the "automatic switch" would save a lot of screwing around. Especially in rooms where you want a light + have a lot of tables that need power and THEY keep connecting to the light conduit.

Can be annoying.

Haplo

It isn't that easy to integrate the switch in the lights. But I'll take a look into how much trouble it really would be.
And I've released the version 1.8.3 officially. Hopefully it works better with the motion detector.