Space Engineers

Space Engineers

Not enough ratings
Gyro Switcher
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
1.633 KB
16 Nov, 2015 @ 4:37am
1 Change Note ( view )

Subscribe to download
Gyro Switcher

Description
This script allows you to change gyro power with one click of a button.
Useful for making a "sniper mode" on fighters equipped with cameras and long range guns (such as 88mm RaK)
made to shoot off enemy turrets and other external stuff.
Script reads in arguments from the Argument option in the Programmable Block, then
switches power of all found gyros between normal and sniper mode depending on current gyro power.
If it is equal or bigger than Normal Mode, it will lower the power until it is equal or lower than Sniper Mode,
if it is equal or lower than Sniper Mode, it will increase the power.

Note that due to how the power is set (through IncreasePower and DecreasePower functions
basically equal to what is done when you assign a "Increase Power" hotkey for a gyro in the quick access bar),
it is not possible (at least when the script was written) to set the power to straightly what you want,
there always will be a margin up to 5%. When the Keens will allow to set gyro power by direct input from
the script, it will be reworked for this. Now we have to stick with "clicking" the Increase/Decrease functions.
Sad but true.

To prevent glitches, if something with script logics goes wrong (which shouldn't until Keens will mess up
the scripts or API) it will just boost the power to 100% so you won't end up with weak gyros
in the middle of a fight.

Example usage:
Set the Argument of Programmable Block with this script to "0.7;0.2" (obviously without quote marks).
This means that normal mode is 70% of gyro power, and the sniper mode is 20%.
Assign the "Run" action to some hotkey in your toolbar. Now voila, with one press of a button you are able
to target and hit the enemy's big ship turrets through camera zoom from 1200m, and with another press
you can restore the maneuverability to fend off enemy drones.

The script is heavily commented in order to help those who are new to SE Programming with making their own scripts. Feel free to modify the script to your liking or even republish it with your modifications, but don't forget to leave the link to my original version and don't take all the credits for the work.

Have fun and may your aim be true.