Question about Instantion

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
Morgank
Posts: 14
Joined: Fri May 13, 2022 5:29 pm

Question about Instantion

Post by Morgank »

Hello!

I want ask about response buttons instantion. Is it possible somehow to spawn instantiated buttons not in one place, but near each other without using Layout Groups? There are a lot of objects in Dialogue UI Panel, so they are moving alongside the response buttons when I am using Layout Groups. It's really hard to sync everything while using them especially with instantiated buttons.

As I understand this part of the Menu Panel code responds for the button instantion, but I wasn't able to modify it accordingly to my needs. Can you help me with this please?
Screenshot_84.png
Screenshot_84.png (8.72 KiB) Viewed 308 times
Second question is about Orc Framework. I'm only planning to buy it. Does Dialogue System supports conversations during battles created with Orc? I'm planning to do some kind of tutorial battle.
User avatar
Tony Li
Posts: 22143
Joined: Thu Jul 18, 2013 1:27 pm

Re: Question about Instantion

Post by Tony Li »

Hi,
Morgank wrote: Wed Aug 10, 2022 1:02 pm I want ask about response buttons instantion. Is it possible somehow to spawn instantiated buttons not in one place, but near each other without using Layout Groups? There are a lot of objects in Dialogue UI Panel, so they are moving alongside the response buttons when I am using Layout Groups. It's really hard to sync everything while using them especially with instantiated buttons.

As I understand this part of the Menu Panel code responds for the button instantion, but I wasn't able to modify it accordingly to my needs. Can you help me with this please?
Screenshot_84.png
Layout groups aren't required. When the menu instantiates a response button, it simply makes it a child of the Button Template Holder. If the Button Template Holder happens to have a layout group, that layout group will affect the buttons. If it doesn't have a layout group, that's fine, too.

If you don't want to instantiate buttons, you can create and position buttons at runtime. Assign them to the menu panel's Buttons list.

More details about dialogue UIs: UI Tutorial #1
Morgank wrote: Wed Aug 10, 2022 1:02 pmSecond question is about Orc Framework. I'm only planning to buy it. Does Dialogue System supports conversations during battles created with Orc? I'm planning to do some kind of tutorial battle.
Yes, you can do that.
Morgank
Posts: 14
Joined: Fri May 13, 2022 5:29 pm

Re: Question about Instantion

Post by Morgank »

Thanks for the reply!
Tony Li wrote: Wed Aug 10, 2022 2:02 pmIf you don't want to instantiate buttons, you can create and position buttons at runtime. Assign them to the menu panel's Buttons list.
The problem is that I want to instantiate them, so they would overlap the objects with NPC and PC subtitles and this objects could've afterwards overlap the object with responses like on screenshot. New responses will replace old responses if they are not instantiated.
Screenshot_85.png
Screenshot_85.png (241.16 KiB) Viewed 302 times
Tony Li wrote: Wed Aug 10, 2022 2:02 pmIf it doesn't have a layout group, that's fine, too.
But if Button Template Holder doesn't have the layout group then the response buttons will instantiate in the same spot and the last choice will overlap previous. At least that's how it goes in my case, so I kinda want them to instantiate next to each other, but not at the same spot. I don't understand how to do this at this moment.
User avatar
Tony Li
Posts: 22143
Joined: Thu Jul 18, 2013 1:27 pm

Re: Question about Instantion

Post by Tony Li »

Hi,

Got it. And to navigate the cards (response buttons), you want to be able to promote one to the front or slide them left/right? If so, perhaps you could use an asset for that, like Card Slider 2D. I've never used Card Slider 2D; I just searched up "cards" on the Asset Store. But presumably you could drop it onto the Button Template Holder to get it to handle the response buttons as cards.
Morgank
Posts: 14
Joined: Fri May 13, 2022 5:29 pm

Re: Question about Instantion

Post by Morgank »

Tony Li wrote: Wed Aug 10, 2022 3:23 pm Hi,

Got it. And to navigate the cards (response buttons), you want to be able to promote one to the front or slide them left/right? If so, perhaps you could use an asset for that, like Card Slider 2D. I've never used Card Slider 2D; I just searched up "cards" on the Asset Store. But presumably you could drop it onto the Button Template Holder to get it to handle the response buttons as cards.
Actually, it should be more like on screenshots. Choices should instantiate like this.
Screenshot_86.png
Screenshot_86.png (419.23 KiB) Viewed 300 times

The chosen response must move to the other cards. Unselected answers must go down and be deactivated.
Screenshot_88.png
Screenshot_88.png (411.65 KiB) Viewed 300 times
Screenshot_87.png
Screenshot_87.png (293.9 KiB) Viewed 300 times

And onto the card with choice goes card with next subtitle.

So the problem is in placing instantiated responses like on first screenshot. They are all piling on the same place.
User avatar
Tony Li
Posts: 22143
Joined: Thu Jul 18, 2013 1:27 pm

Re: Question about Instantion

Post by Tony Li »

Create 3 response buttons in the places where you show "No", "Yeah", and "...". Assign the 3 response buttons to the StandardUIMenuPanel's Buttons list.

UNassign the Button Template and Button Template Holder.

Set up a single subtitle panel in the place where you show "Do you like...". Assign it to the StandardDialogueUI's Conversation UI Elements > Default NPC Subtitle Panel and Default PC Subtitle Panel.

Tick the Dialogue Manager GameObject's Display Settings > Subtitle Settings > Show PC Subtitles During Line. UNtick Skip PC Subtitle After Response Menu.

If you need me to put together an example scene that does the above, let me know.
Post Reply