Precise Rotation - rotate rotors by exactly 90° (or 45°, 22.5° ...) (2024)

Using this script, you can accurately rotate a rotor by exactly 90 degrees - or 45° or 30° or whatever you desire.
For example, you can use it for 90° turns. If the rotor is initially at 0°, you can go to 90° with one button click. Second button click will bring it to 180°, third to 270° and fourth will bring it back to 0°.

Precise Rotation - rotate rotors by exactly 90° (or 45°, 22.5° ...) (1)

Download script here: https://steamcommunity.com/sharedfiles/filedetails/?id=442994071
Download demo world here: https://steamcommunity.com/sharedfiles/filedetails/?id=443002413

I used a simpler version of this to build the Gatling Grav Gun on my Vendetta Battleship, which required precise 90° turns to fire safely. I'm sure you will find many other potential uses for this script.

The script used in the Vendetta Battleship can do only thing - rotate one specific rotor by 90° degrees whenever run. This version is much more flexible, you can do 90°, 45°, 10°, whatever you desire. You can also do -90°,-45°, -10° to reverse the direction. Also, it is not limited to one specific rotor: you can rotate any rotor with only one programmable block, provided you know the name of the rotor and the programmable block has access to the rotor (must be on the same ship & ownership must be correct)

Setup

1. Build the rotor if you haven't already. Lets call it "MyRotor" for now.
2. Set the rotors upper limit and lower limit to exactly 0°. Remember, if you hold CTRL and click inside a slider, you can enter exact values.
3. Download the script from Steam Workshop and copy it into a programmable block. Lets call that programmable block "TurnIt" for now, although the name doesn't really matter.
4. Place a button panel somewhere.
5. Configure the first button to "Run" the "TurnIt" progammable block. In the command argument, enter "90 MyRotor". The first part "90" means we want 90° turns. The second

part "MyRotor" means we want to turn the rotor named "MyRotor".
6. Press the button.
7. Thats it, the rotor should turn by 90° now. See the "arguments" chapter for further usage examples.

Demoworld

If you want, you can try out the script in my crappy demo world first before you add it to your own world, see here

Arguments

Since Space Engineers latest 1.082 update, one can specify command arguments to Programmable Blocks. This is basically just a line of text you can enter when you put the "Run" command of a programmable block in you button panel or a co*ckpits command bar.

Examples: "45 MyRotor"Turns the Rotor named "MyRotor" by +45°
"-45 MyRotor"Turns the Rotor named "MyRotor" by -45° (same as above, just to the other direction)
"90 My awesome rotor"Turns the Rotor named "My awesome rotor" by 90°.
"22.5 MyRotor"Turns the Rotor named "MyRotor" by 22.5 degrees.

So the first parameter is the desired rotation, the second the name of the rotor.

Use point as decimal separator for the rotation, so "22.5" as usual in english. NOT "22,5" like it is used in many other languages.
Also, using arguments doesn't seem to work in timer blocks right now (see "Known Bugs" chapter)

Troubleshooting - typical problems with this script

If you have followed the Setup Steps above, and the rotor doesn't turn please check the following things:

- Does the programmable block print out any exception in the menu?
- Check the name of the rotor in the programmable block arguments. If its spelled wrong, stuff won't work and a expection is printed in the programmable blocks menu
- Ownership issues. The rotor and the programmable block must have the same owner (or maybe access via share options). Otherwise the programmable block can't do anything with the rotor.
- Are ingame scripts enabled? In Single Player, please check the "In-Game Scripts" checkbox in Edit Settings -> Advanced of your savegame. In multiplayer: some servers have ingame scripts disabled. Unless you are the admin, you are out of luck.
- did you use the script in a timer block? See "Known Bugs" section

Known Bugs

Using this script in timer blocks doesn't work right now.
The problem isn't my script, the problem is Space Engineers - you can setup arguments in timer blocks, but they never get passed to the programmable block. Therefor my script fails.
There is nothing I can do about it, other than reporting it on the Bug forum.

"License"

Use this in any SE creation you want. If you include the script in anything you publish on the Steam Workshop, please link back to the the Steam Workshop Page in your description.
Thats all!

Explanation for other coders

I won't bore you by posting the entire code here, but these are the essential parts:

Code:

void Main(string argument){ // omitted ...// parse the argument stringif(!String.IsNullOrEmpty(argument)){ var parts = argument.Split(' '); if(parts.Length > 0) angle = Convert.ToSingle(parts[0]); if(parts.Length > 1) rotorName = argument.Substring(parts[0].Length).Trim();}var rotor = GridTerminalSystem.GetBlockWithName(rotorName); // omitted ...// Set rotationvar rotation = rotor.GetValue<float>("UpperLimit");rotation+= angle;if(rotation >= 360) rotation -= 360;else if(rotation < 0) rotation += 360;rotor.SetValue("LowerLimit",rotation);rotor.SetValue("UpperLimit",rotation);}}
As you can see, the first part of the code just deals with parsing the brand new argument string, for example "45 MyRotor". (We got the new command arguments in yesterdays patch. Huge thanks goes to Keen, this makes scripting so much more flexible!)
The second part is setting the rotors rotation by setting the upper and lower limits.

Download the complete script here:https://steamcommunity.com/sharedfiles/filedetails/?id=442994071

Precise Rotation - rotate rotors by exactly 90° (or 45°, 22.5° ...) (2024)

References

Top Articles
Houdini Harris escapes media scrutiny — can it last? - Washington Examiner
Golfwrx Forum
417-990-0201
Dannys U Pull - Self-Service Automotive Recycling
Occupational therapist
Canelo Vs Ryder Directv
Moe Gangat Age
Missing 2023 Showtimes Near Landmark Cinemas Peoria
Inside California's brutal underground market for puppies: Neglected dogs, deceived owners, big profits
Mephisto Summoners War
Craigslist Alabama Montgomery
Best Food Near Detroit Airport
Hartland Liquidation Oconomowoc
Labor Gigs On Craigslist
Painting Jobs Craigslist
Finger Lakes Ny Craigslist
Connect U Of M Dearborn
Committees Of Correspondence | Encyclopedia.com
Uktulut Pier Ritual Site
Nesz_R Tanjiro
Shasta County Most Wanted 2022
Keck Healthstream
Company History - Horizon NJ Health
PCM.daily - Discussion Forum: Classique du Grand Duché
Hefkervelt Blog
14 Top-Rated Attractions & Things to Do in Medford, OR
Snohomish Hairmasters
Is Holly Warlick Married To Susan Patton
Valley Craigslist
Bj's Tires Near Me
LG UN90 65" 4K Smart UHD TV - 65UN9000AUJ | LG CA
Mastering Serpentine Belt Replacement: A Step-by-Step Guide | The Motor Guy
Dubois County Barter Page
Http://N14.Ultipro.com
Metra Union Pacific West Schedule
Atlantic Broadband Email Login Pronto
42 Manufacturing jobs in Grayling
Telegram update adds quote formatting and new linking options
ATM Near Me | Find The Nearest ATM Location | ATM Locator NL
877-292-0545
Cranston Sewer Tax
Wayne State Academica Login
Sukihana Backshots
Craigslist en Santa Cruz, California: Tu Guía Definitiva para Comprar, Vender e Intercambiar - First Republic Craigslist
Tripadvisor Vancouver Restaurants
Sechrest Davis Funeral Home High Point Nc
Centimeters to Feet conversion: cm to ft calculator
Darkglass Electronics The Exponent 500 Test
Sc Pick 3 Past 30 Days Midday
The Plug Las Vegas Dispensary
2121 Gateway Point
E. 81 St. Deli Menu
Latest Posts
Article information

Author: Kelle Weber

Last Updated:

Views: 5531

Rating: 4.2 / 5 (73 voted)

Reviews: 88% of readers found this page helpful

Author information

Name: Kelle Weber

Birthday: 2000-08-05

Address: 6796 Juan Square, Markfort, MN 58988

Phone: +8215934114615

Job: Hospitality Director

Hobby: tabletop games, Foreign language learning, Leather crafting, Horseback riding, Swimming, Knapping, Handball

Introduction: My name is Kelle Weber, I am a magnificent, enchanting, fair, joyous, light, determined, joyous person who loves writing and wants to share my knowledge and understanding with you.