Space Engineers

Space Engineers

Not enough ratings
Nightlight - Automatic light switching during day/night
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
3.277 KB
28 Aug, 2016 @ 10:02am
16 Jun, 2019 @ 6:09am
6 Change Notes ( view )

Subscribe to download
Nightlight - Automatic light switching during day/night

Description
This script turns all your Interior & Spotlights on in the night, and off during daytime. - Completly automatic without mods

Functions:
  • Automatic lights at night
  • Configurable trigger(light strength)
  • Overwrite function for battle
  • Interior and Spotlights
  • Custom prefix
  • Switchable prefix

What you need:
  • Lights ^^
  • Programmable block
  • Solarpanel

Setup:
[In the script]
42 Comments
erik 16 Feb @ 12:36pm 
good evening no longer works an update maybe
Demonik 15 Nov, 2023 @ 1:33am 
@ Commander Rotal I have the same error now too. Did you end up fixing it?
Capt Fuzzy 19 Jan, 2023 @ 5:33pm 
I don't think this is working...
Either I'm just not understanding how this works or the setup instructions are lacking in a proper explanation of what to do and how to do it.
It doesn't seem to be working though, at least not as far as I can tell, anyway.
I'm getting no compiling errors, or errors that I can see, period.

Some of my questions:
What exactly is 'light strength'? Is it a factor of energy output in some way?
Where does the prefix go? On every light that you want controlled?
Will this work with groups of lights?
When setting up the triggers in the timer block, does it matter what order they are in, i.e., timer block first then PB, or vice-versa?
Commander Rotal 3 Feb, 2020 @ 11:27am 
I don't think i've messed with that; last thing i tried was just placing down a completely new setup (new Solar Panel, new Programmable Block etc); first i just checked if it worked without the NL prefix; same error message. Then i tried with the NL prefix as usual; same result.
ThatsEli  [author] 3 Feb, 2020 @ 11:21am 
Mmm, I just checked the script on my end and it seems to work fine for me. Due to the stack trace, the error seems to occur while computing the current solar output. Did you check if the measureSolarPanelName config value is set correctly?
Commander Rotal 2 Feb, 2020 @ 9:53am 
Question, old chap; a while ago the script randomly stopped working both when i try to set it up anew and when i just paste in older buildings i KNOW for a fact should work as they are. Any chance you could take a look at this error message?

Caught exception during execution of script:Object reference not set to an instance of an object.
at Program.getSolarPower()
at Program.Main(String argument)
at Sandbox.Game.Entities.Blocks.MyProgrammableBlock.<>c__DisplayClass46_0.<ExecuteCode>b__0(IMyGridProgram program)
at Sandbox.Game.Entities.Blocks.MyProgrammableBlock.RunSandboxedProgramAction(Action'1action, String&Response)
roughnecks 19 Nov, 2019 @ 9:51am 
OK, got it working so far, will have to wait for the night and check if it's still going.
Thanks for the script :)
roughnecks 19 Nov, 2019 @ 9:36am 
Oh, there's a timer block, apparently. Will give it a go soon.
roughnecks 19 Nov, 2019 @ 9:24am 
Hello, I loaded the script, left all the settings alone, since they looked fine to me and run the script but my lights still stay on during the day.

Also, how do I setup a timer? I'm really new to SE. Thanks
Commander Rotal 22 Jun, 2019 @ 5:25am 
Oh, it's a delight. Pun intended.