Scripts

From Space Engineers Wiki
Jump to navigation Jump to search
A Programmable Block is required in game to run scripts.

You can automate many interactions in game through Programmable Block Scripts: Auto-updating LCD text and images, vector thrust flight, subgrid steering, automatic component production, or automatic inventory sorting, and much more.

Even though both are found on the workshop, scripts are different from mods. Scripts are harder to set up and to keep up-to-date than mods. You must load scripts in game into Programmable Blocks. Typically, you will need to build additional blocks and configure them in-game for the script to run.

It is recommended for new players to learn the base game (so called “vanilla”) first. The simplest scripts can be replaced by Event Controllers and Automatons. If you later need to fix a specific “quality of life” issue, you can still look into mods and scripts.

You either download community scripts from the public Workshop, or you write your own. This page is about how to use Scripts, and not about how to write them, for that, see Scripting.

Prerequisites

  • Scripts run only on PCs (Steam and Microsoft Store) and Dedicated Servers; Sony PlayStation and Microsoft XBox consoles disallow them.
  • You must enable Experimental mode in the game Options.
  • The save game's World Settings must allow in-game scripts.

How to install scripts

Community members are sharing scripts on the Steam workshop. Rarely they are hosted on mod.io, or simply copied and pasted from shared C# (text) files.

  1. Go to the Steam workshop and log in.
  2. Select the type:InGameScript filter and search for interesting scripts. Reset other filters to broaden or restrict the search.
  3. Subscribe to the scripts of your choice. Subscribing to a script downloads it into your local script browser.

Now open Space Engineers and load a world whose world settings allow in-game scripts.

  1. Build a Programmable Block (PB). For details, read the PB page!
  2. Open the PB’s Control Panel Screen and click Edit.
  3. Click Workshop.
  4. Browse your subscribed workshop scripts, and paste the desired script.
  5. Read the instructions on the workshop page and also follow the comments inside the script!
  6. Click Check Code, then click OK.
  7. Click Compile and Run.

Expect to have to build or rename related blocks, enter Custom Data into Blocks, and recompile and rerun a few times as instructed, before the script works.

How to Update Scripts

When loaded from a Workshop subscription, scripts in your workshop script browser will auto-update -- but you still need to copy and paste the updated script into the Programmable Block manually!

If you have made configuration changes in the script, keep a local copy of the old one in a text editor to not lose your chosen values. Then compare it with the new copy and enter the same values again.

How to run scripts on consoles

As mentioned in Prerequisites only Steam (PC) and Dedicated servers can run scripts.

That means other platforms joining dedicated servers can also use scripts!

This of course requires the dedicated server to be in experimental mode and have Ingame Scripts enabled. You can see both of these before joining in the Server Details window.

For more info see Multiplayer Join Screen.


Community members have added ship blueprints with some popular scripts:

If you wish to see a script on mod.io please ask the author. Do not upload other people's work without their permission.


Examples of scripts that can run in Space Engineers