Runtime
This class represents a Jacquard bytecode runtime
new Runtime()
Instance Members
Load a file referenced by 'handle'
loadFile(handle: FileIO.handle)
Parameters
Unload the file of specified type.
Note: will reset the runtime state.
removeFile(type: FileIO.Types)
Parameters
Run the main state bytecode. Be sure to act upon messages received.
If a function call message that requires a return value is received,
you won't be able to run again until the return value has been given
to the runtime. (not currently implemented)
run(singleInstruction: any): Message
Parameters
singleInstruction (any)
run only one instruction at a time
Returns
Message:
a message that was generated by the runtime
▸
moveInstructionPointerTo(newIP)
Change the current instruction pointer to another one as specified.
moveInstructionPointerTo(newIP: InstructionPointer)
Parameters
newIP (InstructionPointer)
▸
moveInstructionPointerToNode(nodeName)
Change the instruction pointer to the start of the specified nodename
moveInstructionPointerToNode(nodeName:
string)
Parameters
Reset the runtime to a base state
reset()
▸
currentInstructionPointer
Get the current instruction pointer
currentInstructionPointer
Returns
InstructionPointer:
Returns if the runtime is ready to start
ready
Returns
boolean:
ready to start
Returns if the runtime has encountered any errors
errors
Returns
Array<string>:
ready to start
Returns if a logic file has been loaded
logicLoaded
Returns
boolean:
loaded
Returns if a sourceMap file has been loaded
sourceMapLoaded
Returns
boolean:
loaded
returns the variable list if the logic file is loaded
variableList
Returns
Array<string>:
variable list
Gets the current variable state
variables
returns the function list if the logic file is loaded
functionList
Returns
Array<string>:
function list
returns the character list (in the engine language) if the logic file is loaded
characters
Returns
Array<string>:
character list
returns the character list (in the dialogue language) if the dialogue file is loaded
localizedCharacters
Returns
Array<string>:
character list
Get the entire list of node names
nodeNames
Returns
Array<string>:
node names
Get the list of previously visted nodes (in order)
nodeHistory
Returns
Array<string>:
node names
Runtime Messages
These are all in the "Messages" export
Command
An engine command to execute.
new Command()
Static Members
The arguments of this command
args
Returns
Array<string>:
arguments
EndOfFile
We have reached the end of the file.
new EndOfFile()
Halt
We have halted due to reaching a halt execution command
new Halt()
NodeChange
We have moved to a new node
new NodeChange(nodeName: any)
Parameters
Instance Members
The node name we have moved to
nodeName
Returns
string:
Options
There are selectable options
new Options()
Instance Members
the Instruction Pointers for the options
options
Returns
Array<InstructionPointer>:
Text Messages
These are in the "Messages.Text" export
Show
Dialogue to display
new Show()
Instance Members
ShowPart
A line spoken (optionally) by a character
new ShowPart()
Instance Members
localizedCharacterName
Returns
string:
the localized version of the character name (or null)
characterName
Returns
string:
the engine version of the character name (or null)
characterIndex
Returns
number:
the index of the character name in the tables
text
Returns
string:
The actual text line
Variable Messages
These are in the "Messages.Variable" export
base
The base class for variable messages (not exported)
new base(variableIndex: any, variableName: any, value: any)
Parameters
Instance Members
variableName
Returns
string:
the name of the variable
value
Returns
any:
the value of the variable / to set the variable
index
Returns
any:
the index of the variable name in the table
Save
A variable is being saved
new Save(variableIndex: any, variableName: any, value: any)
Extends
base
Parameters
Load
A variable is being loaded
new Load(variableIndex: any, variableName: any, value: any)
Extends
base
Parameters
FileIO
FileIO operations
FileIO
Static Members
Open some file data (currently the browser File API is supported) for later use
FileIO.Open
Parameters
fileInput (any)
the file data to use as input
Returns
Promise:
a promise that either returns the file stream {FileIO.handle} or an error
A handle to file data.
FileIO.handle
Get type of a file stream
FileIO.Type
Parameters
Returns
FileIO.Types:
file type
File Stream types
FileIO.Types
A Logic file
FileIO.Types.Logic
A Dialog file
FileIO.Types.Dialogue
A SourceMap file
FileIO.Types.SourceMap