Stationeers

Stationeers

119 ratings
(2024!) Easy Free-form Solar Tracking (New Feature!)
6
3
2
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
3.256 MB
18 Oct, 2019 @ 9:13pm
6 May, 2024 @ 5:03pm
11 Change Notes ( view )

Subscribe to download
(2024!) Easy Free-form Solar Tracking (New Feature!)

Description
May 6, 2024
Finally updated! (Or, "I'm not dead yet!")

Better yet, I've added a great new feature I've always wanted to see.

TLDR: Now you can place solar panels with ports facing ALL DIRECTIONS simultaneously! All on the same set of cables, running on a single IC!

--- 2024-05-06 "Freedom" Update ---

I've had a lot of time sitting around due to a back injury (yay), and so I've finally been able to update this to work with all the changes over the last couple years.

In learning about the new features added to MIPS since I last played Stationeers, I found the ability to batch-address devices BY NAME. I had a feeling that would allow me to implement a really nice feature I'd wanted for a long time... and here it is:

Free-form solar panel placement.

Use a labeler to name your solar panels according to what direction their power port is facing. That's it, unless you want to use a naming convention different from the defaults in the script.

The script looks for all four moveable solar panel device hashes (single, dual, reinforced single, reinforced dual). It will send a default horizontal rotation to any panels that haven't been renamed, based on the old port direction config setting, and then it will send an appropriately modified horizontal rotation to any panels with names matching the four name hash entries in the config section.

For example, if you want to run half as many cables, you could put solar panels on both sides of each run. Rename those on one side to "Solar Panel East" and those on the other to "Solar Panel West" (if using the defaults in the script).

All of them will correctly track the sun (assuming the daylight sensor's port direction is entered correctly).

I can't be the only person who's excited to have this feature, right?? :D

--- Main Description ---

This two-axis solar panel tracking script improves on others in several useful ways.

Free-form placement! Name each solar panel based on which direction the port faces, and it all just works. No more rigid rules forcing you to place each panel exactly the same way. Save lots of cabling, cram solar panels in wherever you have room... It's up to you to take advantage of the creative freedom this allows.

Night Parking! When the sun goes down, solar panels reset to face east and stay there so that in the morning, even if the battery running your IC goes dead overnight, they're already in position to recharge everything. (Parking now engages when the sun is 5 degrees below horizontal, because panels may still receive useful light for a short time.)

Easy configuration! Just tell the script which direction your daylight sensor and solar panels are rotated with two simple configuration lines near the top. Name any panels that aren't placed in the same orientation as the basic config setting, or completely ignore that second config line and just name all the panels as you build.

Recognizes all panel types! No fiddling around with looking up arcane hash values and searching for the right place to edit the code to make it work. No returning to edit the script when you upgrade from standard to reinforced panels. Use standard and reinforced panels simultaneously, even!

Thoroughly commented! Learn how it all works and start writing your own code.

--- Basaic Configuration ---

First, check which side your solar panels' POWER ports are on. (If you are using a two-port (Dual) variant, ignore the data port. Find the lightning bolt symbol.)

Look in the direction the panel's power port is pointing. You want the port going away from you, not toward you. Then check the compass heading on your HUD. Convert to North/East/South/West. Perhaps obvious stuff for most, but just a reminder:

close to 0 or 360 is North
around 90 is East
around 180 is South
around 270 is West

Find the same information for your daylight sensor's port. (Make sure the sensor is mounted face-up.)

Open the IC code in your IC editing computer or laptop and look for the first brightly colored lines (shown below).

define SensorPortDirection 0 # Daylight Sensor
define PanelPortDirection 0 # Solar Panels

On both lines, change the number to one of the following, to indicate which side of the device the port is on (remember that the direction of the two-port solar panel's data-only port will not work, enter the power port's direction):

0 for North
1 for East
2 for South
3 for West

Once the right values are in, confirm the changes and export the code to your IC.

Be sure to configure the screw for the daylight sensor on d0.

You may need to pull the IC out of the housing and put it back in, if the housing was powered on before the screw was properly configured. The housing may be flashing an error light if this was the case. Pulling out the IC resets the error and allows it to restart from the beginning.

--- Free-form solar panel placement ---

To use this feature, simply rename your solar panels with a labeler.

First, check the direction of a panel's power port as above. Name the panel "Solar Panel North", "Solar Panel East", etc, based on this direction. You can select a name in the Labeler entry box and copy it out with CTRL-C, then paste with CTRL-V, to avoid typos and make the process faster.

If you want to use a different name format, you can change the names it looks for in the config section of the script.

Be careful to only enter unique names on each line. If you accidentally put the same name on two lines, this could result in very confusing undesired behavior that might be difficult to diagnose. For this reason I recommend against using any of the default Stationeers solar panel names on these lines.

--- Troubleshooting ---

There are a few error codes the script will generate if not properly set up in certain ways. If the error light is flashing and the base displays a four-digit value see below. (Other reasons for a flashing error light still exist that are not under the control of the script, and I can't generate a helpful error code for those, sorry!)

9001: No daylight sensor was assigned to d0 when the IC housing was powered on. Make sure the sensor is connected and properly assigned to d0, then reset the IC by removing and reinserting it.

8001: One or both of the script's two configuration settings are outside the valid range. Check the configuration instructions and try again.

"Help! I've done everything right and my solar panels aren't pointing at the sun!"

The hardest mistakes to catch are the ones we're certain we didn't make! But getting everything exactly right every time is impossible. Start by checking everything one step at a time, starting with where the sun rises or sets and where all the ports are. And be careful that the configuration changes you make have actually been confirmed and exported to the IC you're currently using, not canceled or sent to some other IC. Also check the naming of your solar panels and make sure it matches the config (Copy and paste to be sure).

If you've done all that and are still having trouble or can't figure out how to fix an error message, please leave a comment providing as much detail as possible about the construction of your solar panels and logic setup and the configuration of the script, and the error(s) or incorrect behavior you're seeing. A screenshot showing as much as possible of the setup is quite helpful in ruling out possible causes.

And please be patient; I try to respond as soon as I see comments, but I'm pretty busy and Steam's only indication of new comments seems to be a little green number in the corner of the main window, which I don't have open very often.​
83 Comments
Tallinu  [author] 18 Apr @ 4:01pm 
LimZZ, you might be able to find a combination of sensor orientation and config setting that would work on certain walls, but I can't guarantee it, or make any claims to its reliability. Test thoroughly, through all parts of the day (and preferably setting the world's "number of days passed" to something in later seasons as well) if you attempt that.

I usually just have the sensor on the floor next to or in between some of the solar panels. You can even leave it floating in the air by removing the wall or frame you used to mount it, if you like.
kaseyper 23 Mar @ 11:38am 
works perfect, thanks man.
LimZZ 20 Mar @ 7:16am 
Can I put a solar sensor on the wall?
Tallinu  [author] 13 Mar @ 2:04am 
Frogwizard, I can only assume one or both of the config settings were not correctly set. The one for the daylight sensor is always needed even if you're naming your panels, if that helps.

Dragon Fire, I have absolutely no idea what the library issue is, sorry. I'm glad you were able to get the script working despite that problem!
Tallinu  [author] 13 Mar @ 1:56am 
Skunk, sorry, I have no idea what the math to make a wall mounted solar panel track the sun properly would be, but I know it would require five times as many different calculations and five times as many names to go through (because there are four different walls you could mount them on, plus the floor, and the math would have to be different for each). The script is already just barely within the code size constraints of the IC10, as well as just barely within the 127 instructions per tick limit. I already had to abandon one minor convenience feature I'd wanted because I couldn't squeeze everything in, and that was just a handful of extra lines.
Skunk 3 Mar @ 11:51pm 
Hello was wondering if you could make you script work with wall mounted solar panel. I tried to mess around in the scrip to add wall mount north south east west like you did and the math but cant figure it out.
Dragon Fire 813 18 Nov, 2024 @ 10:56pm 
Script works great btw.
Dragon Fire 813 18 Nov, 2024 @ 5:16pm 
So I don't know what the issue is, but for some reason this IC code doesn't show up in the library.
I've un/re-subbed several times, restarted the game several times, and manually deleted the workshop files to no avail. Luckily as a work around I was able to copy the code from the workshop file and paste it in the IC editor.
Frogwisard 10 Nov, 2024 @ 11:17am 
Im trying to use this script but not getting something. My Example; all the power ports are facing east. the data port on the sensor is facing east. i put the chip in and when the sun comes up, they all turn north and are not getting 100% productivity. at night, the panels turn to the east waiting for the raising sun...
Tallinu  [author] 9 Nov, 2024 @ 1:34pm 
WRXOace, NoShotz, glad to hear it!

Golden Dragon, I know what you mean, I do wish I could've added that option. Maybe if we get an ability to put more code into an IC again in the future I might revisit that!