Scripting



R.U.B.E scenes can be manipulated by scripts typed into the script panel. When a script is run, it affects the scene immediately. Script executions can be undone just like any other action.

Scripts can be useful for repetitive tasks, manipulations that require mathematical functions (eg. trig functions) or fine precision, and for dealing with large datasets where manual work might be tedious (eg. select all bodies named 'ropeSegment' in a scene with dozens of such bodies).

Another great use for scripts is to extend the standard functionality of the program. The contents of the action menu can be customized by providing extra scripts to call when menu items are selected.
More about the action menu.

Each scene has its own active script showing in the Script panel, and this script will be run when you press F5 or click the Run button in the panel. When you switch between different scenes in the workspace, the contents of the script panel will be set to the active script for the current scene.
More about the script panel.

You can set up scripts to be triggered by events or 'hooks' in the application.
More about script hooks setup.

Scripts are implemented in Angelscript, which is similar to Javascript in many ways but is a 'strongly typed' language, meaning you need to declare what type (eg. int, float) each of your variables are before you use them.
More about Angelscript (opens default browser).

R.U.B.E provides many script functions and classes to interact with the scene, and these are collectively known as rubescript. Any operations on a scene that can be done via the GUI can also be done by rubescript, so you can imagine this amounts to an extensive script API.
Please see the rubescript reference pages for more details.