Problems with getting player input and name change

Announcements, support questions, and discussion for the Dialogue System.
User avatar
Tony Li
Posts: 21679
Joined: Thu Jul 18, 2013 1:27 pm

Re: Problems with getting player input

Post by Tony Li »

Hi,

If you're not using 2.2.39+, you can import just GameObjectUtility.cs from 2.2.39+ to resolve that dependency. This method was added to GameObjectUtility in 2.2.39 to accommodate API changes in Unity 2023+.
LilGames
Posts: 29
Joined: Fri Jul 07, 2023 6:38 pm

Re: Problems with getting player input

Post by LilGames »

Tony Li wrote: Mon Aug 28, 2023 12:27 pm Hi,

If you're not using 2.2.39+, you can import just GameObjectUtility.cs from 2.2.39+ to resolve that dependency. This method was added to GameObjectUtility in 2.2.39 to accommodate API changes in Unity 2023+.
Correct!
LilGames
Posts: 29
Joined: Fri Jul 07, 2023 6:38 pm

Re: Problems with getting player input and name change

Post by LilGames »

Tony, I've updated and applied the patch and it's still not showing a changed Conversant / Actor's display name until a new conversation is triggered.

Simply explained:
Player display name starts as: ???
Conversation 1:
NPC: What's your name?
Input: Player types in "Mr Bungle"
NPC: Nice to meet you ??? ([var=Conversant]) How are you?
Response: I am fine. (The name shown as Portrait Name for the response panel is still "???")
End

Conversation 2 starts:
NPC: Hello Mr Bungle!
Player: Hi back (portrait name is "Mr Bungle" and [var=Conversant] show the new name.

I've done debugging and I can see that SetPCPortrait() in StandardUIMenuPanel at line 155 is getting "???" instead of the updated value. (I'm having a hard time figuring out where SetPCPortrait() is getting called from. I'll add another post when I do).
LilGames
Posts: 29
Joined: Fri Jul 07, 2023 6:38 pm

Re: Problems with getting player input and name change

Post by LilGames »

I think the problem is line 56 and line 276 in StandardUIResponseMenuControls:

Code: Select all

useFirstResponseForPortrait = useFirstResponseForMenuPortrait;
This bool is blocking updating the portrait name after the very first response. What sets useFirstResponseForMenuPortrait ? Is there a setting somewhere in the Dialogue Manager inspector settings or is this an unexposed variable?

In the meantime, I've changed line 276 :
OLD:

Code: Select all

if (useFirstResponseForPortrait && responses.Length > 0)
NEW:

Code: Select all

if (responses.Length > 0)
Meanwhile, within that first conversation nodes, using [var=Conversant] still shows the old original name. I'll have to dig further to figure that one out (or wait for you ;) )
User avatar
Tony Li
Posts: 21679
Joined: Thu Jul 18, 2013 1:27 pm

Re: Problems with getting player input and name change

Post by Tony Li »

Hi,

You can untick useFirstResponseForMenuPortrait on the StandardDialogueUI component (on the main dialogue UI GameObject). However, you'll want to keep it ticked since this will update the PC name.

Typically when you have a conversation between the player and an NPC, the conversation's Actor is set to the Player actor and the Conversant is set to the NPC. Is it set this way in your conversations? If not, I may have been describing things backwards to you. Try swapping the participants so the conversation's Actor is the player.
LilGames
Posts: 29
Joined: Fri Jul 07, 2023 6:38 pm

Re: Problems with getting player input and name change

Post by LilGames »

Tony Li wrote: Mon Aug 28, 2023 9:38 pm Typically when you have a conversation between the player and an NPC, the conversation's Actor is set to the Player actor and the Conversant is set to the NPC. Is it set this way in your conversations? If not, I may have been describing things backwards to you. Try swapping the participants so the conversation's Actor is the player.
No, I have the Start node with
Actor: NPC
Conversant: Player
User avatar
Tony Li
Posts: 21679
Joined: Thu Jul 18, 2013 1:27 pm

Re: Problems with getting player input and name change

Post by Tony Li »

Try swapping them in Menu > Conversation Properties.
Post Reply