Space Engineers

Space Engineers

928 ratings
Control Module - basically key binding for ships
2
3
   
Award
Favorite
Favorited
Unfavorite
Type: Mod
Mod category: Script, Other
File Size
Posted
Updated
229.771 KB
Mar 30, 2016 @ 6:44am
Jun 1, 2024 @ 9:11am
38 Change Notes ( view )

Subscribe to download
Control Module - basically key binding for ships

In 1 collection by Digi
Digi's Space Engineers mods
50 items
Description
This mod adds the ability for Timer Blocks and Programmable Blocks to be triggered/ran when the input (key/mouse/gamepad/game control) is pressed and/or released by a player controlling a cockpit/RC/seat in the same grid system.

The system is very flexible and you can make from a one key toggling a light to a really complicated mouse and keyboard coordination controllable by specific seats in the ship.


Vanilla PB can read movement and rotation
IMyShipController has MoveIndicator/RotateIndicator/RollIndicator which are now synchronized in all cases (SE v200), so if you don't need more than those you don't really need this mod.
Also IMyShipToolBase has IsActivated, useful to detect clicks.

How to use
I have a guide with various examples and blueprints to get you guys started.

Please read: http://steamcommunity.com/sharedfiles/filedetails/?id=656456032

But if you want a really quick tutorial then just see the tooltip in the "Quick Introduction" buton in a PB or timer block.


The video is only a presentation, not a tutorial
The video by w4stedspace should be treated as a demonstration of what the mod can do, because the version used in the video is way older than the current one which is configured and coded differently, that's why you shouldn't use it as a tutorial, instead use the text guide I linked above.


Chat commands
  • /cm help
    Shows all inputs (keys, mouse buttons/axes, gamepad butons/axes and game controls).
  • /cm showinput
    Toggles printing in the HUD the inputs you're currently pressing, very useful for quickly finding the name of something specific.
  • /cm updatetype
    Testing command, this changes how the code executes internally, before or after simulation. By default it's set to before simulation and I left it there for people to experiment. Please try it and let me know if input feels laggy with before or after sim.


mod io?
Please read[gist.github.com]
Popular Discussions View All (4)
7
Sep 17, 2023 @ 5:33am
Reading inputs in a unaccessable ProgBlock through an accessable Cockpit/Remote
Djelle
5
Dec 31, 2019 @ 5:54am
[Mod Suggestion] Building Tool - Construct new grids from afar
Acarii
2
Feb 9, 2018 @ 4:57pm
Only 1 keystroke is read at the time
CoCoNO
369 Comments
Swann Mar 17 @ 6:41pm 
This is really the best keybinding solution, thank you Digi. Is there any way you could make this a Plugin so we could use it in multiplayer? There are pure scripts available but they don't have as much flexibility.
Djelle Nov 9, 2024 @ 6:37am 
Ahh. I did get the controls to show by ur little refresh trick... In both fields :steamhappy:

You are right that the problem is in my world. I went into Sandbox_config.sbc and moved ur mod to the top of the list, so it will load first (I assume). And that made the double field problem go away. The weird thing is that if I now move it back to the bottom, it doesn't double up anymore.

Thanks for pointing me in the right direction :cozybethesda:
Digi  [author] Nov 8, 2024 @ 7:47pm 
I don't get the duplicated controls so the only difference now I guess is the world.
Can you send your world?

I do get the issue with controls not adding but that is from a lack of realtime refresh, which is a new game bug in 205 (was reported by other modders that have the same problem on their mods).
You can force a refresh by clicking the block again on the left terminal list.
Djelle Nov 8, 2024 @ 3:19pm 
I did try removing the two other mods I had. No change. It could look like this mod was aded two times. Tho I did not do that.
Digi  [author] Nov 8, 2024 @ 3:00pm 
Did you try it by itself? As it sounds like a problem with another mod or it's simply this mod added multiple times.
Djelle Nov 8, 2024 @ 1:59pm 
Is not working anymore. In the blocks menu, there are two of each field. And you can not add the keys u want to monitor.
Digi  [author] Jun 1, 2024 @ 9:11am 
Thanks, I replicated the error with your instructions!
And I found a workaround to fix it. It's weird, game is triggering some terminal code on removed blocks.
ScorchHawk May 31, 2024 @ 5:57pm 
I'm also seeing an error when I paste a vehicle using the example turret control program. I changed the rotor names but otherwise the code should be the same. Not too familiar with C# but the error from the log is here: https://pastebin.com/W4YceFks
Digi  [author] Feb 25, 2024 @ 9:23pm 
It's an error that happened with the code from the mod, software is complicated.

The way to get it off the screen is for me to fix it.
And to fix it I need the error details which are in the file that the error asks you to send :P
Use any text sharing service, like pastebin.com for example.

Normally any error in mod code would crash the game, but I opted for this handler that replaces them with red messages to not be as disruptive as a crash while still letting people know there's something wrong... also catching errors is bad for performance and it can leave the code in an unknown state, so I can't just ignore the error.
Eon Feb 25, 2024 @ 5:27pm 
I've recently gotten into the game, and it didnt happen at first but recent past few days with friends on a server, ive been getting hit with 'Control Module ERROR, report contents of: %appdata%/spaceengineers/storage/655948251.sbm_controlmodule/info.log' in giant red text on screen.

I dont think ive ever even used control module...so not sure whats causing it or how to get this off screen.