Space Engineers

Space Engineers

144 ratings
Terminal Block Manager
2
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
521.038 KB
23 Jan, 2018 @ 5:17am
2 Oct, 2023 @ 9:22am
19 Change Notes ( view )

Subscribe to download
Terminal Block Manager

Description
Introducing
Terminal Block Manager is an ingame script that allows non-programmer players write their own scripts for terminal blocks in a very simple and easy to learn language.

Writing Terminal Block Manager Language script
When TBM script is set up in the programmable block do the next steps:
  1. Open needed block in the terminal
  2. Click 'Custom data' button
  3. Write '[tbm script]' in a first line
Done! Now you can start writing your first script!
Read the text below to learn how to do it.

  1. Script structure
    * Single asterisk symbol starts a comment. * TBML script represents just a list of conditions and * action lists, like this script for piston block: WHEN currentPosition = upperLimit DO * Anything below this line is an action list, SET velocity TO -5 * except the next 'WHEN' block. when currentPosition = lowerLimit do * All keywords and names are case-insensitive onoff_off * To execute a terminal action just type its name * in a new line.

  2. Logical expressions
    Available comparison symbols:
    • equals: '=',
    • not equals: '!=',
    • less: '<',
    • greater: '>',
    • less or equal: '<=',
    • greater or equal: '>='.
    Simple logical expression structure: <property> <comparison symbol> <value>.
    WHEN radius = 50000 DO onoff_on
    Complex logical expressions are supported too:
    WHEN (angle >= upperLimit AND velocity > 0) OR, * Comma symbol allows to complete (angle <= lowerLimit AND velocity < 0) DO * a long expression in a new line. SET rotorLock TO TRUE SET shareInertiaTensor TO TRUE WHEN (angle < upperLimit AND velocity > 0) OR, (angle > lowerLimit AND velocity < 0) DO SET rotorLock TO FALSE SET shareInertiaTensor TO FALSE
  3. Property types
    There are 4 types of properties in TBML:
    • floating-point number,
    • boolean,
    • rgb color,
    • status.
    * Comparison floating-point properties: WHEN angle = 90 DO SET torque TO 1234.56 * <-- Setting floating-point value * To check and set boolean properties use 'TRUE' and 'FALSE' keywords: WHEN handBrake = TRUE DO SET handBrake TO FALSE * <-- Setting boolean value WHEN backgroundColor = 0 0 0 DO SET fontColor TO 255 140 105 * <-- Setting rgb color value * ^ ^ ^ * | | | * R G B * Each color value must be in range from 0 to 255. * Some blocks have an additional status property, * like the laser antenna block: WHEN status = idle DO * Available statuses for this block: 'connected', 'connecting', connectgps * 'idle', 'outofrange', 'rotatingtotarget', * 'searchingtargetforantenna'. * Status property is not available for changing.
  4. Actions with another blocks/block groups
    * If the block/block group name has spaces, type '_' symbol instead. WHEN DISABLED rotor_1 DO * <-- Checks if block is disabled. There is also similar keyword 'ENABLED'. ENABLE rotor_1 * <-- Turning on terminal block. DISABLE spotlights * <-- Turning off block group. SWITCH interior_lights * <-- Turns on when is disabled and * turns off when is enabled. WHEN angle OF rotor_1 >= upperLimit OF rotor_1 DO * 'OF' keyword allows to get * property from another block. DISABLE rotorLock reverse FOR rotor_1 DO SET rotorLock TO TRUE * 'FOR' keyword executes action FOR rotor_1 DO resetVelocity * for another block or block group. FOR interior_lights DO onoff_on * You can execute action or set FOR interior_lights DO SET intensity TO 5 * property for block group if at * least one block of this group has * the specified action/property.
  5. Additional properties and 'WAIT' command
    Sometimes it is necessary to get non-terminal property from block for example, current stored power from the battery block.
    For such cases, there are additional properties for certain blocks.
    Full list of additional properties you can get here[drive.google.com]
    WHEN currentStoredPower = maxStoredPower DO ONCE ENABLE interior_light_1 * 'status' is an additional enumerable property for door block. WHEN status = opening DO * Its value can be 'closed', 'closing', 'opening', 'open'. ENABLE interior_light_2 WAIT 2.5 * Action list after 'WAIT' command will be * executed after the specified time. open_off * <-- closes the door DISABLE interior_light_2
  6. 'ONCE' keyword
    Action list after 'WHEN' block executes each program tick while logical expression is true.
    If you want these actions to be executed only once time, when condition become true,
    use 'ONCE' keyword after 'DO' keyword.
    WHEN status = extended DO ONCE FOR rotor_2 DO reverse
  7. Checking script for errors
    To find out if your script has errors, press 'OK' button in custom data editing window.
    Then press 'Custom data' button again, and in the end of the script you'll see the error log.
  8. List of keywords
    WHEN <logical expression> DO [[ ONCE ]] <action list> <property name> OF <block name> ENABLED <block name> DISABLED <block name> <condition_1> AND <condition_2> <condition_1> OR <condition_2> ENABLE <block/block group name> DISABLE <block/block group name> SWITCH <block/block group name> SET <property name> TO <value> FOR <block/block group name> DO <action> WAIT <time in seconds> <action name> [[ `parameter 1` `parameter 2` `parameter 3` `...` ]]
Static mode
In static mode TBML scripts are handling faster.
Turn this mode on when all your TBML scripts are ready and don't have errors.
NOTE: When this mode is turned on, deleting scripted blocks from grid may cause
an error in the programmable block.

Useful links
List of terminal properties and actions you can get here[www.spaceengineerswiki.com],
list of additional properties here[drive.google.com].
Source code here[drive.google.com].
Popular Discussions View All (2)
43
30 Mar, 2021 @ 3:14am
Bug reports
Handagotes
7
27 Jul, 2020 @ 8:09am
Share your script with others
Handagotes
99 Comments
Lyr4nx 5 Nov, 2023 @ 12:51pm 
A big thank you for this script!
Handagotes  [author] 2 Oct, 2023 @ 5:52pm 
My bad. Now it's fixed.
john72934 1 Oct, 2023 @ 6:08pm 
Still getting the same error as Rust Droid
(IMyTextPannel not contain "ShowText")
Handagotes  [author] 25 Sep, 2023 @ 10:12am 
Sorry for delay, the Issue should be fixed now.
Rusted Droid 15 Sep, 2023 @ 8:12am 
Just heads up for Recent SE change that make script to error with
(IMyTextPannel not contain "ShowText")
Delphin_1 8 Oct, 2022 @ 4:29pm 
this is awsome!
Rusted Droid 17 Sep, 2022 @ 2:38am 
Do this update make handling arguments to programing block more easy?
Zaƒlow 16 Sep, 2022 @ 9:27pm 
This is a great idea!
Tronix 19 Feb, 2022 @ 6:59am 
I love u man!!! :D :D :D Working fine! BIG TY!
Handagotes  [author] 19 Feb, 2022 @ 3:06am 
@Tronix I made fixes for argument handling in the last update. Now you need to enclose argument with ` symbol, like this: FOR Computer_[3D_Map] DO RUN `NEXT_PLANET 3`