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+.
Problems with getting player input and name change
Re: Problems with getting player input and name change
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).
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).
Re: Problems with getting player input and name change
I think the problem is line 56 and line 276 in StandardUIResponseMenuControls:
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:
NEW:
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 )
Code: Select all
useFirstResponseForPortrait = useFirstResponseForMenuPortrait;
In the meantime, I've changed line 276 :
OLD:
Code: Select all
if (useFirstResponseForPortrait && responses.Length > 0)
Code: Select all
if (responses.Length > 0)
Re: Problems with getting player input and name change
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.
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.
Re: Problems with getting player input and name change
No, I have the Start node withTony 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.
Actor: NPC
Conversant: Player
Re: Problems with getting player input and name change
Try swapping them in Menu > Conversation Properties.