Space Engineers

Space Engineers

35 ratings
Simpler Transmit Receive 2
2
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
15.623 KB
17 Mar, 2019 @ 7:32am
18 Jun, 2019 @ 5:59pm
13 Change Notes ( view )

Subscribe to download
Simpler Transmit Receive 2

Description
World with some examples: https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2019885241

Updated for 1.191.0

All credit to etopsirhc's Transmitter and Receiver script for inspiration and my starting point
Transmitter and Receiver

I really liked etopsirhc's script but I'm lazy and didn't want to configure settings. :)
This script takes his idea and makes it simpler to use.

The enhancements are:
- The same programmable block can transmit and receive
- No script configuration required
- If you do use configuration, it can be done with CustomData (so it survives script updates)


To receive commands:
- Create a programmable block with this script
- Create timer blocks to perform actions that you want to remotely activate
- Create an active antenna

// This step appears to not be needed with current SE versions
//- Assign this programmable block to the the antenna

To send commands:
- Create a programmable block with this script
- Create an active antenna (make sure broadcast is enabled)
- Call this programmable block with the <name of a timer block> on the _REMOTE_ grid

If you also want to send text messages to display on a remote panel, then it requires a little extra work

To receive text messages, you also need to:
- Name an LCD panel: SimplerTransmitReceive Panel

To send text messages, you call the programmable block with
- text:rest of message here


With that minimal setup, two grids can talk to each other without any other configuration. However, it is possible to set some options using the programmable block custom data (and then click Recompile).

You can also specify the channel for _sending_ with each command, e.g. baseChannel::toggleHangar

That way you can have one programmable block on the sending ship, but target different receivers easily.

To be as cpu friendly as possible, the script does not try to drain the message queue each time it runs. So if you send a lot of message quickly to a single receiver, it is possible to drop messages (game limit of 25 per listener).

Try to keep it to one message per tick for a single receiving antenna and single PB setup.


*** LIMITED SUPPORT ***
I've added limited support for broadcasting the contents of an LCD. Keeping this simple (as per the name) also means there aren't a lot of options.

Sending the programmable block lcd:<lcd name> will cause it to transmit the contents of that lcd.

lcd:channelName::<lcd name> should also work (note the :: between the channel to use and the lcd name)

On the receiving side, if there is a panel with exactly the same name, its contents will be replaced.
If there is no matching panel, then it will not update any panel by default (you can set strictLCDMatching to false)
43 Comments
Spicie 30 Sep, 2022 @ 6:05pm 
As an IT student, I know how having spaghetti code feels lmao
cjb  [author] 30 Sep, 2022 @ 4:55pm 
@Dominus yup, still works. Just tested out in one of my build worlds, even the LCD mirroring seems fine.

One of these days I might go rewrite it so I'm happier with the code, but the bits and pieces all seem to be working fine.
Spicie 30 Sep, 2022 @ 12:44pm 
This is exactly what I'm looking for to make a remote hangar opener that isn't sensor based.
Does this script still work?
Mako 25 Dec, 2020 @ 7:01am 
Thank you. Happy Holidays!
cjb  [author] 28 Nov, 2020 @ 7:15pm 
@Mako - thanks for checking and feel free to repost it!
Mako 28 Nov, 2020 @ 11:24am 
@cjb I would like to export this to Mod.io to use on XBOX and dedicated game servers. I would credit you of course. Or alternatively, could you post it there? I did a few of these for Isy with his permission. If you would like to see how they are posted on Mod.io, you can check out one of them here.

https://spaceengineers.mod.io/isys-inventory-manager-from-steam

Thanks,
cjb  [author] 11 Mar, 2020 @ 5:42pm 
@BroedipusRex it's been awhile since I wrote the script, so that seems like a reasonable way to make sure things still work :D

https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2019885241
BroedipusRex 8 Mar, 2020 @ 12:09pm 
@cjb this script is amazing, I've used the Simpler Transmit and Receive for so many things over the years. The new settings have me slightly confused, but am still tinkering. Would it be possible for you to upload a test world with specific examples? Currently I'm trying to send a communication from grid A to grid B. B then runs a timer block, then sends the content of an LCD on B, to grid an LCD on A. Additionally, to get the debug output on the Programmable Block large display it should just be [<Programmable Block:1], correct? Thanks again for keeping this up to date!
cjb  [author] 17 Feb, 2020 @ 4:07am 
@Boobies The script was written to use the IntergridCommunicationSystem API and it seems like that doesn't need any antenna assignment anymore.

The script is still working in my test world, so I think you can just skip that step.
Boobies 16 Feb, 2020 @ 7:14pm 
Hi, as above, how exactly do you 'Assign this programmable block to the the antenna'? Cheers mate