Dialogue System :: Corgi Mobile Setup for Joystick/Arrows and Buttons

Announcements, support questions, and discussion for the Dialogue System.
MudPuppet
Posts: 24
Joined: Sun Jan 19, 2020 7:41 pm

Dialogue System :: Corgi Mobile Setup for Joystick/Arrows and Buttons

Post by MudPuppet »

Hello, I am running a vanilla project with the latest versions of Dialogue System and Corgi Engine. Currently I am completely stumped as to how to get your Corgi Engine demo scene to operate with the standard Corgi mobile controls.

Everything works perfectly in desktop mode in both vanilla project and my own one (which has a basic quest setup implemented).

What I am trying to achieve is have the player character walk up to an NPC, click the Jump button to fire up the conversation (all good with that part), but then use the same Jump button to act like your continue button setup (as per docs), then be able to use either joystick/arrow-buttons to pick player responses, and finally use the Jump button again to select the response.

Thus far I have fiddled with Unity3d Input Settings, Corgi Input Manager, and DS input manager. In my own project I am using Control Freak (3rd party controller asset) but hoped to get things working in the vanilla project first.

Any assistance would be greatly appreciated.
User avatar
Tony Li
Posts: 20389
Joined: Thu Jul 18, 2013 1:27 pm

Re: Dialogue System :: Corgi Mobile Setup for Joystick/Arrows and Buttons

Post by Tony Li »

Hi,

Do you want to use a physical joystick to navigate player responses, or a mobile virtual joystick?

If you want to use a physical joystick/gamepad or arrow keys, inspect the Dialogue Manager's Input Device Manager component and tick Always Auto Focus.

On mobile, normally you'd just tap to pick a response.

Dialogue UIs are standard Unity UI. As long as your Unity UI EventSystem handles input, the dialogue UI should work. In particular, the EventSystem needs to handle the Submit Button to click the dialogue UI's continue button and response buttons, and the Vertical Axis to handle navigating up and down the response menu.

Are button clicks not responding, or response menu navigation, or both?

I'm finishing up work for the day, but I'll check back first thing in the morning.
MudPuppet
Posts: 24
Joined: Sun Jan 19, 2020 7:41 pm

Re: Dialogue System :: Corgi Mobile Setup for Joystick/Arrows and Buttons

Post by MudPuppet »

Hello,

Definitely using Virtual Joystick/Arrows and Buttons - as per what is provided in the Corgi Engine.

Yeah I did wonder if using Touch for picking responses was the norm but felt it was a bit abnormal(?) when the player would already have their thumb/fingers already near the virtual controls.

The EventSystem seems to be set up okay but am definitely getting no response with button clicks or Joystick/Arrows controls.

It has been a while since I last tried to solve this situation so I might also create a fresh vanilla project in the morning to be sure that I haven't inadvertently messed something up at my end. Much thanks for responding so quickly. No urgency with this as I was just having a break from some other workloads.
User avatar
Tony Li
Posts: 20389
Joined: Thu Jul 18, 2013 1:27 pm

Re: Dialogue System :: Corgi Mobile Setup for Joystick/Arrows and Buttons

Post by Tony Li »

Hi,

Neither Corgi's virtual input nor Control Freak work with Unity UI's EventSystem out of the box. Here are some options for working with Unity UI:

1. Ask the Control Freak developer to write an input module.

2. Write your own input module. (More info: Unity UI source code repository, built-in input modules source)

3. Rely on Unity's built-in Standard Input Module or Touch Input Module, which use taps instead of virtual joysticks to interact with buttons.

4. A hit hacky, but possibly simpler to implement: Listen for Control Freak's virtual joystick/arrow input and manually change the Unity UI EventSystem's current selection (e.g., by calling EventSystem.current.SetSelectedGameObject).

5. Switch to Rewired. It has a custom input module. I haven't used it with touch, but I think it should work fine.
MudPuppet
Posts: 24
Joined: Sun Jan 19, 2020 7:41 pm

Re: Dialogue System :: Corgi Mobile Setup for Joystick/Arrows and Buttons

Post by MudPuppet »

Hello Tony,

Thanks heaps for that information. At least now I can look into the situation properly. I have actually been considering switching to Rewired for some time as it would be a bit of a step into a similar scenario as the new Unity3d Input System.

I purchased the Dialogue System around the end of June 2019 as a last business purchase before I shut it all down. My primary reasons were how it ties in with the Corgi Engine/Top-Down Engine etc and to replace my own little quest manager with something far more professional and robust. Thus far I have managed to succeed with the implementation. Hehe, except the virtual control stuff - but I will get there : )

Again, thanks heaps for your help and pointing me in the right direction.
User avatar
Tony Li
Posts: 20389
Joined: Thu Jul 18, 2013 1:27 pm

Re: Dialogue System :: Corgi Mobile Setup for Joystick/Arrows and Buttons

Post by Tony Li »

Sorry I wasn't able to help much with this one since it's kind of outside the Dialogue System's scope. But if any other questions come up, please ask. And if you have questions about setting up Rewired, in particular with the Dialogue System, feel free to ask
MudPuppet
Posts: 24
Joined: Sun Jan 19, 2020 7:41 pm

Re: Dialogue System :: Corgi Mobile Setup for Joystick/Arrows and Buttons

Post by MudPuppet »

Hey Tony,

No worries. I just purchased Rewired so will try and get into that with some other projects to get my head around it before looking at my Corgi Engine or TDE projects. If I get stuck sorting it out with DS I will head back here and have a dig through the forum.
User avatar
Tony Li
Posts: 20389
Joined: Thu Jul 18, 2013 1:27 pm

Re: Dialogue System :: Corgi Mobile Setup for Joystick/Arrows and Buttons

Post by Tony Li »

Sounds good. Control Freak is nice, too, but the documentation for Rewired is worlds better. I'm actually working on Rewired configuration in a project right this moment, coincidentally. :-)
MudPuppet
Posts: 24
Joined: Sun Jan 19, 2020 7:41 pm

Re: Dialogue System :: Corgi Mobile Setup for Joystick/Arrows and Buttons

Post by MudPuppet »

I was just thinking... so that I am not wasting your time with lengthy forum posts as I try to sort this out, would it be easier at your end to supply a basic adjustment on your Corgi Example scene using the Rewired Corgi Touch Control Prefab? Then at least I can look at the setup in DS and possibly spot any places where I was going wrong and/or apply the same setup to my Top-Down Engine project (which obviously uses the same Corgi Controls).

After that I can look at further DS/Rewired stuff at my leisure and know that at least I have a basic working setup to refer to and expand upon.

As mentioned previously all I am wanting to achieve is use the Jump (Green A) Button to act like the continue button and Joystick/Arrows to pick a conversation response.

Normally I would never ask for something like this but I don't want to be wasting your time responding to forum posts when I could just refer to an example scene and answer my own questions.
User avatar
Tony Li
Posts: 20389
Joined: Thu Jul 18, 2013 1:27 pm

Re: Dialogue System :: Corgi Mobile Setup for Joystick/Arrows and Buttons

Post by Tony Li »

Sure, I'll put together a simple example when I get back into the office. (I have to be out of the office for several hours today.)
Post Reply