Space Engineers

Space Engineers

28 ratings
Precise Rotation Script [Obsolete, use MoveIT script instead]
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
1.412 KB
May 15, 2015 @ 5:13am
May 15, 2015 @ 8:03am
3 Change Notes ( view )

Subscribe to download
Precise Rotation Script [Obsolete, use MoveIT script instead]

Description
Note:script is obsolete now

This script is pretty much obsolete now and has been superseded by my MoveIT script that can do everything that this one can, and much more. See http://steamcommunity.com/sharedfiles/filedetails/?id=461120531&searchtext=

Of you course you can still continue to use this one if you really want, its not going away or something.







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°.

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 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.

Also, check out the video for further 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 cockpits command bar. In this script, the command argument controls how much the rotor is turned and which rotor is turned.


Argument 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.
"90 RotorGroup" Assuming "RotorGroup" is a group with some rotors in it: turns those Rotor by +90°


So the first parameter is the desired rotation, the second is the name of the rotor (or the name of a group that has rotors in it).

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? If so, this might help you to find the problem. To get a programmable block working again after a exception you also need to hit "edit" and "remember & exit".

- 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 (which I already did).

"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 this Page in your description.
Thats all!

Mod compatibility

This script works fine without any mods whatsoever, but it can also work together with any mod that functionally counts as rotor.
Here are the ones I have tested:

Conveyor Hinge by Digi. Technically, this is a rotor that refuses to go below -90° or above +90°.
18 Comments
Brenner  [author] Jun 18, 2015 @ 10:44am 
Reasonable enough, thanks to MoveIT there is no reason to use this one anymore.
I'll leave this one around for historical purposes (or whatever) and just add a note at the top with a link to MoveIT (Workshop descriptions seem to work again now, not quite sure what up with them at the weekend)
VORG Jun 17, 2015 @ 8:18am 
Thx for the new MoveIT script Brenner, just to keep my mods clean though I've unsubbed from this one and am now following the other one! Thanks!
Brenner  [author] Jun 14, 2015 @ 6:40am 
Ok guys, the "MoveIT" script is up now! Its has the same functions as this script plus a load of new ones.

I currently have some weird problems with Steam Descriptions though - couldn't add the full description to the MoveIt Script or I would only get forwarded to a black page when trying to save. Have posted the description to the official forum instead and just linked from the Steam Page.

Sadly, I can't even edit the description of THIS script right now.

Whatever, the new script is available under:
http://steamcommunity.com/sharedfiles/filedetails/?id=461120531

Hope you'll like it!
RyansPlace Jun 14, 2015 @ 3:42am 
Wait! Don't rush. You're only giving us features we've begged for since rotors and pistons came out. Make sure you get it right! ;)

Keen: Releases long anticpated fix. Tells no one. :/
Brenner  [author] Jun 14, 2015 @ 2:52am 
Good news, everyone!
1. Using parameters in timer blocks works now (since this thursday)

2. The successor script called "MoveIT" is almost done. It can do everything this script can do (precise rotations), plus tons of other stuff too, like for example extending / retracting pistons to exact positions, setting grav gen acceleration etc.
Should be up in a few hours, currently uploading the tutorial video and finishing the description.
Brenner  [author] Jun 10, 2015 @ 12:01pm 
Oh and I saw Lord Devious post about the incoming fix .. he actually made that update 2 or 3 weeks ago already, but he recently said they finally accepted the merge. So it should indeed be in this thursdays patch.
Brenner  [author] Jun 10, 2015 @ 11:59am 
Thats a good point, haven't really considered what happens if the rotor is already out of rotation. SEs normal rotor behavious is mumbling something about "out of limits" and turning until is in limits again. But since I wouldn't use the normal upper / lower limits anway but instead external parameters, I suppose I could handle however I damn please. Might make that configurable via yet another parameter too.

Man, I fear the full documention of this thing might start to look like that of a frigging linux program ...
RyansPlace Jun 10, 2015 @ 7:30am 
I have a caveat to Deathpaw's request. When upper/lower limits are implemented, could you add a way to rotate only to a upper or lower limit, but not rotate if the rotor is already there? I'm looking for a way to reset several rotors to their starting positions which could have been interrupted at any point during a sequence. Thank you.

Also, Lord Devious put a fix in for timer arguments. Hopefully, it'll be included in this week's patch.
Deathpaw Jun 6, 2015 @ 9:27am 
Lol, thanks Brenner, i wish i could code well enough to try it myself. I'll wait till then.
Brenner  [author] Jun 6, 2015 @ 5:28am 
Hmm, right now the upper and lower limits are needed to turn the rotor to a specific angle.
But I suppose I could add appriopriate extra parameters to the command line to still allow for limiting the angle. Probably in the next, more powerful script (also featuring piston movement) I still plan to program .. someday. So little time, so much stuff on my SE todo list.