The classes/objects of the HALion Script language are structured in the following class hierarchy.
HALion Script Class Hierarchy
Classes deeper down inherit the data fields and methods of classes higher up in the class hierarchy. For example, the classes Bus, Instance, Layer, Effect, and so on, inherit all data fields and methods of the Element class. Subclasses add functionality to their parent class by providing more data fields and methods.
The Lua Script MIDI module itself can be addressed with
this. Further objects can be addressed with
this.program or with the get/find functions.
|Returns the object of the script module itself.||MidiModule|
|Returns the object of the parent element, which can be a Layer or the Program.||Layer or Program|
|Returns the object of the Program.||Program|
After addressing an object, you can read its fields through dot-notation. In the following example, the name and the type of different objects are printed with
For more information on the available fields, see the description of the classes in the Class Reference.
To operate on an element in the Program Tree, you must first adress its object and then call the desired method. The basic syntax is as follows:
Using type() on Objects
For the HALion Script language the type() function of Lua has been extended to return the type of an object.