Anvil
Anvil.API.VirtualMachine Class Reference

Standard and Low Level methods and properties for querying/interacting with the NwScript virtual machine. More...

+ Inheritance diagram for Anvil.API.VirtualMachine:
+ Collaboration diagram for Anvil.API.VirtualMachine:

Public Member Functions

void Execute (string scriptName, NwObject? target, params(string ParamName, string ParamValue)[] scriptParams)
 Executes the specified NWN script. If scriptName does not specify a compiled script, nothing happens. More...
 
void Execute (string scriptName, params(string ParamName, string ParamValue)[] scriptParams)
 Executes the specified NWN script. If scriptName does not specify a compiled script, nothing happens. More...
 
void ExecuteInScriptContext (System.Action action, uint objectId=NwObject.Invalid, int scriptEventId=0)
 
ExecuteInScriptContext< T > (System.Func< T > action, uint objectId=NwObject.Invalid, int scriptEventId=0)
 
string? GetCurrentScriptName (int depth=0)
 Gets the name of the currently executing script.
If depth is > 0, it will return the name of the script that called this one via ExecuteScript(). More...
 

Properties

EventScriptType CurrentRunningEvent [get, set]
 Gets or sets the current running script event. More...
 
uint InstructionLimit [get, set]
 Gets or sets the instruction limit for the NWScript VM. More...
 
uint InstructionsExecuted [get, set]
 
bool IsInScriptContext [get]
 Returns true if the current executing code is being executed on the main thread, and in a Virtual Machine script context. More...
 
int RecursionLevel [get]
 
bool ScriptReturnValue [get]
 

Detailed Description

Standard and Low Level methods and properties for querying/interacting with the NwScript virtual machine.

Member Function Documentation

◆ Execute() [1/2]

void Anvil.API.VirtualMachine.Execute ( string  scriptName,
NwObject target,
params(string ParamName, string ParamValue)[]  scriptParams 
)
inline

Executes the specified NWN script. If scriptName does not specify a compiled script, nothing happens.

◆ Execute() [2/2]

void Anvil.API.VirtualMachine.Execute ( string  scriptName,
params(string ParamName, string ParamValue)[]  scriptParams 
)
inline

Executes the specified NWN script. If scriptName does not specify a compiled script, nothing happens.

◆ GetCurrentScriptName()

string? Anvil.API.VirtualMachine.GetCurrentScriptName ( int  depth = 0)
inline

Gets the name of the currently executing script.
If depth is > 0, it will return the name of the script that called this one via ExecuteScript().

Parameters
depthdepth to seek the executing script.
Returns
The name of the currently executing script.

Property Documentation

◆ CurrentRunningEvent

EventScriptType Anvil.API.VirtualMachine.CurrentRunningEvent
getset

Gets or sets the current running script event.

◆ InstructionLimit

uint Anvil.API.VirtualMachine.InstructionLimit
getset

Gets or sets the instruction limit for the NWScript VM.

◆ IsInScriptContext

bool Anvil.API.VirtualMachine.IsInScriptContext
get

Returns true if the current executing code is being executed on the main thread, and in a Virtual Machine script context.


The documentation for this class was generated from the following file: