Forum rules - please read before posting.

Workflow suggestion: display two (or more) character portraits at once

Hello there, first time posting!
Recently, I bought Adventure Creator, and I am giving my first steps with it. I am pleased with everything I see (although, a bit overwhelmed at times), but I have some doubts about what is the best way of portraying two, or more, characters in a dialogue at the same time, a.k.a, Layton-esque dialogue:

I have placed properly the text box, but I am having trouble with character portraits. I have read the Portrait tutorial, and made it to work, but currently, this system only allows for one portrait to be displayed and updated at the same time.
Before jumping straight into coding a custom solution, since I am still a noob on AC, I would like to ask you about what possible solution could be the best.
Right now, I have two ideas:
-One where I change, via Action, the correspondant portrait when playing a certain line. This could be kind of tedious, as I have to register every portrait change by hand on the Action Editor.
-The other, a custom script (possibly, a modification of Portrait) that checks which character is talking, which emotion is displaying, and which UI image should modify. This seems more elegant and automatic, but requires work on a codebase I am unfamiliar with.

I will still be researching AC, but until I found a solution I am comfortable with, I would like to hear what suggestions do you have, since I figure I am not the first one that intends to make this particular tweak.

Comments

  • edited May 2020

    Welcome to the community, @Cabreira.

    This is actually something I've been looking into as part of the v1.70.0 update. If you haven't already, back up your project and grab it - as it should make this scenario much easier to achieve.

    Setting a Graphic element's "Graphic type" to "Portrait" does indeed set it to be the speaking character. However, with the new update it's now possible to override this through simple script:

    MenuGraphic menuGraphic = PlayerMenus.GetElementWithName ("MyMenu", "MyGraphicElement") as MenuGraphic);
    menuGraphic.PortraitCharacterOverride = myCharacter;
    

    This was used to create the "Gabriel Knight interface" template over on the Downloads page.

    I thought it would be useful as a custom Action as well, so I've written one here:

    https://adventure-creator.fandom.com/wiki/Override_portrait_graphic_elements

    To install it, place the script in a new folder in your project, and point to it in the Actions Manager. It should then appear as Menu: Set portrait override.

    What you can then do is create your portrait elements in the menu, and use this Action to force them to show only the portrait of a specific character.

  • Thank you very much, I will check it

  • edited May 2020

    Ok, I have touched here and there, and I think I understand the functionallity of this method, pretty elegant and handy.
    Just one doubt: the field "PortraitCharacterOverride" of "Menu Graphics" class seems that doesn't exist. I have the latest AC version, so I don't exactly were the error is. I am missing any file, or is something I should code myself?
    Edit; I am using v 1.70.4

  • Solved! For an unknown reason, 1.71 update didn't show up for me until today. I have already updated, and everything works perfectly now.

  • Ok, I have another problem:
    I tried the method using AC UI system, and everything goes fine.
    But I tried using Unity UI prefabs (which I prefer, since I am more comfortable working with them), and I get that portrait images doesn't get updated at all, and remain as the default white box.
    Debugging, I have learned that:
    -PortraitOverride is set properly on the Action code
    -When reaching PreDisplay function in MenuGraphics, and checking PortraitOverride, is set to null

    I have added the Menu Elements, and linked the Images from the UI prefab. I am missing something?

  • Can you share uncropped screens of your full Menu's properties, as well as details of how /when you're actually overriding the portrait?

    AC won't reset the portrait override specifically, but if you have Duplicate for each line? checked in a Subtitle menu's properties, then a new instance of that menu will be generated each time a line is displayed.

    Try inserting the following into the MenuGraphic script's CopyGraphic function:

    portraitCharacterOverride = _element.portraitCharacterOverride;
    

    Does that resolve it?

  • I put the line in the CopyGraphic function, but doesn't seem to change anything (in fact, the function was not even called when starting dialogue).
    Here is the Menu in its fullest:


    "Duplicate for each line" was unchecked

    This is how the UI Prefab is made:

    I checked the IDs, and seems to be correct.

    And this is how I call the override (works with AC UI, doesn't with Unity UI):

  • I'll attempt a recreation, but I'll need to see those Actions in context. When is this list being called in relation to the Menu actually showing / speech being displayed?

  • Recreated - never mind the list details.

    Unfortunately a fix requires some changes made to a couple of other scripts, but I will include it in the next minor release. Apologies, but it should be out soon.

  • Is nothing urgent for me right now, but glad to hear

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.