change Actor's name on runtime

Announcements, support questions, and discussion for the Dialogue System.
mmopulencia
Posts: 15
Joined: Tue Aug 07, 2018 2:49 am

Re: change Actor's name on runtime

Post by mmopulencia »

Nevermind this question , found a work around that works , heheh just created a new actor and replaced it on the conversor thing.
User avatar
Tony Li
Posts: 21079
Joined: Thu Jul 18, 2013 1:27 pm

Re: change Actor's name on runtime

Post by Tony Li »

Okay. The other way (using Display Name) should work. If you want to pursue it in the future, let me know.
dragonlord3989
Posts: 8
Joined: Sat Jan 02, 2016 3:31 pm

Re: change Actor's name on runtime

Post by dragonlord3989 »

Tony Li wrote: Wed Aug 15, 2018 9:53 am Okay. The other way (using Display Name) should work. If you want to pursue it in the future, let me know.
Hey sorry for the necropost but is there a way to limit the amount of characters one can use in the input box I have this set https://gyazo.com/4d992c3fd45d8feca48dc09d698b7038 how ever when I start the game and the game calls the dialogue script

Code: Select all

SetContinueMode(false);
TextInput(Text Field UI, Name, Name).
it sets the character limit back down to 0
User avatar
Tony Li
Posts: 21079
Joined: Thu Jul 18, 2013 1:27 pm

Re: change Actor's name on runtime

Post by Tony Li »

Hi,

You can specify the max length as an optional fourth parameter:

Code: Select all

TextInput(Text Field UI, Name, Name, 10)
This allows you to specify a different character limit for each TextInput() command.

If you want to clear the input field, too, you can specify the keyword 'clear' as an optional fifth parameter. For example:

Code: Select all

TextInput(Text Field UI, Name, Name, 10, clear)
Otherwise it will use the current value of the variable "Name" as the input field's starting value.
dragonlord3989
Posts: 8
Joined: Sat Jan 02, 2016 3:31 pm

Re: change Actor's name on runtime

Post by dragonlord3989 »

Thank you for you quick response.
User avatar
Tony Li
Posts: 21079
Joined: Thu Jul 18, 2013 1:27 pm

Re: change Actor's name on runtime

Post by Tony Li »

Glad to help!
shortlin
Posts: 73
Joined: Wed Jun 03, 2020 1:52 am

Re: change Actor's name on runtime

Post by shortlin »

Tony Li wrote: Tue Aug 14, 2018 11:02 pm Hi,

The actor's Name should always remain the same. Instead, change the actor's Display Name. Try this:

1. In the Dialogue Editor window's Actors section, set the actor's Name to Flame.

2. Tick Use Display Name, and set the Display Name to ???.

3. In the dialogue entry node's Script field, use the dropdowns or type this in manually:

Code: Select all

Actor["Flame"].Display_Name = "Flame"
Hi Tony Sorry to put up the question
Does the script "Actor["Flame"].Display_Name = "Flame" still work now?
I tried to type this code in a node's script,the actor's name still not change.
User avatar
Tony Li
Posts: 21079
Joined: Thu Jul 18, 2013 1:27 pm

Re: change Actor's name on runtime

Post by Tony Li »

Hi,

It works, but not during the same conversation. The Dialogue System caches display names at the beginning of the conversation so it doesn't have to spend time to look up the display name with each node.

If you want to change a character's display name in the middle of a conversation, see the "Discover Name Example" scene in on the Dialogue System Extras page.
Post Reply