Space Engineers

Space Engineers

Inventory Report [ADVANCED] << LCD!! >>
CommanderGizmo  [developer] 1 Mar, 2015 @ 10:49pm
Tutorial: Controls
---{ Tutorial: Controls }---
Lets start by defining a few terms:
  • A Control is a way of telling the program how it should run without changing any code. You can even tie the control to a button panel so that you can change how the program runs with the press of a button.
  • A Toggle is a control that has only two states: On or Off.

For example: You can install the script on newly installed blocks with the INSTALL toggle control.

--=== Tutorial ===--
Lets walk through the process of creating an INSTALL control and linking it to a button on your ship.
  1. Build an Interior Light and a Button Panel on your ship.
  2. Take ownership of the blocks you just built.
  3. Open the control panel for the Interior Light.
    • Turn the block Off.
    • At the end of the block name, type [NAME | CONTROL, INSTALL]
    • Now change the word NAME in what you just typed to the ship name you chose when installing the software. For example, if your ship name was MyShip, it would look like this:
      • [MyShip | CONTROL, INSTALL]
  4. Open the control panel for the Button Panel.
    • Click the Setup Actions button.
    • Find the Interior Light in the list and right click on it. Click Toggle Block On/Off.
    • Close the control panel.
  5. Press the first button (with one square on it). Press it again.
    • Each press of the button turns the light -- and the control -- On or Off.


--=== Explanation ===---
The toggle control (which is the only control currently available) reads it's value from whether the block is enabled or disabled. This means you can use any block with an On/Off switch in the control panel to toggle the control. Just follow the same steps as above using a different block instead of an interior light. The light, however, offers a nice way to read the status of the control. A future version of the software will include a data readout on the LCD"s, but it isn't available just yet. Below is a list of control toggles available at this time. To use them, just replace the INSTALL from the tutorial above with another control name from the list. You don't have to capitalize them, but it does help them to stand out.
  • MASTER: This is the master power switch for your software. When Off it will prevent the software from performing any other actions -- including reading or even finding other control blocks. If the block that turned off the system is destroyed while it is off, you'll have to reboot the programming block to get it going again (click Edit and then Remember).

  • INSTALL: Turning On the install control causes the program to search for blocks it can use that do not already have a version of the software claiming them. Any it finds are immediately claimed with the ship name you chose when installing the software. This includes all connected blocks, even those docked through connectors or merge blocks!

  • UNINSTALL: Turning On the uninstall control causes the program to search for blocks that it has claimed. Any it finds are immediately stropped of the ship name you chose when installing the software. This includes all connected blocks, even those docked through connectors or merge blocks!

  • AUTOHIDE: When On this control will hide the display output on blocks that are broadcasting over antennas if the 'Show On Hud' option is turned off. This prevents control panel clutter when you aren't using the display.

  • OPTIMIZE: When On (which is the default value) this control delays scans for new blocks and other expensive features by as much as 30 seconds in order to update the reports faster. If you are experimenting with reports it can be useful to turn this feature off so that your changes take effect quicker.

  • DEBUGGING: When Off this control disables the debugger output. The debugger is expensive and can slow down the script quite a bit. Once you have everything as you want it, you can safely turn it off.

  • PRIVACY: When On all reports that are not marked public are hidden. This is useful if you have an intruder and only want the cockpit screens live while you deal with them. See the [not yet completed] tutorial to get more information.

  • FORCEPANELS: When On this control forces LCD's and Text Panels to switch to displaying their output each time it's updated. This option is currently required to have anything display on these blocks, so it's best left on.
Last edited by CommanderGizmo; 1 Mar, 2015 @ 10:50pm