Stationeers

Stationeers

(IC Code) Perfect Solar Tracking 2.0 With Reset
62 Comments
Fenris 11 May, 2022 @ 12:44pm 
If I run setting sun orbit 2 instead of default 1 - should I then change anything in the script ?
Right now the script doesn't seem to work
LP 11 Apr, 2022 @ 4:33pm 
Won't run. Multiple code errors. Looks like depreciating daylight sensor modes broke this.
Mokmo 31 Mar, 2022 @ 8:34pm 
So it requires a batch writer circuit per type of solar panel. Could use the sb commands.
Stormfire962 26 Feb, 2022 @ 3:39pm 
@Daniel - Make sure the data port on your day light sensor is facing north. Otherwise it will not work.
Daniel 15 Dec, 2021 @ 9:03am 
soo, uhh, i tryed this and other stuff .. but i never seem to get solar traacking to work .. using this code i got the panels to work but they follow the sun at paralel to the ground ... while my sun is up in the sky .. WTfH am i doing wrong .. pls ... help
Cumu[FR] 1 Nov, 2021 @ 1:39am 
Hello, You don't need batch writer you can command all solar panels with this command:

sb -539224550 Vertical vangle
sb -539224550 Horizontal hangle
Waldo 6 Sep, 2021 @ 1:51am 
ok, it's giving me an error on line 14, or where s DaySen Mode 2
Peptide 1 Sep, 2021 @ 3:52pm 
Use this code here:

[code]
alias DaySen d0
alias writeVert d1
alias writeHor d2
alias angle r0
alias running r1
s DaySen Mode 2
yield
Start:
#Sun up check
l angle DaySen SolarAngle
s DaySen Mode 1
bgt angle 92 Reset
move running 0
#Vertical
l angle DaySen Vertical
sub angle 75 angle
div angle angle 1.5
s db Setting angle
s writeVert On 1
yield
s writeVert On 0
yield
#Horizontal
l angle DaySen Horizontal
s DaySen Mode 2
mul angle angle -1
s db Setting angle
s writeHor On 1
yield
s writeHor On 0
yield
j Start
#Sun not up Reset
Reset:
bnez running Start
s db Setting 0
s writeVert On 1
yield
s writeVert On 0
yield
s db Setting -90
s writeHor On 1
yield
s writeHor On 0
yield
move running 1
j Start[/code]
Peptide 1 Sep, 2021 @ 3:30pm 
@Lammert

Setup wiring as per the video.

For IC just change solarangle in vertical and horizontal sections to Horizontal and Vertical respectively. Make sure its case sensitive etc. Make sure you're exporting to the IC too. I have it working on Mars albeit slightly off angle so will check code.
Lammert 22 Aug, 2021 @ 1:44am 
Can't get it to work even with the tips from @efspock and @Blast
Can someone update the code?
Blast 27 Jul, 2021 @ 7:39pm 
had to change solarAngle in the vertical and horizontal commented sections to Horizontal and Vertical but got it working with a few tweaks
BH0938 4 Apr, 2021 @ 10:45am 
ok I still not getting it correct. Can you message me a pick of the new code or post it?
efspock 2 Apr, 2021 @ 3:48pm 
I was able to get the script to work with a few changes. The daylight sensor no longer needs to change modes to read horizontal and vertical(it can read both at the same time now) so the lines where it changes the mode of the DaySen are no longer required. Also the game stores the values you need in Horizontal and Vertical instead of SolarAngle. After changing those lines it properly tracks the sun(at least on mars). You also have to change the math for horizontal tracking to - 180.
BH0938 26 Mar, 2021 @ 5:54pm 
Anyone have an issue with this working on the Moon? It does not seem to track horizontally correctly.
VisceralDth 21 Mar, 2021 @ 5:29am 
So i'm happy to say that after 10hrs of trying to get this to work I finally succeeded. Thank you for this mod its extreamly helpful
Waffelmonster 8 Mar, 2021 @ 4:41am 
Not Working
Error line 34
8th March 21
ждун 15 Feb, 2021 @ 7:15pm 
not working.
Set and wired up everything like in the video.
It moves only one panel in the array.
It moves it somehow random-like but not facing the sun.
At night it goes crazy rotating randomly in all directions.
Housing is indicating IncorrectLogicType at line 16.

Its the line where it switches mode on sensor. Don't see what might be wrong there, but the script actually runs through despite the error, and i can also watch it on sensor that its actually switching between horizontal and vertical.
jay.jahn 30 Jan, 2021 @ 4:46pm 
Not working 1/31/2021
S.jc9181 20 Jan, 2021 @ 3:12am 
Yeah not working for me since they updated stuff.
Genocide 9 Jan, 2021 @ 10:36am 
Error on line 16 for me. Any thoughts?
Waikiki Tim 31 Dec, 2020 @ 10:50pm 
Berticus603, glad it works for you. :-)
Berticus603 31 Dec, 2020 @ 8:14pm 
Waikiki Tim you are an officer and a gentlemen that works perfect. I took a look and the only difference between my edits and yours was the Horizontal lines 33-34ish with the math.
Mine was off explaining my tracking error when I tried to correct the script myself.
Berticus603 31 Dec, 2020 @ 4:01pm 
Thanks for that will give that one a try and look at the code as well.
Waikiki Tim 31 Dec, 2020 @ 2:17pm 
I just published one that is working for me. I shamelessly used Bushwackah's code as a starting point. It's called WT Solar Tracking... if you're interested.
Berticus603 31 Dec, 2020 @ 1:40pm 
Stopped working due to the changes they have made to the sensors on around 29DEC2020. Been working myself and trying to figure out a change to make it work but so far no luck. I am having issues since this is a script language I don't normally use with my IT work.:steamfacepalm:
boxanata 29 Dec, 2020 @ 2:39pm 
Don't even bother wasting your time with this. It doesn't work.
jammer131 27 Dec, 2020 @ 2:37pm 
@Skybinary this is a IC Memory program script that requires a computer and the IC Houseing to work you would load it like a normal code program
Skybinary 1 Dec, 2020 @ 7:55am 
awwww i really wanted to try this but the only item in the in-game workshop is 'core', its probably a 'me' thing lol, but i am subscribed, are there other steps i need following?
Clavdivs 4 Nov, 2020 @ 9:07am 
@BRINK$TAR, did you get it to work? Because I got the same error when I had the chip in the IC Housing/Computer, but when I moved it to the solarpanels, it worked without a hitch.
rGlory 13 Oct, 2020 @ 6:11pm 
Great job!

Suggestion, as you detect nighttime/daytime anyway can you add code that it would set On to 1 at daytime and 0 on night time on lets say D4 (if it is connected) and probably reverted on D5
BRINK$TAR 30 Sep, 2020 @ 3:35pm 
i have done the changes for line 15 and 25 still not working plus tired gg natas code get error line 16 ??? any help with gettting solar going cheers
Barbarian 6 Aug, 2020 @ 11:45am 
[GG] Nãtã§-[FLM]- Thx man. I had the same problem on Europe, but your corrections helped. Now it's 98-99% all day long.
[GG]Nã†ã§-FLM- 15 Jun, 2020 @ 3:26pm 
here is the pastebin link for my edited code https://pastebin.com/U5bLN7MX
[GG]Nã†ã§-FLM- 15 Jun, 2020 @ 3:24pm 
i am playing on Europa and had to modify the code as it would track fine but when the sun went down the solar panels would go crazy for about 1/2 the night.
[GG]Nã†ã§-FLM- 15 Jun, 2020 @ 3:24pm 
if anyone would like to use my edits untill @Bushwackah can update his you are more then welcome i take no credit for this code and @Bushwackah if my changes are good your are welcome to include them into your code no credit needed.
Waikiki Tim 31 May, 2020 @ 2:57am 
I found the problem, I'm not sure if it's clear from reading the comments below, but... change line 15 to s DaySen Mode 1 and change line 25 to s DaySen Mode 2 . Essentially, they're backwards when you download it from the workshop.
Waikiki Tim 30 May, 2020 @ 7:37pm 
@calgorn, I've had that happen a lot when I'm struggling to set up solar. I think it happens when it tries to set the angle to a negative number. And that means something is still not set up right. Keep checking every setting (or daylight sensor position) until you find the one that's wrong. If you're willing to publish your save, I'd be willing to take a look at it.
calgorn 30 May, 2020 @ 1:23pm 
I got all this set up and my solar panels freak out. They don't track the sun, they just cycle from one extreme to the next then reset and loop. I've tried various suggestions from both Perfect Solar posts and cant get it to work.
Waikiki Tim 26 May, 2020 @ 10:12pm 
Turns out all I had to do was select my IC Housing from the drop down list... even though it showed as already selected and there was only one.
Waikiki Tim 18 May, 2020 @ 2:53am 
After struggling with this for a while, making changes, exporting, etc. I finally did an import from the chip. It was still the same code as the original. So, I created a new script and copied the code into it and made my changes. Using that version worked for me... mostly. It seemed like it tried to do the reset a few times during the day. Other than that, efficiency was 98%-100%.

I ended up using the no-reset version of this since I'm behind a mountain and the solar panels are in place by the time the sun comes over it.
Rawblin 16 May, 2020 @ 7:49am 
Switched to using "UfoL's Solar Tracking" since he has updated it and it is working perfectly. If you previously had been using this, your daylight sensor should be facing upwards, with its connection on your North. If that is the case, set your 'HOffset' variable in UfoL's script to "0" (zero) from 90. Make sure you have the vertical and horizontal batch writers set properly in the D1, D2 of your IC housing, and you should be working perfectly again.
Orca 16 May, 2020 @ 5:51am 
still broken even after editing the s DaySen Mode 2" Needs to be Mode 1, and Horizontal needs to be Mode 2.
Troll 15 Apr, 2020 @ 6:55am 
Naxster

thanks
^^
Naxster 14 Apr, 2020 @ 6:20pm 
Bushwackah. I think the daylight sensor modes got swapped. "#Vertical
s DaySen Mode 2" Needs to be Mode 1, and Horizontal needs to be Mode 2. I swapped these in the editor and it's working agian.
KindThing 12 Apr, 2020 @ 1:12pm 
I have an error on line 16?!
It doesnt seem to be tracking the Sun correctly. I have it set up they way you have shown in you YouTube Tutorial...?? Could you pls help?
Owngalaxie 7 Apr, 2020 @ 1:59pm 
I had some success with Bushwackahs other script (no reset) with a yield after the s"set" and l"oad command for the daylightsensor. It works fine for me again with no other changes at 97-99% eff.
Macgunius 6 Apr, 2020 @ 9:49am 
I found the fix update of the script. search at "Bushwackah's Perfect Solar Tracking- Fix"
Rawblin 5 Apr, 2020 @ 4:23pm 
Shdwdrgn, I did that earlier and it tracks, but it errors out at nighttime with a line 16 problem. Didn't wait to see if it started properly tracking the next morning though.