Been searching on the forums for an answer to this one. I kind of get what I have to do, but still a little confused.
In my game, the player types what they want to call their character in an input field. What they enter in that gets stored in a variable called playername in a script called PlayerName.
I've looked into how to reference variables with Lua and tried doing it but not been successful so I'm assuming I'm doing something wrong.
Would super appreciate the help.
Using the Player's name in dialogue when it's stored in a variable in a different script
Re: Using the Player's name in dialogue when it's stored in a variable in a different script
Hi,
Once you have the player name, set the Player actor's Display Name.
For example, in C# you can set the player's name to "Rose" like this:
In Lua (such as in a dialogue entry node's Script field), like this:
Once you have the player name, set the Player actor's Display Name.
For example, in C# you can set the player's name to "Rose" like this:
Code: Select all
DialogueLua.SetActorField("Player", "Display Name", "Rose");
Code: Select all
Actor["Player"].Display_Name = "Rose"