Tiri is a customised scripting language for the Script class.
Tiri is a custom scripting language for Kotuku developers. It is implemented on the backbone of LuaJIT, a high performance version of the Lua scripting language. It supports garbage collection, dynamic typing and a 64-bit byte-code interpreter for compiled code.
Tiri files use the .tiri file extension. Ideally, scripts should start with the comment '-- $TIRI' near the start of the document so that it can be correctly identified by the Tiri class.
For more information on the Tiri syntax, please refer to the official Tiri Reference Manual.
Sets any variable in a loaded Tiri script.
| Parameter | Description |
|---|---|
| Script | Pointer to a Tiri script. |
| Name | The name of the variable to set. |
| Type | A valid field type must be indicated, e.g. FD_STRING, FD_POINTER, FD_INT, FD_DOUBLE, FD_INT64. |
| Variable | A variable that matches the indicated Type. |
The SetVariable() function provides a method for setting global variables in a Tiri script prior to execution of that script. If the script is cached, the variable settings will be available on the next activation.
Before the first activation, no script policy is attached to the global environment, so host-provided variables are unconstrained and may be overwritten by declarations in the script source. After the first activation, variable stores are subject to the script's sticky global type contracts, const bindings and protected built-ins.
| Okay | The variable was defined successfully. |
|---|---|
| Args | Invalid arguments passed to function |
| SetField | A Lua allocation or other runtime error prevented the store. |
| ObjectCorrupt | Privately maintained memory has become inaccessible. |
| FieldTypeMismatch | A valid field type was not specified, or the value conflicts with a sticky global type contract. |
| ReadOnly | The requested name is a protected built-in or an initialised const global. |
| InvalidState | The script does not have an active Tiri state, or is currently executing. |
JET constants are documented in GetInputEvent()
| Name | Description |
|---|---|
| JET::ABS_XY | The X, Y values are defined as absolute coordinates, relative to the top-left of the display |
| JET::BUTTON_1 | Left mouse button; XBox A button, PS square button. Value is pressure sensitive, ranging between 0 - 1.0 (0 is released, 1.0 is fully depressed) |
| JET::BUTTON_10 | Non-specific button assignment |
| JET::BUTTON_2 | Right mouse button; XBox X button, PS cross button |
| JET::BUTTON_3 | Middle mouse button; XBox Y button, PS triangle |
| JET::BUTTON_4 | Alt. mouse button 1; XBox B button, PS circle |
| JET::BUTTON_5 | Alt. mouse button 2 |
| JET::BUTTON_6 | Non-specific button assignment |
| JET::BUTTON_7 | Non-specific button assignment |
| JET::BUTTON_8 | Non-specific button assignment |
| JET::BUTTON_9 | Non-specific button assignment |
| JET::CROSSED_IN | This message is sent by the input system when the mouse pointer enters an area for the first time. The message value refers to the object ID of the container being monitored for movement |
| JET::CROSSED_OUT | This message is sent by the input system when the mouse pointer leaves an area. The message value refers to the object ID of the container being monitored for movement |
| JET::DEVICE_TILT_XY | Controller tilted on the X/Y axis. Value indicates angle, -ve = left, +ve = right |
| JET::DEVICE_TILT_Z | Controller is rising or falling. Value expressed as 'speed', |
| JET::DISPLAY_EDGE | Recently supplied input occurred at the edge of the display |
| JET::PEN_TILT_XY | Pen tilt angle. 0 is pointing down directly with nib at bottom, 0.5 is 90 degrees, 1.0 is inversed (eraser at bottom) |
| JET::PRESSURE | Amount of pressure applied, ranges from 0 (none) to 1.0 (normal) and possibly higher if user presses hard enough |
| JET::WHEEL | Mouse wheel rotation - the value generally reflects the number of 'clicks' rotated on the wheel |
| JET::WHEEL_TILT | Some mouse wheels can be tilted to the left or right. Ranges from -1.0 to +1.0 |
JTYPE flags are used to categorise input types
| Name | Description |
|---|---|
| JTYPE::ANALOG | Analog movement (ranging from -1.0 to 1.0) |
| JTYPE::ANCHORED | Cursor has been anchored with LockCursor() |
| JTYPE::BUTTON | Input is a physical button or switch |
| JTYPE::CROSSING | Crossing events manage the entering and leaving of an area |
| JTYPE::DBL_CLICK | Set by the input system if the Type is a button and the button has been clicked in quick succession so as to be classed as a double-click |
| JTYPE::DIGITAL | D-Pad or digital joystick source (restricted to +/- 1) |
| JTYPE::DRAGGED | Set if sufficient movement occurred between the original click and its point of release (usually requires a 3 or more pixel difference) |
| JTYPE::DRAG_ITEM | This special flag is set by the input system if the pointer is click-dragging an object at the time of the event |
| JTYPE::EXT_MOVEMENT | Extended or indirect movement information. This covers all types of movement that are unconnected to coordinate positioning - mouse wheel movement and pen tilt are two such examples |
| JTYPE::MOVEMENT | X/Y coordinate movement only. Movement such as the wheel mouse spinning is not covered by this type as it does not influence the coordinate system |
| JTYPE::REPEATED | Input is a repeated entry (i.e. user is holding down a button and a repetition timer is being triggered) |
| JTYPE::SECONDARY | Indicates to the receiver of this message that it is not the primary/original recipient |