[1.2] PowerSwitch

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

Previous topic - Next topic

asquirrel

Quote from: Haplo on January 18, 2017, 03:40:38 PM
Sorry, I've forgotten to update the Forum, so here it is:

The UPDATE to Alpha 16
Better late then never... 8)

Holy carp!  Thanks man!! :)

gendalf

it looked useful until I've realized that pawns don't actually go to the room if the workbench is turned off, because they can't access that workbench, which makes motion detection in rooms only usable for AC, lamps and multianalyzer.

Vetrogor

Enemy detection doesn't work usefull. When raid occures I draft all colonists with single button (thanks to Defensive Positions mod). Nobody able to swich when drafted. I need to  manualy undraft one colonist to switch. And then I need to watch on him. If I not draft colonists I loose time. So I forced to check every colonist to find who is flicking and then draft others. After few times I just forget about this function. It should work fully automatically, IMHO.

Motion detection works fine but colonist can't do their jobs when power is off. I just use timer instead.

Hidden conduits are very good!

Canute

Maybe Repower https://ludeon.com/forums/index.php?topic=30734.0
Is what you are looking for, it lower power cost for idle table.


Vetrogor


oreganor

#275
Hi, Haplo, maybe it's a bit strange question but...

...Is the source code provided in the download up-to-date?

Some extra background: I finnally want to learn how to dig deeper into Rimworld modding so I decided to start a small project to make your powerswitch into an OR system, were diferent modes could be active at the same time... Nothing too fancy (In fact you can build this ingame just linking different switches on different modes to the same "root" were you link the rest of the items requiring "selective" powering), and inspecting your sources, should be really easy but, I repeat, I consider this my "tutorial" on how to get things done.

OFC, I'm in the 1st step... Which is configuring my IDE (VS 2017) and trying just to compile your source code to get your original .dll, to be sure eveything is set up in the right way. I'm getting some errors probably because I'm not referencing properly the 2 extra dlls needed, so I'm trying to figure out were I made the mistake (I see all Verse related classes on the object inspector... But for some reasson at compiling time, for example, "public override void SpawnSetup()" is refusing to acknowledge that the base class, in fact, has it) but...

...I'm also getting errors related to some members, the most notable Find, which have some members converted to lists (For example, Map -> Maps on A16)...

...So to fight problems one at a time and as, obviously, your mod is working happily on my A16 game, I wanted to be sure sources were synched with the .dll, before banging my head against the wall while trying to find the obscure options I'm not using correctly to be able to compile :).
Contributions:
Melee Skill Rebalance

Haplo

#276
Hmm, now that you ask.. I think I've forgotten to update it.. Sorry 8)

Here is the correct source file

[attachment deleted by admin due to age]

oreganor

#277
Ah man... Sweet, thanks a lot. I must admit that curiosity took the better of me and I already got a powerswitchOR working with the old sources on my A16 game :).

But I will redo the modifications starting from your own migration to A16, more "practice" using an expert code as guide is very satisfying and quite enlightening.

EDIT:

The new powerswitchOR are happily working now on my A16 colony.

Over the course of the tests I stumbled on an oddity, any electrical producer that comes with a default cable net (In my example was a Solar Panel) is superposing itself to the hidden power conduits (Instead of removing them as it happens with the regular conduits), this triggers a cascade of constant yellow warnings on the log about duplicated power in a cell each time a powerswitch changes (which I assume that, as it reconfigures the network it's linked to, also triggers all kind of checking events on the whole net). Not crippling, but I suppose you would want to know about it.
Contributions:
Melee Skill Rebalance

Modo44

The timed power switch is preset to 06:00 through 20:00 instead of what the mod description says. It's a minor inconvenience to adjust it to 05:00 through 19:00 for correct plant growth timing. Maybe you could fix that for the next release.

Haplo

This time as soon as possible:
The PowerSwitch is UPDATED to Alpha 17!

Th3Eagle85

Haplo thank you for this great mod. I just enjoy seeing all the lights flick on/off when pawns enter/leave the rooms and how it enables me to select certain times zones for research/production/etc.

The only thing I noticed not working correctly is the on/off for enemy detection. Instead of flipping the switch it requests an pawn to switch it on/off. This might be intentional, but from the description it seems it should work the same as normal pawn detection.
0
I tried to make some changes (no experience just looking at the code and trying to make sense of it all, it looked as if "flickableComp.SwitchIsOn = true; // No designator usage!" was missing in the enemy detection criteria since it it present in the pawn range switch) in the "Building_PowerSwitch.cs" source file but the changes are not showing up in older or new save games.

If you have the time (and desire) could you confirm if this behavior is intentional or a bug and if it is a bug help solve the issue?

Canute

So far i remember, there is a button to switch from friends to enemies. I think it was green for detect friends you need to switch to red for enemies.

Th3Eagle85

Quote from: Canute on August 13, 2017, 01:19:12 PM
So far i remember, there is a button to switch from friends to enemies. I think it was green for detect friends you need to switch to red for enemies.

You correct, these are options when the switch is selected. When selecting the enemy detect, this switch info will indicate that enemy selection is on. When an enemy is within the detection range the switch will initiate the on/off event, however it will not turn on automatically and ask a pawn to flip the switch.

With detection options for a friendly pawn (in a room or 7 grid distance) the switch is turned on/off automatically. I am assuming this should be the same behavior for the enemy detection and that there is a bug in the code.

Maladapted

Anyone got the zip for powerswitch 16.2? The nexus downloads don't work.

harpo99999

Quote from: Maladapted on September 03, 2017, 02:05:54 AM
Anyone got the zip for powerswitch 16.2? The nexus downloads don't work.
did you try the yellowish text just above the nexus link? (this starts a download for me