PixelCrushers.DialogueSystem.NWNTools Class Reference

This static utility class provides tools to help run Neverwinter Nights (Aurora Toolset) content in the Dialogue System. More...

Static Public Member Functions

static void RegisterNWScriptFunction (object target, MethodInfo function)
 Registers a C# bool NWScript(string scriptName)<c/c> method with the Lua environment. More...
 

Detailed Description

This static utility class provides tools to help run Neverwinter Nights (Aurora Toolset) content in the Dialogue System.

Member Function Documentation

◆ RegisterNWScriptFunction()

static void PixelCrushers.DialogueSystem.NWNTools.RegisterNWScriptFunction ( object  target,
MethodInfo  function 
)
static

Registers a C# bool NWScript(string scriptName)<c/c> method with the Lua environment.

The Dialogue System doesn't implement NWScript. Instead, it calls a Lua function named NWScript, passing the name of the original NWScript script as the parameter. Your method should return a bool value.

Parameters
targetObject containing the method.
functionThe method Lua should call when it encounters "NWScript()".

If you have a class named MyNWScriptClass with an NWScript() implementation named MyNWScript, you can register it with this line of code:

NWNTools.RegisterNWScriptFunction(this, typeof(MyNWScriptClass).GetMethod("MyNWScript"));

Or in WinRT (which doesn't have GetMethod()):

NWNTools.RegisterNWScriptFunction(this, SymbolExtensions.GetMethodInfo(() => MyNWScript(null))););

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