Space Engineers

Space Engineers

Solar Panel Alignment Script [BROKEN]
Showing 1-9 of 9 entries
Update: 9 Jan, 2016 @ 6:44am

Solar Panel Alignment Script rev8
+ Added message when using block names with commas (,) for rotors that could not be found
+ Added maintenance mode which will - by default - reinitialize the script after resuming normal service. You can toggle the maintenance mode by running the script with the argument "maintenance". (requested by Kamiu Xenom)
+ Rotors with limits will now rotate to their furthest limit once the script enters hibernation mode
* Changed data type of TargetPowerOutput to float and renamed it to TargetAveragePowerOutput
* Applied a fix which should stop solar panels from being aligned perpendicular to the sun (reported by sybersmoke)
* Split hibernation into hibernation (used when the solar panels produce too few power) and idling (used when the solar panels produce more than enough power)
* Elements in RotorNames will now be assumed to be blocks if there's no correspondent element in RotorNames_IsGroup

Source Code
https://github.com/mezzodrinker/spas/blob/master/rev8.cs

Notes
The default values in the comments are not the default values that are used in the script. However, the default values that are written in the comments may also be used as values.

Update: 9 Nov, 2015 @ 7:46pm

Solar Panel Alignment Script rev7
+ Added support for rotor groups. This allows builders to create setups with multiple rotors per axis.
+ Added support for solar panel groups. If used, this script will use the average maximum output of all solar panels in a group instead of focusing on just one. This should increase the overall output when using this script with more than just one solar panel.
* Rotor speeds are now set every time the script possibly modifies the state of a rotor instead of when the script is initialized.

Source Code
http://mezzodrinker.info/highlighter.php?f=SolarPanelAlignmentScript-rev7.cs&l=csharp

Update: 18 Jul, 2015 @ 3:14pm

Solar Panel Alignment Script rev6
+ added Energy Saver feature which should take care of situations where the solar panel(s) might enter the shadows of an object and thus generate no new energy.

Source Code
http://mezzodrinker.info/highlighter.php?f=SolarPanelAlignmentScript-rev6.cs&l=csharp

Update: 26 Jun, 2015 @ 3:58pm

Solar Panel Alignment Script rev5
* small performance, documentation and code style improvements

Source Code
http://mezzodrinker.info/highlighter.php?f=SolarPanelAlignmentScript-rev5.cs&l=csharp

Update: 15 Mar, 2015 @ 2:17pm

Solar Panel Alignment Script rev4a
- reverted changes from rev4

Source Code
https://github.com/mezzodrinker/spas/blob/master/rev4a.cs

Update: 11 Mar, 2015 @ 9:06am

Solar Panel Alignment Script rev4

+ added Exception if count of detected rotors is equal to or less than 0

This version does not work due to a critical error. DO NOT USE!

This version seems to not be compiling correctly when used in-game. The message should be something like "Caught exception during execution of script:Illegal one-byte branch at position 367. Requested branch was: 153". This is a known issue in Space Engineers and I am currently trying to figure out a way to keep this error from happening.

Update (15 Mar 2015 22.00 GMT): I might have found out where the problem in rev4 is. Apparently, the call to rotors.Count in line 84 of the script causes the error to happen. Trying to verify that that is the problem and checking how, if possible, to avoid it.

Update (15 Mar 2015 22.15 GMT): Apparently this problem is caused by any useful code being in the same block as the for loop behind the for loop. Simple assignments (assignments without method calls) work, if statements, constructor calls and method calls don't. This is crazy.

Source Code
http://mezzodrinker.info/highlighter.php?f=SolarPanelAlignmentScript-rev4.cs&l=csharp

Update: 8 Mar, 2015 @ 9:12am

Solar Panel Alignment Script rev3

+ added localization options
+ added default values to variable descriptions
+ increased accuracy
* some code refactoring

Source Code
http://mezzodrinker.info/highlighter.php?f=SolarPanelAlignmentScript-rev3.cs&l=csharp

Update: 8 Mar, 2015 @ 6:54am

Solar Panel Alignment Script rev2

* fixed error with parsing current maximum output with the number of the maximum output being shorter than 5 characters

Source Code
not available

Update: 7 Mar, 2015 @ 3:06pm

Solar Panel Alignment Script rev1

Note: I apparently had to re-publish the script because I couldn't replace it (Space Engineers crashed instead).

+ added custom solar panel support

Source Code
not available