Screenshot
Takes a screenshot and saves to the disk. Syntax:
Screenshot - takes a screenshot without interface and saves to the default folder screenshots/, with automatic file name and with default format (specified in the Player settings dialog).
Screenshot { ... } - takes a screenshot with custom options:
{
GUI true - takes a screenshot with interface visible. Default is false (without interface).
Format "tif" - set a screenshot format. Possible values: "jpg", "jpeg", "tif", "tiff", "tga", "png", "dds". Default is whatever is set in the Player settings dialog.
Name "prefix" - set a screenshot file name prefix. Default is "scr".
}
The path and file name of the screenshot have a form of screenshots/prefixNNNNN.format where prefix is specified by the Name parameter (default is scr), format is specified by the Format parameter (from the Player settings dialog), and NNNNN is an automatically increased number from 00000 to 99999. Path is relative to the screenshots/ folder, so you may specify a custom relative path as a part of the prefix, for example Name "../scr" will save screenshot to the main SpaceEngine folder.
SavePNG, SaveTGA, SaveJPG, SaveDDS, SaveTIF
Loads a specified image file and saves it to the format, specific for each command. Syntax:
SavePNG "addons/my_addon/textures/spacecraft/texture.tga" - saves the image file to the PNG format. If there are no errors, the file texture.png will appear in the same folder.
SaveJPG "addons/my_addon/textures/spacecraft/texture.*" - saves the latest modified image whith path matches the provided mask to the JPG format. If there are no errors, the file texture.jpg will appear in the same folder. If there are multiple files with the same file name texture and different extensions, the latest (newest) file will be loaded. If that file is not of supported image format (dds, tga, png, jpg, jpef, tif, tiff), the command fails.
OptimizeSM
Loads spacecraft SM model and saves it to a smaller (optimized) format.Syntax:
OptimizeSM "addons/MyShip/models/spacecraft/Battlecruser.sm" - saves specified file to a default (int) format.
OptimizeSM "addons/MyShip/models/spacecraft/Battlecruser.sm" { ... } - use additional options:
{
Format "int_full" - change format. Possible values: "float_full", "half_full", "int_full", "float_no_uv", "half_no_uv", "int_no_uv". Default is "int_full".
Recenter true - re-centers the model.
}
When importing ship model from obj, SpaceEngine creates the sm file which uses 32-bit floating-point (FP32) values for all vertex attributes: coordinates, normals, texture UVs. Usually such accuracy is redundant and model can be saved using 16-bit floating point (FP16) or even 16-bit integer values. This reduces file size significantly, and also reduces its memory footprint in SE. The OptimizeSM command converts file to the specified format and saves it to the same directory as the original file and with the same name, adding suffix "_int_full", "_half_full" or whatever format has been chosen. The conversion process and possible errors are typed to the log file (system/se.log). To test new model in SE, you must update the ship's model cfg file - specify the new file name by the Mesh parameter (see importing ship model from obj for details). After you done with debugging, you may remove the original sm file and rename the new file by removing the suffix.
The formats "float_no_uv", "half_no_uv", "int_no_uv" are designed for meshes without texture UVs, but still experimental. Don't use them.
Watermark
Loads a custom image and displays it on screen as an transparent overlay. Useful to make "reality comparison" screenshots. Syntax:
Watermark
{
Path "C:/images/Pluto New Horizons.jpg" - path to the image file.
Opacity 0.5 - opacity of the overlay. Default is 0.5.
Visible false - enable/disable overlay. Default is true (enable).
}
You may make a simple script which will display and hide the overlay texture every second (simulation of the blink-comparator technique widely used in astronomy). Use the sequence of Watermark { Visible true }, Wait 0.5, Watermark { Visible false }, Wait 0.5 enclosed by the Loop / EndLoop commands.
SetLocale
Switches SpaceEngine interface language to the specified one. Syntax:
SetLocale "fra" - switches to French.
Accepted values are abbreviation of locales: "eng", "rus", "fra", "ger", "ita", "espsp", "espla", "cat", "pol", "cht", "chs", "jpn", "cro", "cze", "fin", "ned", "swe", "srb", "ukr", "hun", "ind", "nor", "ptpt", "ptbr", "ro", "sk", "tur". This list is generated from the localiztion files *-gui.cfg located in the data/locale/ folder.
ExportLocale
Exports current localization to the CSV format used by the Localizor.io service. The command creates files export/Localizor/loc-gui.csv and export/Localizor/loc-scripts.csv, where loc is abbreviation of the current localization. The first file corresponds the Translations { } section of the localization file, the second one - the ScriptTranslations { } section.
ImportLocale
Imports the SCV files from the Localizor.io service to the current localization. The command reads two files import/Localizor/loc-gui.csv and import/Localizor/loc-scripts.csv, where loc is abbreviation of the current localization The command, if succeed, backups the current localization file to the data/locale/loc-gui.bak and creates the new data/locale/loc-gui.cfg file with the Translations { } and ScriptTranslations { } sections replaced by the data from the corrsponding CSV file.
Note the difference in file path with the ExportLocale function: import/Localizor/ and export/Localizor/.
PrintTranslations
Prints to the log file a list of text strings and their translations appeared in ShowMessage and WaitMessage commands in a specified script file. Syntax:
PrintTranslations "data/scripts/myscript.sc" - doing this for the script file myscript.sc.
Path to the script file is relative to the SpaceEngine folder. The log file will be filled with a set of lines of this format:
"Message 1" "Сообщение 1"
"Message 2" "Сообщение 2"
"Message 3" "NO TRANSLATION"
"Message 4" "Сообщение 4"
Here "Message X" is original text from all ShowMessage and WaitMessage commands from the script file, "Сообщение X" - their corresponding translations located in the localization file. Currently selected localization is used. If no translation is found in a file, "NO TRANSLATION" text will be typed next to the original string.
Use this command to create/inspect translation of a user script.
DisplayMode
Switches SpaceEngine to a specified display mode. Syntax:
DisplayMode "VR"
Accepted values are: "Normal", "CubeMap", "FishEye", "Cylinder", "VR", "CrossEye", "VerPair", "HorPair", "Anaglyph", "Shutter".
ToggleStereoscopic3D
Switches display mode to the last used 3D or VR mode or back to the 2D mode.
UpdateVRControllerType
Updates the value of the read-only VRControllerType variable. VR controller must be switched on and connected. Possible values which VRControllerType will have are:
0 (controller not detected), 1 (Oculus Touch), 2 (Windows Mixed Reality), 3 (HTC Vive), 4 (HTC Cosmos), 5 (Valve Index), 6 (unknown type).
Bind
Assigns new key/axis binding for a keyboard key, mouse slide, game/VR controller button, stick or touchpad. Syntax:
Bind "Action Name" - changes binding for SpaceEngine action "Action Name" (see below):
{
Controller "XBox 360 controller" - name of the controller. Allowed are names of joysticks/gamepads reported by a system, or a special values: "Mouse", "VR Controller 1", "VR Controller 2". If not provided, this command assigns binding for a keyboard key.
Button "A" - [if Controller is provided] name of a controller button to bind (see below).
Axis "+ Left X" - [if Controller is provided] name of a controller analog axis or mouse movement direction to bind (see below).
Key1 "Ctrl-A" - [if Controller is NOT provided] name of a promary keyboard button to bind (see below).
Key2 "9" - [if Controller is NOT provided] name of a secondary keyboard button to bind (see below).
}
The full list of allowed action names for the Bind command can be seen in the config/keys.cfg, for example "MainMenu", "ToggleToolbars" etc.
Allowed values for the Button parameter:
XBox 360 style gamepads: "A", "B", "X", "Y", "Back", "Guide", "Start", "Left Stick", "Right Stick", "Left Shoulder", "Right Shoulder", "Pad Up", "Pad Down", "Pad Left", "Pad Right".
Steam VR controllers (HTC Vive stick): "A", "System", "Menu", "Grip", "Trigger", "Joystick", "Trackpad left", "Trackpad up", "Trackpad right", "Trackpad down", "Trackpad center".
Left Oculus Touch controller: "X", "Y", "Left Thumbstick", "Left Shoulder", "Menu", "X touch", "Y touch", "Left Thumbstick touch", "Left Trigger touch", "Left Trigger untouch", "Left untouch all", "Left Touchpad", "Left Trigger", "Left Trigger -", "Left Grip", "Left Grip -", "Left Thumbstick right", "Left Thumbstick left", "Left Thumbstick up", "Left Thumbstick down".
Right Oculus Touch controller: "A", "B", "Right Thumbstick", "Right Shoulder", "Home", "A touch", "B touch", "Right Thumbstick touch", "Right Trigger touch", "Right Trigger untouch", "Right untouch all", "Right Touchpad", "Right Trigger", "Right Trigger -", "Right Grip", "Right Grip -", "Right Thumbstick right", "Right Thumbstick left", "Right Thumbstick up", "Right Thumbstick down".
Generic: "But 1" ... "But 128" and hat click directions "Hat 0" ... "Hat 127".Allowed values for the Axis parameter:
Mouse: "+ Mouse X", "- Mouse X", "+ Mouse Y", "- Mouse Y".
XBox 360 style gamepads: "+ Left X", "- Left X", "+ Left Y", "- Left Y", "+ Right X", "- Right X", "+ Right Y", "- Right Y", "+ Left Trigger", "+ Right Trigger".
Steam VR controllers (HTC Vive stick): "Trigger", "Trackpad down", "Trackpad left", "Trackpad right", "Trackpad up".
Oculus Touch controllers: "Trigger", "Grip", "Thumbstick left", "Thumbstick right", "Thumbstick up", "Thumbstick down".
Generic: "+ Axis 1" ... "+ Axis 128", "- Axis 1" ... "- Axis 128".Generic buttons/axes names can be used with any other joysticks/controllers, or to access additional organs of the aforementioned devices.
Note: SteamVR controllers are now configured from outside of SpaceEngine, using SteamVR app, so it is impossible to assign bindings to them using SE scripts.
Allowed values for Key1, Key2 parameters:
"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", ":", "+", ",", "-", ".", "?", "~", "[", "\", "]", "'", "Left Win", "Right Win", "Win Apps", "Sleep", "Numpad 0", "Numpad 1", "Numpad 2", "Numpad 3", "Numpad 4", "Numpad 5", "Numpad 6", "Numpad 7", "Numpad 8", "Numpad 9", "Numpad *", "Numpad +", "Separator", "Numpad -", "Numpad .", "Numpad /", "Backspace", "Tab", "Clear", "Enter", "Shift", "Ctrl", "Menu", "Pause", "Caps Lock", "Esc", "Convert", "Nonconvert", "Accept", "Mode change", "Spacebar", "Page Up", "Page Down", "End", "Home", "Left Arrow", "Up Arrow", "Right Arrow", "Down Arrow", "Select", "Print", "Execute", "Print Screen", "Insert", "Delete", "Help", "Num Lock", "Scroll Lock", "F1", "F2", "F3", "F4", "F5", "F6", "F7", "F8", "F9", "F10", "F11", "F12", "F13", "F14", "F15", "F16", "F17", "F18", "F19", "F20", "F21", "F22", "F23", "F24".
Button names can be prepended with modifiers "Ctrl-", "Shift-", "Alt-" or their combination, for example "Ctrl-Shift-A".
Edit
Toggles an editor for a selected object: the planet editor for a planetary object, nebula editor for a raymarched nebula model, and ship editor for a space ship.
Quit, Exit
Closes SpaceEngine.