Overview
This is a full guide that will explain all the features of my Solar Alignment script.You can find the script here: http://steamcommunity.com/sharedfiles/filedetails/?id=699142028
Basic setup with rotors
The basic setup is very easy. You just need a programmable block with the script and a group of your solar tower rotors named: “Solar Rotors”. Below you have a step by step description of what to do:
- subscribe to my script in the workshop (see link in the title)
- create a terminal group named ‘Solar Rotors’ that contains all the rotors of your solar tower
- build a programmable block
- open it in the terminal
- press ‘Edit’
- in the new window, press ‘Browse Workshop’
- select my script ‘Isy’s Solar Alignment Script’ and press ‘Ok’
- the code now appears in the window
- press ‘Check Code’ and ‘Ok’ in the popup window
- press ‘Remember & Exit’ and you’re done
The script is now running with its basic settings and your solar panels should start aligning.
For a more visual, video guide, watch my quick setup video on youtube:
Note: Game has to be in experimental mode and ingame scripts have to enabled in world options!
How to do that, I explained here:
Basic setup with gyroscopes
Since version 4.0.0 my script supports gyro mode. The idea of gyro mode is to rotate a whole ship or station with gyroscopes instead of rotors. For this to work, you need a reference block like a cockpit or flight seat.
Below you have a step by step description of what to do:
- subscribe to my script in the workshop (see link in the title)
- create a terminal group named ‘Solar Reference’ that contains your flight seat or cockpit
- build a programmable block
- open it in the terminal
- press ‘Edit’
- in the new window, press ‘Browse Workshop’
- select my script ‘Isy’s Solar Alignment Script’ and press ‘Ok’
- the code now appears in the window
- in the config, search for “useGyroMode” and set the value to true
- press ‘Check Code’ and ‘Ok’ in the popup window
- press ‘Remember & Exit’ and you’re done
The script is now running with its basic settings and your solar panels should start aligning.
For a more visual, video guide, watch my tutorial video on youtube:
Gyro Mode
Gyro mode uses all gyroscope found on the same grid as the programmable block to rotate the whole ship. It needs a reference block that acts as an orientation for the gyro overrides. This usually is the cockpit or flight seat of your ship but it can be every passenger seat that is pointing to the forward direction of your ship as well.
To get the best efficiency and alignment, you should build all your solar panels in a way, that they are facing in the same direction. The script can work with differently attached panels but will never find the one sweet spot – just like if you had eyes on the back of your head: only one pair of eyes can see the person in front of you 😉
As gyro mode is designed to work in space, some feature of the rotor mode are not available:
- night mode
- rotate to sunrise
- time calculation
- triggering external timer blocks
Also, every commandline argument except ‘pause’ is deactivated for gyro mode because they were designed for rotor mode.
Night Mode
The script stops all rotors during the night to avoid unnecessary movement. To be better prepared for the next day, the panels are rotated back to an automatically calculated angle that is based on the first succesful sun lock of the day. If you want to set these values yourself, you can do so by setting manualAngle to true and adjust the angle values.
Power fallback
With this option, you can enable your reactors or hydrogen engines as a safety fallback, if not enough power is available to power all your machines or if the battery charge gets low. By default, all reactors and hydrogen engines on the same grid will be used. If you only want to use specific ones, put their names or group in the list.
By default, fallback devices are activated on low battery (less than 10% left) and on overload (more than 90% of the max output used). The overload activation will kick in, if the overall power usage of all batteries, solar panels and wind turbines exceeds the set value (default 90% of the max output).
You can enable or disable features by setting their values to true or false. You can also change the tresholds to fit your needs:
Base Light Management
The base light management uses a built in time calculating mechanic to switch the lights on or off. 50% of the maximal detected output is considered sunrise/sunset. It works great on planets but poor in space where it is practically eternal day.
Setup options:
- set baseLightManagement to true in order to activate the light management
- wait for at least a full day night cycle until the script has calculated the location based time or use simpleMode
- tweak lightOffHour and lightOnHour or the simpleThreshold to your likings
- if you only want specific lights to be toggled (by default ALL lights are toggled) create groups for them and put the groupnames in the script
- Example: string[] baseLightGroups = { “Interior Lights”, “Spotlights”, “Hangar Lights” }
Command Line Arguments
Type in these arguments in the argmument line of the programmable block or after you pulled down the programmable block to the hotbar of your button panel or flight seat and chose “Run”.
Pause the script execution and stop all rotors or gyros:
Resume the script execution:
Force the rotors to search for the sun by rotating the panels without locking them in place. After a while, the angle of the best found output gets applied to the rotors:
Set the rotors to a user defined angle and continue the script. The order matters here. If you want to rotate your vertical rotors first, use ‘rotate v# h#’ and ‘rotate h# v#’ to rotate the horizontal rotor first (# will be a rotor angle in degrees). If you only want to rotate one axis, use ‘rotate v#’ or ‘rotate h#’.
The same syntax as explained above apply to the ‘rotatepause’ command which basically does the same as ‘rotate’ but pauses the script afterwards.
Reset the calculated location time:
Rotor Correction Feature
If the rotors of your additional towers are facing the wrong way after using the command line rotation or the manual night mode angles, you probably built your tower not exactly like the first one. To compete against that, you can use the rotor correction feature.
Just add [90], [180] or [270] to your rotor names to shift the rotation for the respective degrees, for example:
‘Rotor Solar [90]’
Trigger external timer blocks at specific events
You can trigger external timer blocks for further automation at specific events. All these events are time based and work with the location time feature which makes it not possible to use this feature in space.
To start off, you have to set triggerTimerBlock to true. The timer blocks will be triggered with the action “Start” which takes their delay into account. Every event needs a timer block name in the exact same order as the events. Calling the same timer block with multiple events requires it’s name multiple times in the timers list!
Events can be:
- sunrise
- sunset
- a time like “15:00”
- a number for every X seconds
The following example will trigger “Timer 1” at sunrise and sunset, “Timer 2” at 15:00 and “Timer 3” every 30 seconds.
LCD Output
The following topic explains, how to use LCD panels (regular and block LCDs) of my script. Whenever you add one of the following keywords to a LCD name, the keyword gets transformed to the universal [IsyLCD] keyword. In the custom data, you can then set different options about the LCD as well as the screen, the information should be shown (on blocks like cockpits, programmable blocks and so on). The custom data will look like this:
@# KEYWORD
@# stands for the screen, the information is shown, where # is the screen identifier number from 0 to the max number of screens – 1. A programmable block for example has two screens: The main screen and the keyboard. Both can be used to show the script informations (screen 0 and screen 1). To change the screen, you want to show your informations, just edit the screen identifier number in the custom data.
It is also possible to display informations of different scripts in one block by using this syntax (MMaster’s Automatic LCDs 2 uses the same syntax and all of my other scripts).
Main LCD
You can display all the main script informations like type solar panel efficiency, battery charge, tank fill levels and location time on the main LCD. Just add the following keyword to a LCD name:
ISA-main
To be clear: it is exclamation mark, capital i s a (for Isy’s Solar Alignment). You can enable or disable specific informations on the LCD by editing its custom data.
Compact LCD
You can show compact statistics on smaller screens like corner LCDs or block type LCDs. The information shown is basically the same as on the main LCD but doesn’t waste as much space. This replaces the old corner LCD output.
ISA-compact
You can enable or disable specific informations on the LCD by editing its custom data.
Warning LCD
You can display all current warnings and problems on a dedicated LCD screen. Just add the following keyword to a LCD name:
ISA-warnings
Performance LCD
You can display the script performance (PB terminal output) on a dedicated LCD screen. Just add the following keyword to a LCD name:
ISA-performance
Settings for enthusiasts
In my config section there are some settings for enthusiasts that drastically change the way, the script performs. I highly recommend that you don’t change anything there unless you know exactly, what you’re doing.
See the code snippet below:
Debug Panel
You can enable a debugging panel for my script that shows very technical information about the script, its instruction counts and execution times. In the config section you can change the name of the panel as well as the information that should be shown: