Passing Display Name of conversant as a string parameter to a registered function
Posted: Sun Sep 06, 2020 8:26 am
Hello,
I have a created a C# method and tried to register it in Lua. This method accepts a string parameter. A snippet of that is available below-
I then registered it in the Lua custom function table, and tried to use it in a dialogue tree. I tried to pass the display name of the current conversant as a string, but I have been getting a syntax error when using Actor[Variable["Conversant"]] or Variable["Conversant"] as the string parameter.
I have a created a C# method and tried to register it in Lua. This method accepts a string parameter. A snippet of that is available below-
Code: Select all
public void OnEnable()
{
// Make the functions available to Lua: (Replace these lines with your own.)
Lua.RegisterFunction("ExampleMethod", this, SymbolExtensions.GetMethodInfo(() => ExampleMethod((string)null)));
}
public void OnDisable()
{
if (unregisterOnDisable)
{
// Remove the functions from Lua: (Replace these lines with your own.)
Lua.UnregisterFunction("ExampleMethod");
}
}