Space Engineers

Space Engineers

295 avaliações
[PARK] Piston And Rotor Keybinds
5
2
3
3
   
Premiar
Adic. a Favoritos
Nos Favoritos
Desfavoritar
Marcadores: other_script
Tamanho:
Publicado em:
Atualizado em:
430.640 KB
9 dez. 2019 às 17:50
30 de mai. às 15:45
16 notas de alterações ( ver )

Subscreve para transferir
[PARK] Piston And Rotor Keybinds

Descrição
This is a script intended to make things like cranes simpler and easier to control. It allows you to control rotors and pistons using movement commands through a cockpit. As a result, you can have four six axes of control, per profile (which I will explain a bit later).

This makes this script useful for things like cranes and possibly rotor based tank steering, although it could potentially be used for anything you want keybind controls for.

Update 1.3.0:
Another minor update adding in the setting "toggleRotorPower". Does the same thing as togglePistonPower, in case your build is really jiggly for some reason and want to be able to toggle off the rotors automatically.

Update 1.2.9:
Minor update adding in the setting "togglePistonPower" to only enable pistons for when they are moving. defaults to off in case you want to manually enable/disable pistons, but may reduce the noise pistons make while stationary if enabled.

Update 1.2.5:
Added return to zero functionality.
Three new terms have been added to the generated ini files, Return Position, Return Speed, and Return Order Priority.
When you run the command "Return", it will return each part to the set position, provided it has a speed set, in the order of the lowest Return Order Priority first.

If you set the Return Order Priority to -1, it will cause parts to return to their neutral position whenever their input isn't being received, and won't be considered when executing the return command.

Update 1.2.0:
Added in support for mouse controls with help from Marii. Now you can control your end effectors more... effectively.

Added in ramping so you can tap control things, as well as a general speed multiplier you can define with commands. With both of these it should be a lot easier to make small, precise movements.

Setup is surprisingly easy, even for how I predicted it to be.

1) Put all the rotors, pistons, and ship controllers in a group called "PARK" (You can change this in the script.)

2) Compile the script for the first time. It may give some warnings if the controllers have thruster or wheel control enabled. This does not prevent the script from running.

3) Go into the customData of the blocks and you will find something similar to this:

;Provide the RPM of the part when the corresponding key is pressed.
[PARK:Main]
Forward=0
Backward=0
Left=0
Right=0
Up=0
Down=0
Roll Left=0
Roll Right=0
Pitch Up = 0
Pitch Down = 0
Yaw Left = 0
Yaw Right = 0
Return Position=0
Return Speed=0
Return Order Priority=0

Each of the values represent movement commands that can be read through the cockpit. When the corresponding key is pressed, it adds the corresponding value to the velocity of the part. This is additive, it will sum up the total value and apply that value to the part. For rotors, it is RPM, for pistons, it is M/S, for suspension, it is the throttle ratio.

For example, if you want a rotor to turn clockwise when you press forward, and counterclockwise when you press backward, then you just need to set "Forward=[a_positive_value]" and "Backward=[a_negative_value]".

By default, the script ramps up in speed until it hits the defined speed over 3 ticks. This should make fine adjustments easier. You can change this at the beginning of the script.

Thanks to a recent addition added in by Marii, you can also use mouse controls to move components run by PARK.
The last four settings correspond to that.

Recently, I added in Return Angle, Return Speed, and Return Order Priority.
If you run the command "Return", it will return to the angle set, at a set speed, prioritized lowest first.
So if you want a part to return to 15 degrees at a speed of 2 RPM after the first set of the controlled parts moved, then you can do:
"Return Angle=15"
"Return Speed=2"
"Return Order Priority=1" (0 goes first, 1 is second.)
Setting Return Order Priority to -1 causes the part to return to neutral positon immediately after control is released.

Set this up as desired.

4) Recompile to get the script to recognize changes.

(Optional) The script allows you to set up multiple profiles. To add a new profile:

5) Go into the customData of the programmable block. Add the name of the new profile on a newline.

For example, the initial pregenerated profile should look like this:

"Main" (The actual value contained within quotation marks.)

And to add a new profile to it could make it look like something like this:

"Main
Secondary"

There is no rule that says you must add them one at a time.

6) Recompile the PB to get it to recognize changes. The PB will take the new string and use it to generate a new section in each block. This will appear similar to the the first example, but incorporating the name of the profile you just defined.

7) Set up as normal.

Commands:
"enable" Lets the script read commands from the cockpit.
"disable" Disables the cockpit from reading commands from the cockpit. The script will stop movement if it is moving.
"toggle" Toggles between the enabled and disabled states.
"return" Returns the parts to the defined zero position provided they have a return speed.
"mult <ratio>" sets the multiplier that effects the speed of configured parts. "mult 2" would double speed, for example.

Anything other than the above will be considered a command to switch profiles.
For example, typing "secondary" would cause the script to attempt to switch to that profile, and gives a warning if no such profile exists.

Note, the commands are not case-sensitive, at least for now.

Footnote:
I have noticed that often when people set up cranes in survival they usually just use clunky terminal options to actuate things. I hope that this system at least allows you to set up your cranes with more natural controls. I created this script to make it easier to control cranes without being all that much more difficult to set up. I hope you find this script useful.

TODO:
0) Not sure, feel free to leave suggestions for me.
Discussões Populares Ver todos (3)
4
20 jun. 2024 às 22:32
Runs, but does not create the sample "Custom Data" info in the instructions
GrumpyGoblin
2
31 mai. 2024 às 10:42
Exception, then initialising
Edmund Bestoiber
3
3 mai. 2023 às 16:35
Exception caught
Gemini Sierra
198 comentários
TwistedGraphene 20 de jul. às 11:37 
Yes, you can set a remote control to be the 'cockpit' that the script watches for input from, then remote connect to that grid and control your crane from the ground.
Leconite 20 de jul. às 5:18 
I think that is doable with a remote control block. In Splitsie's scrapyard series, didn't his truck have PARK using an RC block. He could drive the truck to the scrap, then connect to the crane RC block and run the the crane without getting out of the truck.
ekardedahs 19 de jul. às 13:51 
Is there a way to configure this is a remote control fashion? Im in a scrapyard survival world and I have made a tower crane im using to move large blocks around, and it would be cool if I could be on the ground at some points, I dont have a spotter lol.
==>KT<== JudgeKane 2 de jul. às 9:43 
For the return only moving the 1st set (Priority 0), there's a line in the script that changes when it registers as at home/rest/finished moving, if there's too much server jiggle it doesn't reach "Home", try upping that setting until it plays nice :-)
GreenNarwals 24 de jun. às 19:43 
Thank you. I ask because the rules explicitly state to "make sure all custom elements are your own or used with permission."
Trekki  [autor] 24 de jun. às 19:33 
I don't see why not? I made this to help people make things. You can just say that you used my script.
GreenNarwals 24 de jun. às 15:54 
May I please include this script in my submission to the scientific bunker build contest?
Leconite 9 de jun. às 3:55 
First thought,
Check the lock status on the hinges / rotors, if they are locked, it can mess up PARK.
Second thought,
Check your park group, make sure everything is in there, recompile if you have to change anything.
Third thought.
More information about your build, what you need it to do, and how it should work.
Possibly custom data from the parts that are not working.
With that information, we may be able to give more relevant advice / troubleshoot.
SavageReaper185 7 de jun. às 17:18 
someone please help. whenever i setup a secondary profile i lose all controls of my first profiles rotor and hinge, i can only get the first profiles pistons to go forward and back but nothing else, but the secondary profile will have full controls. i tried making a third profile and setting my main hinge rotor and pistons to that but still only the piston worked
Leconite 27 de mai. às 5:08 
I stand corrected. My brain flipped the SIT settings around. :steamfacepalm: