Solar Alignment for Fixed Solar Panels
О материале
«Solar Alignment for Fixed Solar Panels» — материал мастерской Space Engineers. Моды, чертежи кораблей, скрипты и миры для Space Engineers. Данные Steam, описание автора и ссылка для установки через подписку. Совместимость редакцией не проверена.
Описание автора
2017-11-17 Update: No longer needs a timer block. If you had one before, I recommend you "disconnect" it from the prog block (remove all its actions) to reduce surprises.
This script keeps your ship's (fixed) solar panels aligned with the sun by manipulating its gyros.
Main Features
-
Works with any number of axes. By default, operates on pitch and roll.
-
Adapts to any number of gyros installed in any orientation. Only touches gyros on the same grid as its programmable block though, so it won't touch gyros on ships connected via connector. (But ships connected via merge blocks are considered the same ship, so keep that in mind...)
-
Can easily be paused & resumed by running the programmable block with an argument. This allows you to take full control of your ship again.
This script is a cut-down version of that which I normally run on my satellites, mobile platforms, jump rings/sleds, etc. so it's had a lot of use & testing (as much as a single person can :P). I also use it on my 3200 tonne survival ship, though with just a single axis (roll).
Setup
Just load it into a programmable block. It will start running right away (no timer block required).
The Reference Point
The script by default operates on pitch and roll. But this is "pitch" and "roll" relative to the ship's grid pivot. If the axes are wrong on your ship (this can happen easily if you're in survival and build from a wrongly-aligned projector), then you can do one of two things: edit the code and change the axes to your liking, or create a group named SolarGyroReference that contains exactly 1 block. It can be any kind of block, but the "front" and "up" sides of this block will be used as your ship's "front" and "up." So the best block to use as reference is a remote control or other ship controller block, like a cockpit or flight seat.
If you add or change the reference group, be sure to re-compile the script so it picks up the new reference block.
Commands
You can optionally send the script's programmable block one of two arguments (e.g. from your cockpit toolbar or a button panel or a sensor):
-
pause - This will pause the script and allow you to rotate your ship normally using the mouse/keyboard etc.
-
resume - This will resume the script's behavior.
-
togglesolar - This will toggle the script's state between active & paused.
3-Axis Alignment
Unfortunately, there's no one-stop option for this, but you can make the script align all 3 axes by looking for the following:
private readonly SolarGyroController solarGyroController =
new SolarGyroController(
GyroControl.Pitch,
GyroControl.Roll
);
and adding "GyroControl.Yaw," like so (don't forget the comma):
private readonly SolarGyroController solarGyroController =
new SolarGyroController(
GyroControl.Yaw,
GyroControl.Pitch,
GyroControl.Roll
);
LCD Output
See (https://steamcommunity.com/workshop/filedetails/discussion/496467375/5440953210424812249/).
Как установить и запустить
Откройте оригинальную страницу в Steam Workshop, проверьте версию игры, зависимости и порядок загрузки в описании автора. Нажмите «Подписаться» и дождитесь загрузки Steam. Включите материал в меню модификаций или контента игры, если это требуется. Совместимость и запуск редакцией не проверены.