Space Engineers

Space Engineers

Not enough ratings
Universal remote control script
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
400.263 KB
14 Jul, 2021 @ 12:29pm
24 May, 2022 @ 12:25pm
11 Change Notes ( view )

Subscribe to download
Universal remote control script

Description
Remote control any block or group of various blocks (any action). Possible to:
- send multiple commands at once.
- send commands to several different grids at once.
- run other PB on receiver grids with a specific argument.
- send command to specific "network" of PB by defining comunication channels.
- display received commands on LCD, or last command sent.
(No need of additional timer: action is managed by the PB)


Blocks needs
Needs 2 grids minimum (can send command to several grids at once), each one with:
  • An antenna (to send messages, broadcast shall be activated)
  • A programmable block (PB) with this script loaded


Sending commands:
Possible to:
Command Single blocks:
Just send the block name as argument.
It will perform the default action of the block type defined in custom data (ex: for doors, it will toggle open/close action).
Command grouped blocks:
Just send the group name as argument.
Works on mixed or non mixed blocks types groups: doors+timers+pistons+...
For each block within the group, it will perform the default action of the block type defined in custom data (ex: for doors it will toggle open/close action and timers it will start the count down).
Override the default action:
ANY actions (case sensitive) acceptable by block type, defined at the beginning of the argument will be performed instead of the default action.
See "Actions list" at addresses mentioned below and example given for gyroscopes in images.
Works on single blocks or groups (mixed and non mixed): For each block within the group, if the action is a valid action for the block type, apply it, otherwise apply default action.
Customize the default action:
Default actions can be found in the PB custom data:
- you can modify it (ex: for timers, "TriggerNow" instead of "Start"), and recompile.
- you can add a new block type (non listed type) default action: just add it to custom data , and recompile, see example for gyroscopes in images.
Run other PB on receiver grid
Run other PB on receiver grid with the Run command: "Run PB target name"
Use brackets "{...}" after "Run" command to pass custom argument:
"Run {Test argument value} PB target name"
Send multiple commands at once
Separate the commands by ";", it will do the actions sequentially.
Non listed block types:
ANY block, for which the type is not listed in custom data, if called:
- with a valid action, the PB will perform the required action
- without action (or with an invalid action), the PB will try to toggle the block on/off.
Customize the communication channel:
If you want to limit the communication between 2, 3 or more specific PBs (only satellites for example): just change the channel tag in custom data ("BroadCastChannel") of each PB and recompile ! :)
Comunicate on other channels:
In argument: put the a channel tag in front of argument, between "[...]", to be able to send commands to PB of a different network (= no need to change the channel in custom data and recompiling).
From my ship, i can send commands to "satellites PB network" or to "warhead traps 1 PB network" (ex: "[ComChTraps1] Detonate TrapWarheads").
Display information on LCDs and PB screens:
Commands and feedbacks can be displayed on LCDs and PB screens.
Use the tag "[RemoteLCD]" in the names.
Command sending: screen is reset on sender side (sending command is first line)
Command received: Request received will stack on LCD, latest received is the last line (=keep history).
/!\ Camera "View" action is not valid as actions are performed by the PB, not the player (PB cannot "view" through camera)


Possible actions per block type
Need to customize or override the default action defined in custom data?
"Actions list" for each type of block can be found at these addresses:

Examples:
So for a group named: "MyBaddassShip - Hangar - RoofDoors" (my way to name it ;) ) with hangar doors and timer(s).
Argument:
Description:
"MyBaddassShip - Hangar - RoofDoors" (no quotes)
With just use the name of the block/group as argument (case sensitive) default action is performed: open/close doors, start timer(s)
"TriggerNow MyBaddassShip - Hangar - RoofDoors" (no quotes)
Default action on door blocks (open/close) as "TriggerNow" is not a valid action for doors, and trigger timer(s) of the group as "TriggerNow" is a valid action for them and thus override timer type default action defined in custom data ("Start")
"Detonate MyWarhead traps"
Override warhead type default action defined in custom data ("StartCountDown") to trigger the explosion immediately.
Note1:
For "Detonate" action, warheads must be armed first, no need for "StartCountdown".
Note2:
If you have several "traps" grids with:
- an antenna on each grid,
- a PB with this script (on the same ComChannel) on each grid,
- armed warheads (or warheads group) with the same name,
the command will trigger the explosion for all traps !


Notes on how it works
(1) It works both ways: Programmable Block "PB" on grid 1 can send commands to PB on grid 2, but PB on grid 2 can also send commands to PB on grid 1 (no additional PB or timer).

(2) As it works with broadcasted messages (Inconvenient: need unique blocks/groups names per ships), advantage :
  • no need to specify the destination PB name: all PBs with this script will process commands sent by another PB using this script.
  • if 2 or more grids have a block (a timer for example) with the same name and a PB with this script, all the blocks will be "activated" (= timers on both grids will be started/stopped/triggered depending on the command sent)


THANKS
Thanks to Malware for the tutorials and Wicorel for the example.
Example source:
https://github.com/Wicorel/WicoSpaceEngineers/tree/master/Modular/MDK%20IGC%20Example%204

To learn more about ingame scripts, go to:
https://github.com/malware-dev/MDK-SE/wiki/Quick-Introduction-to-Space-Engineers-Ingame-Scripts
Popular Discussions View All (1)
9
27 Feb, 2022 @ 4:37am
PINNED: Bug reports
Grog
15 Comments
Snipou 13 Mar, 2024 @ 3:37pm 
In fact, only the default actions seem to work, when I write an argument after the block name, nothing happens (although the feedback tells me it's ok)
Grog  [author] 11 Mar, 2024 @ 2:58pm 
Hi Snipou
What is the instruction you want to send ?
Can you paste it here ?
Snipou 10 Mar, 2024 @ 3:49pm 
Hey ! :)
Thanks for this script!
Small problem, it no longer seems to work for sending personalized instructions.
It works well for the default instructions, but as soon as I enter an instruction, it doesn't work :/
skatt 13 Apr, 2022 @ 6:48am 
Oh, thanks, man. And this is one of the most useful scripts.what I saw)
Grog  [author] 12 Apr, 2022 @ 11:06am 
Hi SKATT,

Thanks for the feedback, error from previous update: appears by calling without command (just the name). My mistake.

It has been fixed now.

Let me know if still not work :steamhappy:
skatt 11 Apr, 2022 @ 11:26am 
Hello. I did it before and everything worked, but now it gives an error. What could be wrong?
Syna 9 Mar, 2022 @ 4:21pm 
Thank you
Grog  [author] 9 Mar, 2022 @ 10:38am 
Syna 8 Mar, 2022 @ 4:03pm 
What is the mod which display toolbar info in the hud ?
Rusted Droid 23 Feb, 2022 @ 2:38pm 
@Grog Thank you
i give it a try