[1.2] PowerSwitch

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

Previous topic - Next topic

Haplo

PowerSwitch



Description:
This mod expands the available power switch with a few automatic functions.
It also adds hidden conduits with improved statistics.

You start with a simple power switch, which can switch the power transmission through it on and off.
The additional features need to be researched.
After you've done your tinkering you'll have the following functions available:
-Manual switching
-An automatic pawn in room switch on
-An automatic pawn nearby switch on
-An automatic enemy found switch on
-An automatic enemy found switch off
-Timed switching (programable)
    Repeat clicking on the UI to change the times.
    The set times are shown in the description

-Hidden power conduits are also available through research

Modder:

Download:

Pre-Beta 19 versions can be found on



Screens:



How to install:
- Unzip the contents and place them in your RimWorld/Mods folder.
- Activate the mod in the mod menu in the game.


Issues/Notes:
-Additional features need to be researched.
-Don't connect a consumer (lamp, turret,..) directly to the switch.
When it is switched off, the consumer will automaticly reconnect to the next available transmitter.
So add a power conduit or a wall and let it connect there instead.

If you find a bug or think that something should be changed, please don't hesitate to tell me.


Description:
- Manual On/Off: Base functionability, available from the start
- Pawn Detection in Room: Available after research with the normal switch. Detects, if an Pawn (human, animal) is in the room
- Pawn Detection within 7 squares: Available after research. Normal pawn detection mode for wall switches. Normal switches can be switched between this mode and the pawn in room mode by repeatedly pressing the selection button.
- Enemy detection (within 1/3 of the map): Available after research. Available modes: Switch on when detected and switch off when detected.
- Timer: Available after research: Switches on and off at specified times. Time is initially set to 19h->On and 5h->Off. This can be changed by pressing the buttons repeatedly.


Credits:
- Special thanks to iame6162013 for the wonderful idea of the invisible wires.


Permissions:
This mod and it's source code is released under the Creative Commons License Attribution-ShareAlike 4.0
Ludeon has an exception clause. ;)
For more info about it take a look into the About folder.

Zack_Wester

Looks so good downloading it.
Also can you make an power Line version of the cable you know an Utility pole? cos it fells kind of odd when I build rooms as small houses separated from each other and I have to put the power line of the floor/ground.

Haplo

Hmm, right now I'll rather not do that.
I know of a mod thats at work right now, that makes something like that.
You just have to wait a few days/weeks but what I know, it looks really promising :)

rsdworker

nice :) i like it a automatic switches

Psyckosama

Is a time of day switch possible?

Haplo

I think so. I haven't tried it yet because it has already four buttons, but i don't really see a problem with it.
Maybe I'll take a look into it. What times of day do you prefer? (As I most likely have to program them into the dll. Still haven't worked out a way to transfer a new data value from the XML to the code)

ousire

I think a time of day switch would be best so it would send power at night. The only time I can think of where power depends on what time of day it is would be for stuff like sun lamps. When it's day out, you don't need the lamps on after all. At night time though, that's when you would want to turn on all the lamps to grow crops and turn on any outdoor lights for any colonists out at night.

As it is, it's quite easy to manually toggle all your grow lights by wiring them to a single on/off switch, so I don't have any real complaints for this mod. This is something I think we've all been wishing for a long time!

Zack_Wester

Quote from: ousire on April 11, 2014, 10:43:03 PM
I think a time of day switch would be best so it would send power at night. The only time I can think of where power depends on what time of day it is would be for stuff like sun lamps. When it's day out, you don't need the lamps on after all. At night time though, that's when you would want to turn on all the lamps to grow crops and turn on any outdoor lights for any colonists out at night.

As it is, it's quite easy to manually toggle all your grow lights by wiring them to a single on/off switch, so I don't have any real complaints for this mod. This is something I think we've all been wishing for a long time!

You know that could be useful later down the line like when some one desids to build an working computer in game.
Just look at Minecraft.

StorymasterQ

I like how this game can result in quotes that would be quite unnerving when said in public, out of context. - Myself

The dubious quotes list is now public. See it here

Vas

If it looked better than a green/red dot, I might consider using it.  :P
Click to see my steam. I'm a lazy modder who takes long breaks and everyone seems to hate.

confusedwings

I like this mod i'm only missing 1 part...

Is it possible to add a 'sun sensor'?
This thing would activite when there is not enough sun (for example it wil let power true to a sun lamp when the sun is to weak to let plants grow.)

A other option but think this would be to hard to make is a 'Timer Switch'.
With this item you can select for every hour if it's turned on or of...

sorry i make spelling mistakes i'm not english but i try to do so

Haplo

#11
@StorymasterQ: Nice Comic  ;D

@Vas: I'm no designer. So if you feel that it could look better, how about I provide the source psd-files and you make me some better looking ones? ;)

@confusedwings: I am thinking about doing the day/night Switch. It would Switch Off at 5 and On at 19. Hmm, maybe a selectable timer is possible.. I'll have to try it..
Alternatively I could try to detect if it is lit or not, but that would maybe do a on/off-Loop when in range of a lamp..

But first I have to try, if the GUI accepts more than four Inputs now..

jamieg

love how last week this was just a manuel switch.... soon it will be a super computer thats built to lower your electric bills :p
YES! Its true! im updating The BIG BANG mod pack check it out here: https://www.youtube.com/watch?v=orzLZbECR20&list=UUr1sEPUEhFqy01q16zGisIg

confusedwings

Hmm... i was just reading the post of JAMIEG and was thinking... maybe this 'timer' needs to be researched en then a kind of pc needs to be build...

If it is possible to name lights you could even use that computer to edit every light in your game in a central point... offcourse that point would use power on his own ^^ nothing is for free :p

if 'personal' timing of lights is possible it should also needs to be researched :p

sorry for my english... again if i make mistakes...

Haplo

I'm with you with the research part. Not so much with a central computer needed.
If you take a look at the timers used today they are always rather small and directly where they are needed. So why make it unnecessary difficult to control them?
And no, I won't build a computer yet ;)
PS: The Timer code is already prepared. Just need a few days to make new GUI buttons. I'm not so fast with grafics :)