Page 1 of 1

Send a message at the end of dialogue text & Change actor display name on runtime

Posted: Wed Aug 12, 2020 3:41 am
by jeffpny1123
1.) How to Send Messages on the end of dialogue text?
Image
I have tried to use @{{end}}, but it has some delay for 1 - 2 seconds.
I want to immediately call the function.

2.) How to Change actor display name?
Image
I want to directly change the display name on runtime.
For example:
Image


Reference: change Actor's name on runtime:
https://www.pixelcrushers.com/phpbb/viewtopic.php?t=339
I have tried this but it failed. The name has not to be changed.

Re: Send a message at the end of dialogue text & Change actor display name on runtime

Posted: Wed Aug 12, 2020 8:54 am
by Tony Li
Hi,
jeffpny1123 wrote: Wed Aug 12, 2020 3:41 am1.) How to Send Messages on the end of dialogue text?
The value of {{end}} is based on the text length and the Dialogue Manager's Subtitle Settings. It is not based on the typewriter. If you want to send the message exactly when the typewriter ends, use @Message(Typed) instead:

Code: Select all

SendMessage(CallDebug,,CallFunctionGameObject)@Message(Typed)
jeffpny1123 wrote: Wed Aug 12, 2020 3:41 am2.) How to Change actor display name?
You can set the actor's Display Name field in C#:

Code: Select all

DialogueLua.SetActorField("Player", "Display Name", "New Player Name);
Or in Lua (e.g., Script field):

Code: Select all

Actor["Player"].Display_Name = "New Player Name"
However, since conversations cache the display name when the conversation starts, the change won't be visible until the next conversation. If you want it to be visible immediately, see the Discover Name Example on the Dialogue System Extras page.