Topic was automatically imported from the old Question2Answer platform.
Asked By
terminalSyzygy
I have a dialog system that parses all of the dialog from JSON and displays it. There’s also a part for the player to enter their name, which gets stored in a variable in one of the scripts. Say the player names themself “John Doe”. I was wondering if in the JSON, I could have a line like:
“Your name is [PLAYERNAME]”
and in-game it would print as:
“Your name is John Doe”.
The closest thing I can think of is custom BBCode but I doubt that’d actually work. Any pointers on how to implement something like this?
var name = "John Doe"
var message = "Your name is %s" % name
Now in message you have the String “Your name is John Doe”. I guess you extract the dialog from the JSON and store it in a variable. If that’s the case, you can use this technique.