Difference between revisions of "Develop:LavishScript"
(Created page with "LavishScript is the scripting engine built into Inner Space, and is used for in-client features during gameplay. If you have any previous experience with programming, this...") |
|||
| Line 1: | Line 1: | ||
| + | == Overview == | ||
LavishScript is the scripting engine built into [[Inner Space]], and is used for in-client features during gameplay. If you have any previous experience with programming, this page should help you get started with the LavishScript required for ISBoxer 2 Module development. | LavishScript is the scripting engine built into [[Inner Space]], and is used for in-client features during gameplay. If you have any previous experience with programming, this page should help you get started with the LavishScript required for ISBoxer 2 Module development. | ||
| Line 12: | Line 13: | ||
LavishScript also includes object-oriented (OO) features. ISBoxer 2 Modules are created using LavishScript object definitions (objectdefs). | LavishScript also includes object-oriented (OO) features. ISBoxer 2 Modules are created using LavishScript object definitions (objectdefs). | ||
| − | ; In the following example, a LavishScript object is defined, with a constructor and destructor (Initialize and Shutdown methods) | + | ; In the following example, a LavishScript object is defined, with a constructor and destructor (Initialize and Shutdown methods), and a template for handling a Task |
/* | /* | ||
| − | Module: | + | Module: My First Module |
| − | Version: 0.1 | + | Version: 0.1 |
This file controls and defines behaviors for the Module! For use in-client. | This file controls and defines behaviors for the Module! For use in-client. | ||
*/ | */ | ||
| − | objectdef | + | objectdef isb2_MFM_controller inherits isboxer2module_controller |
| − | { | + | { |
| − | + | ||
| − | + | method Initialize() | |
| − | + | { | |
| − | + | ; Construct | |
| + | } | ||
| + | |||
| + | method Shutdown() | ||
| + | { | ||
| + | ; Destruct | ||
| + | } | ||
| + | |||
| + | method Task_Test() | ||
| + | { | ||
| + | switch ${Context.TaskState} | ||
| + | { | ||
| + | case Start | ||
| + | echo ${Context(type)} ${Context.Timestamp} ${Context.ElapsedMS} ${Context.Task} ${Context.TaskState} instant=${Context.Task.IsInstant} ${Context.Task.Args} | ||
| + | break | ||
| + | case Continue | ||
| + | ; echo ${Context(type)} ${Context.Timestamp} ${Context.ElapsedMS} ${Context.Task} ${Context.TaskState} instant=${Context.Task.IsInstant} ${Context.Task.Args} | ||
| + | break | ||
| + | case Stop | ||
| + | echo ${Context(type)} ${Context.Timestamp} ${Context.ElapsedMS} ${Context.Task} ${Context.TaskState} instant=${Context.Task.IsInstant} ${Context.Task.Args} | ||
| + | break | ||
| + | } | ||
| − | + | } | |
| − | + | } | |
| − | + | ||
| − | + | The above example also contains examples of [[LavishScript:Data Sequences|Data Sequences]], such as <tt>${Context.TaskState}</tt>. This particular sequence obtains the value of TaskState from an object called Context, placing the result in-place within the command line. | |
| − | |||
| − | + | == Tutorials and Guides == | |
| + | Coming soon. :) | ||
| − | == | + | == LavishScript References == |
* [https://www.lavishsoft.com/wiki/index.php/LavishScript LavishScript wiki at lavishsoft.com] | * [https://www.lavishsoft.com/wiki/index.php/LavishScript LavishScript wiki at lavishsoft.com] | ||
Revision as of 12:57, 27 May 2019
Overview
LavishScript is the scripting engine built into Inner Space, and is used for in-client features during gameplay. If you have any previous experience with programming, this page should help you get started with the LavishScript required for ISBoxer 2 Module development.
LavishScript is primarily based on a command parser (i.e. those that might be entered into a command prompt), with in-place text replacement of "data sequences".
- In the following example, the Echo command is used to print "Hello World!" to a LavishScript console.
function main()
{
echo "Hello World!"
}
LavishScript also includes object-oriented (OO) features. ISBoxer 2 Modules are created using LavishScript object definitions (objectdefs).
- In the following example, a LavishScript object is defined, with a constructor and destructor (Initialize and Shutdown methods), and a template for handling a Task
/*
Module: My First Module
Version: 0.1
This file controls and defines behaviors for the Module! For use in-client.
*/
objectdef isb2_MFM_controller inherits isboxer2module_controller
{
method Initialize()
{
; Construct
}
method Shutdown()
{
; Destruct
}
method Task_Test()
{
switch ${Context.TaskState}
{
case Start
echo ${Context(type)} ${Context.Timestamp} ${Context.ElapsedMS} ${Context.Task} ${Context.TaskState} instant=${Context.Task.IsInstant} ${Context.Task.Args}
break
case Continue
; echo ${Context(type)} ${Context.Timestamp} ${Context.ElapsedMS} ${Context.Task} ${Context.TaskState} instant=${Context.Task.IsInstant} ${Context.Task.Args}
break
case Stop
echo ${Context(type)} ${Context.Timestamp} ${Context.ElapsedMS} ${Context.Task} ${Context.TaskState} instant=${Context.Task.IsInstant} ${Context.Task.Args}
break
}
}
}
The above example also contains examples of Data Sequences, such as ${Context.TaskState}. This particular sequence obtains the value of TaskState from an object called Context, placing the result in-place within the command line.
Tutorials and Guides
Coming soon. :)