Space Engineers

Space Engineers

Arch's Planetary Local Clock
8 Comments
AenesidemusOZ 29 Jun, 2022 @ 10:19pm 
Great concept! Thanks for doing this instead of, you know, working. ;-)
Walto 14 Jun, 2020 @ 12:38am 
First, thanks a lot !! :D
I'll give it a try in the next few days :)

Then, Waaaaah !!! Easier, sure, but DAMN that's interesting !
Thanks for sharing !
archfalhwyl  [author] 13 Jun, 2020 @ 7:05am 
Update! The script now has scheduling and a way of turning the reset mechanism on and off. I've tested the scheduler as much as I sensibly can at the moment. The algorithm is a bit hairy in places because I insisted on doing it optimally like the fool I am.

(well it's easier than going through this damn paper like I'm supposed to be doing: https://agupubs.onlinelibrary.wiley.com/doi/epdf/10.1029/2005JE002444 )

Walto 7 Jun, 2020 @ 3:13pm 
Oh waw nice :D !
Your new job looks amazing !!

Yeah, I wanted to do that because I have a mobile station which stays a moment at its location sometimes, so it needs to be reseted when I am at my new location, but not necessary for the journey each time my solar panels detect the sun :)

Your future scheduling stuff sounds great too !!
archfalhwyl  [author] 7 Jun, 2020 @ 2:44pm 
Well, I got bored and wrote the scheduling stuff :)

I'll put it up when it's good and tested - the problem with this time-based stuff is you have to sit around for hours in the game to test it!

The basic idea is that you create your schedule in Custom Data, and it might look something like this:

18 0 on MainLight
18 10 off G:Lights
* 5,10,15,20,25,30,35,40,45,50,55 action Door Open_Off

and so on.

The first two parts are hours and minutes, where you can give a number, a set of numbers separated by commas, a range (like 10-20) or "*" for "all". So the first line does its action at 6pm, the second at 6:10pm, and the last at every hour, every five minutes.
archfalhwyl  [author] 7 Jun, 2020 @ 6:09am 
It's the "then do that" part which is hard ;)

I've thought about it, and think I can at least provide "turn block on/off at a given time" and "run program on progblock with argument at given time." That should do for most things. I'll probably put it as Custom Data on the clock's progblock. Something like:

0600 [MyLightGroup] on (groups have [ ] around them)
0600 MyLightBlock off
1200 MyProgBlock run someargument

and maybe add some special commands, like

resetoff / reseton

I'm still not sure why you want to be able to do that!


It might be some time before I get around to this - I've got actual work to do (exciting stuff too - I've just landed a job writing code to help analyse images from the European Mars Rover!)
archfalhwyl  [author] 6 Jun, 2020 @ 11:23am 
I'm not really sure what you're asking for - you want to be able to turn off the 6am reset once it has happened once? Well, I can easily do that, but the clock will drift.

I like the idea of triggering events at certain times and I'll look into it - might be tricky, though, because of how the API works. I'd have to write a huge amount of code to handle every possible interaction with a block!
Walto 5 Jun, 2020 @ 8:55am 
Thank you ! I was looking for something doing this without mod and you nailed it :D !
Is it possible to make the script updating his self by solar panel just once or by a command, so we don't have to rename the solar panel again to avoid the refresh each day cycle ? :)
Lots of ideas can come with your script !
Like, "at 4:20pm -> toggle Timer"
Or past "6pm -> Off the lights"
etc !
Thanks, have a good day commander! :)