Scripting: Micro Script

The micro script is directly attached to the object and stored when the object is saved in the scene or saved as a preset. The term micro script under sells this script type, there is nothing micro about it at all it is a full powered script, only that it is unique to this object. Be aware that if you delete the object, this script is lost forever. Optionally you could save this micro script to file for a later use then delete your object.

Adding a micro script can be done in a variety of ways read on to find out how.

Method 1 - Adding a micro script

When learning scripting in Skyline, the micro script is a great starting point for messing around with lua. You don't have to worry about saving the script as it is saved with the scene. Just don't forget to save your scene!

a) Select the object and RMB (Right Mouse Button), from this menu select “Lua –Add Micro Script”



b) The Script editor will than open with a new micro script for this object.
c) Make your script changes and press save in the script editor to update the object with the script changes.

Micro Script Context Menu

Note: This menu item is dynamic / context sensitive, meaning that its function changes depending on the objects state i.e. when you go back to an object with an attached micro script this menu item will read “Lua – [Edit] Micro Script” by selecting this option you will be sent straight to this objects script ready to continue scripting.

Method 2 - Adding a micro script

An alternative way to access the micro script is to use the property icons.

a) Select the object to attach a micro script to and open the property panel. At the top of these properties you can see a few small icons, select the script icon.



b) This will auto add a micro script and open it in the editor for you.
c) Subsequent use of this icon on an object containing a micro script will send you directly to the objects micro script.
NOTE: If the object doesn’t have a micro script but uses an external script then this icon will open the external script for you.

Method 3 - Adding a micro script

As the micro script is a Skyline Action, the other way to add this script type is via the action editor.

a) Select the object and either use the [RMB] “Action Editor”



Or alternatively use the properties action editor icon. These will open the action editor for ready to attach any action to this selected object.



Method 3 - Continued

From this action editor select the category “Script” and choose the Micro Script option.

Method 3 - Completed

Use the Blue arrows at the bottom to Add or remove action to this object or alternatively Double click the Action Name.



You will then be able to open the script in the normal ways mentioned above.