Forum rules - please read before posting.

Unity UI for Conversation - Marked option already used / Keep option in place


Hi, as title says - I'm using a Unity UI prefab for my conversation menu. Working great except for a couple of things:

1) the option "mark options already used" doesn't have any effect on my text color. Is there something to enable from the Unity side of things? I am using a custom animation but it doesn't influence the text color, only its opacity. 

2) Is there a way to keep the dialogue options assigned to the same button at all times? 

Let's imagine I have 4 dialogue options. 1)East, 2)West, 3)North and 4)South. They are positioned as their names suggest on the screen. 

If I select option 3) North, and then toggle it off, what happens right now is that South takes its place at the top of the screen. It becomes option 3, but I would like to keep it assigned to Button 4. 

Is that possible in AC?


Comments

  • re: 1) I should also say I'm using Unity UI for subtitles. AC overrides the characters' text colour without any problems. 
  • 1) Does the animation affect the opacity of the colour, or something else?  It could be conflicting with AC - you should find that if you revert back to AC's default Conversation Menu / UI prefab, the colour is succesfully changed.

    2) You can do this by creating multiple DialogList elements in your Menu Manager, one for each slot, and linking them to specific UI Buttons.  Replace your DialogList with 4 new ones, and in each check Fixed options number? and set the Option to display from 1-4 respectively.
  • for 1) I tried removing the animator from my prefab and selecting "no animation" from the conversation menu but still no luck. It does work fine when it's an AC menu. 


    2) this is how I had it setup. But when I toggle option 1 off, option 2 takes its place no matter what. 
    I tried the two options "when invisible" (disable object and clear content)

    Note I'm still on 1.54c, maybe a bug there? Updating right now to the latest version and will report. 
  • edited November 2016

    Hmm no luck on 1.55 either. I also tried rebuilding the menu and UI from scratch. 

    Does it make a difference whether I assign the buttons to my menu by dragging them from the project window prefab or the scene hierarchy prefab?

    Because the buttons have correct Constant IDs, but the linked button field always says "none"

  • The elements are connected via the Constant IDs - so long as they're correct, they'll be linked OK.

    1) Try copying in or testing the default AC Conversation Menu, switching it's Source to Unity Ui Prefab.  That should be set up to react to the colour change - assuming so, you should then be able to find the key difference between that prefab and your own.

    2) It's not a bug, but I might have read you wrong.  A Conversation menu's DialogList is mapped to the active conversation options - not the whole thing, disabled options included.  "Option 1" will always be considered to be the first-available option.

    I will consider adding some kind of option to use the "true" index instead, but in the meantime the quickest option is to hack the Conversation.cs script:

    Line 248 is where the function "ConvertSlotToOption" begins, which is where the conversion from menu element index to active dialogue option index is made.  If you enter in "return slot;" above all the other code inside it, you'll disable it - but bear in mind it will break the pre-existing conversation Menus, so only yours will work.
  • Oh thanks, it's starting to make sense now! I'll investigate 1) more.

    re:2) I was certain this "true index" was the main reason to have multiple dialog elements with fixed option numbers. 

    So, sorry if this is going into custom code territory once again. I tweaked the Conversation.cs script like so: 

    image

    However, now toggling a dialogue option off always removes the last option available. (i.e. In a conversation with 4 options, toggling option 1 off actually removes option 4. Same when toggling 2 or 3 off.)

    And in case you consider enabling this "true index" for a next update, my reasoning is that it helps the player when mapping out recurrent options. Especially with a "walking dead" type template where the options aren't presented in rows. 

    For instance, the option to "leave conversation" could always be in the same spot on the screen, making it a bit neater in terms of user experience. 


  • Actually it was the Walking Dead that inspired that feature.  The purpose of it is so that you can arrange them however you like - the Walking Dead template makes use of this to have that game's above/below/left/right arrangement.

    However, this method also needs to be able to account for options being disabled and enabled due to gameplay decisions - so e.g. the "Top" option is always going to be the first-available option, not necessarily index #1.  If you were to have true indices instead, you would then have to ensure the Conversation's first option is always enabled.

    Have a look at the template and see how it's done.  I think this way is the most painless way of doing it - both ways are going to mean some degree of smart management (e.g. always have the fourth-available option to be the "leave" one), but I believe the way it's currently set up is the one with less hassle.
  • Yeah, after playing around with diagrams of what conversations would look like, the "true index" solution becomes a bit of a minefield!

    So I think I'll redesign my UI to display dialogue options in rows instead. That way I can make sure "leave" is always the lowest one onscreen, for example. 

    As always, thanks for the patience and the amazing support here. 
  • edited November 2016
    Oops, one more thing sorry.

    Looks like there's definitely something up with AC overriding the colors for Unity text.

    I've got a fresh copy of AC (no custom code anywhere). 

    AC menus can change the color of the player text and used dialogue options. 

    As soon as I set them to Unity prefab, the color doesn't change. I've tried with new UI prefabs without animations and standard white text for the buttons. Also tried with the WD prefabs.

    Can anyone confirm this is a problem in 1.55? 


  • What happened when you tried the default Conversation Menu, with its Source switched to Unity Ui Prefab?

    It should show the already-chosen option with a grey background, but that's because AC is affecting the Button component's 'Normal' colour, and the Buttons' Target graphic is the Image component.  If you want to change the text colour, set the Target graphic to the Text component instead.


  • Yessssssss!

    It was the button's target graphic. Set it to text and it worked perfectly. 

    AC aces the day again!

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.