Hi
Newish AC user; experienced programmer/game dev. Forgive any terminology or not knowing about systems. I've been reading docs but am far from a AC expert.
AC Version: 1.79.3
Goal: We would like a portrait to display during both subtitles and conversations (dialog). The former was added easily enough following the documentation.
Steps Taken for Conversations
The above "works" with speech. The image is updated for the correct character for each line. (Kudos for this system, its done well).
Problem: Conversations (Dialog) don't have any association about who is speaking (which Chris says here . So when a Start Conversation event is triggered there is no associated person "speaking" those dialog options. And, the last person speaking isn't always valid as this is a common case:
Idea
OnConversationStart
eventAC.Char
variable to the Conversation
class so that we can set the current character who is saying this dialog.OnConversationStart
event, set the Image to be the portrait of who this dialog is associated with.Is this a reasonable approach? Any other suggestions?
Images:
Menu: https://ibb.co/pzzxqRk
Menu Element: https://ibb.co/BwNnvhM
(Note: While the Linked Image shows as "Missing" it is still linked as it updates correctly. I assume this is a bug, since its referencing a prefab?
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
Welcome to the community, @Phantasie.
Apologies for your post being temporarily hidden - it was mistakenly auto-flagged as spam, but I've verified your account so it shouldn't happen again.
It's best to avoid editing AC's core scripts. Rather than adding a Char variable to Conversation (and also updating ConversationEditor to display it), you can attach a new C# script that has the variable stored, and then use GetComponent in the event to extract it.
You could also merge the OnConversationStart event call into this same script.
The MenuGraphic element has a PortraitCharacterOverride property that - when set - will override the default behaviour of showing its associated speech character. What you could try is assign the custom character when the conversation begins, and then clear this override when an option is chosen.
Something like this, attached to a Conversation, should do it:
It's actually the Constant ID that the Menu uses to keep track of the linked UI object, with the Editor's Linked Image field only used to initially assign it. Though, the upcoming v1.80 update will keep the field assigned, it annoyed me as well.
Hi
Yes, I saw it was hidden. I assumed it was because I edited it. I was going to wait until today to DM you. Thank you
Agree 100%. Your solution makes much more sense and avoids merge conflicts in the future. I was unaware of
PlayerMenus.GetElementWithName
which makes this much easier.This will also solve a different problem - the ConversationStarted event was fired before the Portrait UI was enabled - and it the Enable function in that class is what subscribed to the event in the first place - meaning it didn't get it. Many ways to fix, but felt wrong.
Ill try what you said today and follow up if any issues.
Thanks for the detailed response.