Problems with getting player input and name change

Announcements, support questions, and discussion for the Dialogue System.
LilGames
Posts: 29
Joined: Fri Jul 07, 2023 6:38 pm

Problems with getting player input and name change

Post by LilGames »

Hi Tony,
I followed instructions here for getting player input :
https://www.pixelcrushers.com/phpbb/vie ... hp?p=23993

... but it's not working out. The input field appears but if I click the full-screen next button, it just skips ahead. How do I force it to wait for input? (aka: disable the next button for that node only?)
conversation-input.png
conversation-input.png (15.23 KiB) Viewed 691 times
There was also a different way to set up the input where I put the sequence commands into the previous node, but then the text input would appear right away while the text typewriter'd in.

While I'm here, I might as well ask my NEXT question now: I want the input text entered to then replace the Player's Display Name.
Last edited by LilGames on Mon Aug 28, 2023 6:44 pm, edited 1 time in total.
User avatar
Tony Li
Posts: 22112
Joined: Thu Jul 18, 2013 1:27 pm

Re: Problems with getting player input

Post by Tony Li »

Hi,

Set that node's Sequence to:

Code: Select all

SetContinueMode(false);
TextInput(Text Field UI, Name:, Conversant)
And set the next node's Sequence to:

Code: Select all

{{default}}; SetContinueMode(original)
This will disable the continue button while waiting for TextInput, and the next node will enable the continue button.
LilGames
Posts: 29
Joined: Fri Jul 07, 2023 6:38 pm

Re: Problems with getting player input

Post by LilGames »

Thanks, that sent me down a good path. I changed the script to alter a variable instead and then set the Actor Display Name to that variable. However now the Portrait name stays as the old value UNTIL that conversation is ended and restarted. It's like the Conversant name is cached. Is there a way to update it while in the conversation?

I tried this but the second line doesnt work:

Code: Select all

Actor["Player"].Display_Name = Variable["playerName"];
Conversant = Variable["playerName"]
Tried this too:

Code: Select all

Variable["Conversant"] = Variable["playerName"]
Oh maybe it's the textfield that's set once only on starting the conversation?
LilGames
Posts: 29
Joined: Fri Jul 07, 2023 6:38 pm

Re: Problems with getting player input

Post by LilGames »

I also tried this, but it didn't work:

Code: Select all

ChangeActorName("Player", Variable["playerName"])
(Variation of example found in DiscoverName package conversation)
User avatar
Tony Li
Posts: 22112
Joined: Thu Jul 18, 2013 1:27 pm

Re: Problems with getting player input

Post by Tony Li »

ChangeActorName() should do it.

Are there any errors or warnings in the Console window?

Are you sure Variable["playerName"] contains the correct value?
LilGames
Posts: 29
Joined: Fri Jul 07, 2023 6:38 pm

Re: Problems with getting player input

Post by LilGames »

Yes, "playerName" gets the correct value because I can see it in subsequent conversation nodes if I add [var=playerName]. Also the Actor name IS changed internally, as that is displayed correctly in conversation nodes, if I use [var=Conversant].

HOWEVER what is not instantly reflected, like in your Mephistophles demo, is the Portrait name for the conversant. It stays with the original Actor name UNTIL I trigger another conversation after the previous one has finished. The portrait name is not automatically updating.
User avatar
Tony Li
Posts: 22112
Joined: Thu Jul 18, 2013 1:27 pm

Re: Problems with getting player input

Post by Tony Li »

In version 2.2.39 and earlier, the portrait name change takes effect the next time the actor shows a subtitle. If your player only shows response menus and not subtitles, it the portrait name won't change.

This patch, which will also be in 2.2.40, changes ChangeActorName() so it updates the portrait name immediately:

DS_ChangeActorNamePatch_2023-08-25.unitypackage
LilGames
Posts: 29
Joined: Fri Jul 07, 2023 6:38 pm

Re: Problems with getting player input

Post by LilGames »

Thank you!
User avatar
Tony Li
Posts: 22112
Joined: Thu Jul 18, 2013 1:27 pm

Re: Problems with getting player input

Post by Tony Li »

Glad to help!
LilGames
Posts: 29
Joined: Fri Jul 07, 2023 6:38 pm

Re: Problems with getting player input

Post by LilGames »

I'm sorry, there's actually a dependency missing:

Code: Select all

Assets\Plugins\Pixel Crushers\Dialogue System\Scripts\Manager\DialogueSystemController.cs(381,60): error CS0117: 'GameObjectUtility' does not contain a definition for 'FindObjectsByType'
Last edited by LilGames on Mon Aug 28, 2023 1:52 pm, edited 2 times in total.
Post Reply