Open UIS Shop with UCC using Controller

Announcements, support questions, and discussion for the Dialogue System.
CruttMutt
Posts: 41
Joined: Wed May 06, 2020 9:44 am

Open UIS Shop with UCC using Controller

Post by CruttMutt »

Hello!

Sorry to ask but I am trying to open a UIS shop using DS with a controller (incontrol). I can get the conversation and the shop to open but it does not end the conversation properly when I do so I can not control the menu properly because if I push "submit" it still controls DS and closes the last DS subtitle and I regain character control while the menu is open. I looked at the demo and added the "@{{end}}" to the end of the sequence assuming that was it like "at the end, open shop". The shop does not open at all now though.

Is this something simple or not something that's been tested much? It's sort of cramming multi intergrations in now so I understand why it may not work. It's not super necessary but if it's an easy fix and you already know what's up it would be a nice feature :)

To save time here is my final sequence lua where the shop opens (before adding the "@{{end}}"):

AnimatorPlay(Talk1,, 2); OpenShop(Food Shop, Food Shop Menu, PLAYER_Roybus)

Here's a little vid to make it clear what I'm talking about and trying to do. It's a great DS starting toc ome along so would be lovely to use it to come into menus too. But no biggie.

User avatar
Tony Li
Posts: 22049
Joined: Thu Jul 18, 2013 1:27 pm

Re: Open UIS Shop with UCC using Controller

Post by Tony Li »

Hi,

Use OpenShop() on the last node of the conversation.

It looks like you're using a continue button, so you might try a Sequence like this:

Code: Select all

AnimatorPlay(Talk1,, 2); 
required AnimatorPlay(Idle)@{{end}}; // Alternatively use @Message(Typed) instead of @{{end}}
required OpenShop(Food Shop, Food Shop Menu, PLAYER_Roybus)@9999
The last line opens the shop at the 9999-second mark. (There are other ways to delay it, but I think that's simplest for this reply.) The 'required' keyword guarantees that the command runs even if the player skips ahead before the 9999-second mark, which is pretty much guaranteed to happen.
CruttMutt
Posts: 41
Joined: Wed May 06, 2020 9:44 am

Re: Open UIS Shop with UCC using Controller

Post by CruttMutt »

Okay great, thanks!
Solid progress as now the shop opens nicely at the end. I still seem to gain control of the UCC character once the conversation ends and while the shop is open. Is this more likely to do with opsive side of things? I assume your part sort of end right there ey? Haha. Really handy tip though! Thanks :D I'll keep playing around with it.

And yes I am using a continue button FYI if there is a better way to go about that for this particular job.
CruttMutt
Posts: 41
Joined: Wed May 06, 2020 9:44 am

Re: Open UIS Shop with UCC using Controller

Post by CruttMutt »

Nevermind! I don't even know why I asked. I just made a script to stop the player movement when the menu was open as an extra buffer and it's all working great now. For some reason I thought that would be messy but it's fine :D

Thanks!!
User avatar
Tony Li
Posts: 22049
Joined: Thu Jul 18, 2013 1:27 pm

Re: Open UIS Shop with UCC using Controller

Post by Tony Li »

Great! And if you want to require the player to press a button to advance the conversation, continue buttons are absolutely the way to go.
CruttMutt
Posts: 41
Joined: Wed May 06, 2020 9:44 am

Re: Open UIS Shop with UCC using Controller

Post by CruttMutt »

Haha it didn't quite work as well as I hoped. Seems my scrips caused more issues down the line. I'm not a strong inventive scripter yet so I assume maybe triggering events by active game objects is probably not a great way to go.

I assume when the conversation ends, the DM gives back control to the player right? So when the menu opens it has not been able to then take control away again? I suppose I am needing to stop the DM from giving control back until the shop is also finished.

My script was able to stop control so long as the shop menu game object was active but by using the event to stop the character I was unable to use the mouse correctly in the menus. Only a controller works. An odd issue haha.

I am going to keep playing around but if you have a suggestion to how I can prevent the character control when the DM ends to continue over to the shop it would be very welcome haha.
User avatar
Tony Li
Posts: 22049
Joined: Thu Jul 18, 2013 1:27 pm

Re: Open UIS Shop with UCC using Controller

Post by Tony Li »

Hi,

Contact the dev, Santiago, about the shop issues. He should be able to help with the mouse issue and the character pause issue. EDIT: First, make sure you've defined the Scripting Define Symbol "UIS" (Edit > Project Settings > Player > Other Settings > Scripting Define Symbols). This tells the UCC integration that it should be aware of UIS.

Alternatively, if you just want to get it working, use a second Dialogue System Trigger set to OnConversationEnd:

uisuccOpenShop.png
uisuccOpenShop.png (70.88 KiB) Viewed 1346 times

In the example above, the first Dialogue System Trigger is assigned to the Interactable. It plays a conversation. In the conversation, the player can select a response that sets a variable "openShopNow" true.

The second Dialogue System Trigger fires when the conversation ends. If "openShopNow" is true, it resets it and opens the shop.
User avatar
Tony Li
Posts: 22049
Joined: Thu Jul 18, 2013 1:27 pm

Re: Open UIS Shop with UCC using Controller

Post by Tony Li »

Regarding the mouse and player controls: Make sure you've defined the Scripting Define Symbol "UIS" (Edit > Project Settings > Player > Other Settings > Scripting Define Symbols). This tells the UCC integration that it should be aware of UIS.
CruttMutt
Posts: 41
Joined: Wed May 06, 2020 9:44 am

Re: Open UIS Shop with UCC using Controller

Post by CruttMutt »

Yeah wow I think we are definitely onto something with that suggestion involving the 2 dialogue system triggers. I think the way you are telling me to do it will work definitely. I can see it clear as day now and even just saying that has opened my eyes to so much more understanding within the system.

Unfortunately, typical user style.... The "On End Conversation" does not seem to work for me for some reason. I have even simplified it to the point of just having no variables at all on a simple conversation and "On End Conversation" to only deactivates a "test" game object from active to inactive to see if it was working and it doesn't do it... Nothing fancy in there. It seems like a great feature and I wonder why it is not working for me. So now I just need to get past this.

Sorry to take up so much of your time! I seem to just be snowballing you here haha.

I have the latest versions of DS and using Unity 2019.4.21f1.

Here is a simple vid to make life easier so you can see the settings are all there (sorry I have scaled the 3D portraits quite to move with the screen yet haha):



PS: Thanks for the tips on the Scripting Define Symbols! Did not quite work for me just yet but I will continue that conversation with Santiago. You've opened me up to some interesting reading material from there. I really hope one day I understand Unity as you do! Very inspirational.
User avatar
Tony Li
Posts: 22049
Joined: Thu Jul 18, 2013 1:27 pm

Re: Open UIS Shop with UCC using Controller

Post by Tony Li »

Hi,

Let's make sure you have the most up-to-date integration. Please check the Converse.cs script. Do lines 117-118 look like this?

Code: Select all

#if UIS
// If using UIS and menu is open, keep gameplay input disabled and show cursor:
That code and the "UIS" Scripting Define Symbol are required to allow conversations to handle the OpenShop() sequencer command properly with UCC.

For the OnConversationEnd issue, the OnConversationEnd event only occurs on the Dialogue Manager GameObject and the two participants (Conversation Actor and Conversation Conversant). If the OnConversationEnd Dialogue System Trigger doesn't fire, it's probably because:
  • The GameObject with the OnConversationEnd Dialogue System Trigger isn't being used as the Conversation Conversant, or
  • The Conditions on that Trigger aren't met -- for example, the "openShopNow" DS variable isn't true.
Post Reply