SHART | Script Handling Activation of Remote Timers
Изображение 1 из 2. Материалы автора из Steam Workshop.
О материале
«SHART | Script Handling Activation of Remote Timers» — материал мастерской Space Engineers. Моды, чертежи кораблей, скрипты и миры для Space Engineers. Данные Steam, описание автора и ссылка для установки через подписку. Совместимость редакцией не проверена.
Описание автора
Description
Howdy!
This script allows you to trigger timers on other ships/stations that also have this script using antennas. This script can also act as both a sender and receiver.
Features
-
Triggers timers on other ships using antenna-based communication
-
A single script can be used send/receive timer trigger requests
-
Animated send/receive indicator
- New! - Can tie multiple timers to a single SHART!
Setup Instructions
-
Place this script in a programmable block.
-
Place a timer block.
-
Place at least one regular antenna or laser antenna.
- Laser antenna need to actually be linked to another laser antenna to work
-
Open the Custom Data of the programmable block and set "Timer to trigger on receive" to the name of a timer block. This timer will get triggered when a SHART message is received.
- You only need to do this if you want to be a receiver. Senders are not required to have a timer configured.
-
Recompile the script once you are done configuring.
Note: You must recompile the script to process any setup changes.
Usage Instructions
When the script is compiled for the first time, your script gets assigned a randomly generated (and likely silly) name tag called a UID (Unique Identifier). The UID is sort of like the "address" for a programmable block. The UID is what other SHART scripts will use to send messages to this particular programmable block through the antenna network.
If you do not like the automatic Unique ID generated for you, you can change it in the Custom Data, then recompile.
Subaddresses
In the custom data of SHART, you can now configure a list of "subaddresses" which allows you to trigger different timers with a single programmable block.
If a subaddress is specified for an incoming SHART message, the script will trigger the timer associated with that subaddress (if it exists). You do not need to use subaddresses if you do not want to.
In the custom data, subaddress entries must be on their own line and in the form:
|<subaddress>,<exact timer name>
Example
Receive timer subaddresses=
|primary,Timer Block 1
|secondary,Timer Block 2
|tertiary,Timer Block 3
Note: Subaddress names are whitespace sensitive. If you add whitespace after the comma or leave trailing whitespace after the name, it will be treated as part of the name. The subadddress snippit: "|primary, Timer Block 1" will process the name as " Timer Block 1" not "Timer Block 1".
Sending
To be able to successfully send a request, you must be able to reach the desired SHART program via using laser antenna or regular antenna. Messages will be automagically routed through the antenna network to reach the desired SHART program.
Also, it is worth noting that only allied antennas can receive your messages.
The argument
trigger UniqueIdGoesHere
will send a trigger command to the SHART program with the specified Unique ID.
The argument
start UniqueIdGoesHere
will send a start command to the SHART program with the specified Unique ID.
The argument
stop UniqueIdGoesHere
will send a stop command to the SHART program with the specified Unique ID.
To send a SHART message to a particular UID, you simply append the subaddress to the end of the above arguments. For example:
trigger UniqueIdGoesHere SubAddress
Receiving
To receive a request, you need to have an antenna (laser or regular) on your ship to receive messages with. You do not need to broadcast to be able to receive messages, so you can have stealthy receiver antennas that just listen for remote requests.
You also need to have a valid timer assigned to this program. You can configure the name of the desired timer in the Custom Data of the SHART programmable block.
When SHART receives a "trigger", "start", or "stop" message, it will perform the corresponding action on the assigned timer. If a subaddress is specified, the timer associated with that subaddress will also be triggered accordingly.
Arguments
| Argument | Description |
|---|---|
| trigger UID | Sends trigger command to a SHART program with the specified Unique ID (UID). |
| trigger UID SUBADDRESS | Sends trigger command to a SHART program with the specified Unique ID (UID) and triggers the timer associated with the subaddress (if valid). |
| start UID | Sends start command to a SHART program with the specified Unique ID (UID). |
| start UID SUBADDRESS | Sends start command to a SHART program with the specified Unique ID (UID) and starts the timer associated with the subaddress (if valid). |
| stop UID | Sends stop command to a SHART program with the specified Unique ID (UID). |
| stop UID SUBADDRESS | Sends stop command to a SHART program with the specified Unique ID (UID) and stops the timer associated with the subaddress (if valid). |
| rename | Creates a new randomized Unique Identifier for this SHART program. |
FAQ
Can I customize the Unique ID of my program?
Yes. Simply change the Unique ID in the Custom Data of the programmable block to what you want, then recompile.
Can I send messages to multiple different SHART programs?
Yes. Since you are addressing the SHART programs by name, nothing is stopping you from sending commands to multiple SHART programs. You'd simply just run several different start, stop, or trigger commands.
Does my Unique ID need to be "unique"?
Not really, and nothing bad will happen if you share a UID with another SHART; just all SHARTs sharing the same UID will be triggered when a message is addressed to that UID.
Can a particular SHART trigger different timer blocks on receive?
Yes, see the documentation of SUBADDRESS above!
Author's Notes
This is an absurdly simple script, and it is by no means the first of its kind, but I had a lot of fun writing it and coming up with the backronym.
This script started as a fun experiment with a random name generator. I didn't have a useful application, so I wrote the rest of the script to give it a purpose lol.
I personally use this script as a "garage door opener" that my fighters can use to open hangar doors on my carriers, but I'm sure y'all will come up with more interesting applications.
This script was also a testing ground for my SE Sprite Builder that I've been working on. I designed all the sprites in that app, then used the code exporter to easily generate boilerplate code that I use for the fancy graphics. It was significantly easier to design sprites this way as opposed to drawing it out on paper lol.
- Whiplash141
Как установить и запустить
Откройте оригинальную страницу в Steam Workshop, проверьте версию игры, зависимости и порядок загрузки в описании автора. Нажмите «Подписаться» и дождитесь загрузки Steam. Включите материал в меню модификаций или контента игры, если это требуется. Совместимость и запуск редакцией не проверены.