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

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

Post by MudPuppet »

Hello Tony,

No rush but much appreciated. I am a veteran CG artist (2d/3d) so if I can return the favour in some way just let me know.
User avatar
Tony Li
Posts: 20643
Joined: Thu Jul 18, 2013 1:27 pm

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

Post by Tony Li »

Hi,

Please give this a try:

[EDIT: Fixed link]
DS_CorgiRewiredExample_2020-01-21.unitypackage

I haven't fully tested it. I used these steps to set it up:

1. Create a Unity 2019.2 project.

2. Imported Corgi.

3. Imported Rewired.

4. Imported the Dialogue System and Corgi Support package.

5. Started with the Dialogue System's Corgi integration example scene.

6. Closely followed: https://guavaman.com/projects/rewired/d ... orgiEngine
The following notes probably won't make sense until you work through them yourself. Notes:
  • Must add CanvasGroups to the Rewired Touch Controller > Joystick, Arrows, and Button to be able to assign them to UICamera's GUIManager.
  • In the Rewired Editor, added Interact action, Custom Controllers (TouchController), Custom Controller Maps.
  • Also added TouchController mappings for UI > UIHorizontal, UIVertical, and UISubmit.
  • Set the Rewired Corgi Engine Input Manager's Forced Mode dropdown to Mobile.
7. Added an Interact touch button. It's the ugly red button on the screen to the left of the "A" (jump) button. Rewired's Corgi integration was written before Corgi had an Interact input, so we have to add it manually. The NPC's ConversationZone listens for the Interact input.

8. Added a Rewired Event System: https://guavaman.com/projects/rewired/d ... odule.html

At this point, if you play in the editor, you can use the onscreen touch arrows to move to the NPC. Then press the ugly red button to start the conversation.

The scene has a Rewired Event System, so it should use Rewired for navigation. The arrow keys are mapped to UIVertical, and the "A" button is mapped to UISubmit. So it should work on an actual mobile build. In the editor, however, when you click with the mouse to simulate a touch, the Event System also interprets it as a mouse click and deselects the response menu. Either that or I misconfigured the Event System. I didn't have time today to test an actual mobile build. If it doesn't work in a mobile build, I recommend contacting the Rewired dev to ask about setting up the Rewired Event System to work with Rewired's touch arrows.
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,

Freaking Awesome!!! I am just about to give it a whirl. Yeah I am now familiar with setting up Rewired to work with Corgi/TDE as per their docs so will see how it all pans out for me. Again much thanks for helping me work through this situation. My Corgi project will only be using DS in a very basic fashion but my TDE project is more like an Adventure game so having something as simple as controller stuff out of the way will be great for allowing me to delve further in DS. I am also hoping to utilise DS in my main project (a mobile race game) for Barks on AI vehicles but fortunately I have already conquered that in the Corgi project :D
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, just wondering if you may have supplied the wrong file link (DS_DelayedStartExample)?
User avatar
Tony Li
Posts: 20643
Joined: Thu Jul 18, 2013 1:27 pm

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

Post by Tony Li »

Doh! Sorry, I copy-pasted the wrong name. I just fixed the link in my post above.
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 »

Much thanks for that I will check it out shortly. Following your instructions I did manage to get the virtual joystick to work with responses but got stuck with the interact button part (not for a lack of trying though). Hehe, and then I changed a setting in rewired and screwed up the joystick part LOL!.

Hopefully today I can get it all sorted. I was also looking through some of the other DS posts yesterday and man can things get technical - but a lot be achieved. It makes me glad that my own usage will be minimal and that DS can do everything I want it to fairly easily. I will never be a programmer (not for a lack of trying in over 30+ years) but always try to solve things myself where possible so that I can learn to do stuff on my own without the need to pester anyone else.
User avatar
Tony Li
Posts: 20643
Joined: Thu Jul 18, 2013 1:27 pm

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

Post by Tony Li »

There's always the option to get really technical, but you can usually skip all of that. A large number of games have been made with the Dialogue System with absolutely no other coding, and in many cases even without visual scripting systems such as PlayMaker.
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 »

WooT!!! I got it working with both virtual joystick/arrows and it works just fine in an iOS build on my iPhoneX (I tested both joystick and arrows).

For anyone else following this thread the only step that was missing was adding the custom controller maps to the player (one for the Default category and one for the UI category).

Now I can apply this setup to my own projects and move forwards. Much thanks Tony for taking the time to help me work through this situation especially when it didn't have much to do with the Dialogue System itself.
Attachments
Corgi_DS_Rewired_LastStep.jpg
Corgi_DS_Rewired_LastStep.jpg (216.96 KiB) Viewed 918 times
User avatar
Tony Li
Posts: 20643
Joined: Thu Jul 18, 2013 1:27 pm

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

Post by Tony Li »

Awesome! Thanks for sharing the final step.
Post Reply