This is the code I've been trying to make work, mainly based on very old forum posts from here;
Code: Select all
void Start() {
Lua.RegisterFunction("SetOverrideName", null, SymbolExtensions.GetMethodInfo(() => SetOverrideName(string.Empty, string.Empty)));
}
public static void SetOverrideName(string Tarul, string nameOfPlayer)
{
var go = GameObject.Find("Tarul"); //Tarul is the name of the player game object
nameOfPlayer = go.GetComponent<PlayerName>().nameOfPlayer; //Getting my player's name from a script on the player
if (go == null) return;
var overrideActorName = go.GetComponent<OverrideActorName>() ?? go.AddComponent<OverrideActorName>();
overrideActorName.overrideName = nameOfPlayer;
}
This script above is attached to the Dialogue Manager and "SetOverrideName" doesn't show as an option when I try to apply it to the Continue button.
Thanks for any help!