Space Engineers

Space Engineers

Control Module - basically key binding for ships
Sabrewulf 14 Jan, 2018 @ 6:56pm
[Help] Please a code for execute EA PB
@Digi
I'm actually using your code to automatize my mech, i use Easy Automation to code in very high level the movement saving time because i forget so much details.
Can you write here a code to i use and reuse in my mechs? I need a code using Control Module to bind keys to commands to execute PB with arguments, example: when press the configurated key i will execute a PB X with argument Y.
Last edited by Sabrewulf; 14 Jan, 2018 @ 6:57pm
< >
Showing 1-2 of 2 comments
Digi  [developer] 15 Jan, 2018 @ 2:09pm 
You can do it without coding by using timer blocks set up to run the PB with arguments.

If you must do it with a PB you'll need some understanding of C#.

The guide explains how to read the inputs: https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=656456032 at "Using it with in-game scripts".

And while it's somewhat simple to check if any of the inputs is pressed and run the other PB with that argument every frame, that is most likely not ideal nor what you want, you're better off reading the movement and acting on it in the same PB.

Feel free to try this, it's longer than needed as it avoids re-getting the other PB every time you want to execute it for a bit of performance, but it's really far from ideal input reading and execution wise.
https://pastebin.com/RRiUSDLh (untested code though xD)

If you do wanna learn, a good start: https://github.com/malware-dev/MDK-SE/wiki/Quick-Introduction-to-Space-Engineers-Ingame-Scripts
Sabrewulf 15 Jan, 2018 @ 4:21pm 
I will use a PB because are very much actions possible and build a TB for each one will occupy a lot of space, mechs need every space for functionalities because the body anatomy and mech coolness have a lot of details

Thankyou very much for support the community!
Last edited by Sabrewulf; 15 Jan, 2018 @ 4:40pm
< >
Showing 1-2 of 2 comments
Per page: 1530 50