S2ENGINE HD  1.4.6
Official manual about S2Engine HD editor and programming
ScriptViewer

ScriptViewer is the tool for inspecting the script resources of a project and launch the external script editor for editing them.

To open ScriptViewer you can click on Tools->Scripts n the main menu as showed into the following image:

script_tool10.jpg

Or you can click on the scripts icon int the main toolbar as showed into the following image

script_tool09.jpg

Configuring External Editor

S2Engine hasn't an integrated script editor, but you can link an external tool using editor Configuration. Go to File in the main menu and click on Preferences... as showed into the following image

script_tool02.jpg

The Editor Configuration Dialog will appear. You can choose your preferred script editor by clicking on Script Editor Path input box as showed into the following image:

script_tool08.jpg

Creating new script

To create a new script asset:

  1. Go to the desired folder into the scripts browser
  2. Right click mouse on a blank space inside the browser
  3. Click on New File on the appearing drop-down menu
script_tool04.jpg

The New File Dialog will appear. Choose their name you want to assign to the script and then click New.

script_tool03.jpg

Assign Scripts

There are two methods for assigning a script to an object inside a scene:

  1. By object properties
    1. Select the object
    2. In ClassInspector click on script parameter of the object.
      script_tool11.jpg
  2. Drag and drop
    1. Select the object
    2. Open the script folder inside the Scripts browser
    3. Drag and Drop the script asset directly on the object
    4. Click on script in the appearing drop-down menu as showed into the image below
      script_tool06.jpg

Edit Scripts

There are two methods to inspecting a script of an object inside a scene:

  1. By object properties
    1. Select the object
    2. In ClassInspector click right mouse button on script parameter of the object.
    3. Select Inspect on the appearing drop-down menu
  2. Directly inside SceneView
    1. Select the object
    2. Click right mouse button on the selected object
    3. Select Inspect on the appearing drop-down menu as showed into the image below
      script_tool07.jpg

So The ScriptViewer is opened with the selected object script just loaded. To edit the script click on Edit... button as showed into the following image:

script_tool05.jpg

The configured external editor will be opened and the Script will be loaded into.