Invector/Dialogue System mouse conflict?

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
62qBruv
Posts: 22
Joined: Sun Jul 12, 2020 5:38 pm

Invector/Dialogue System mouse conflict?

Post by 62qBruv »

1DemoMenu2.jpg
1DemoMenu2.jpg (278.45 KiB) Viewed 1658 times
I am using DS 2.2.14 and Invector 2.5.4 with Invector FSM AI 1.1.3. I've reached a point where I just can't overcome an apparent mouse conflict between Invector and DS. I had difficulty with the mouse cursor not appearing when I opened the Invector inventory. I fixed this by unchecking the "LockCursorDuringPlay" in the Demo Menu screen. Then the Demo Menu went haywire. I could save as often as I liked but as soon as I *Loaded* a game the menu then stopped working - no mouse cursor and no button animation even using the arrow keys. After a lot of searching and trial and error (mostly error), I saw the line in the DemoMenu script that referred to "LockCursorDuringPlay" before loading. I commented this line out (I only know enough coding to be dangerous :). The result is I can now save AND load successfully. But - I've lost the cursor in the Invector inventory again!

Can you please suggest anything that might help me. I've totally run out of ideas now. I've attached 6 screen shots that show Invector and DS setups that may affect the mouse. Can you see what I'm doing wrong?
Attachments
5DialogueInputDevice.jpg
5DialogueInputDevice.jpg (111.14 KiB) Viewed 1658 times
4DialogueInputSettings.jpg
4DialogueInputSettings.jpg (133.05 KiB) Viewed 1658 times
3InvectorItemManagerEvents.jpg
3InvectorItemManagerEvents.jpg (127.42 KiB) Viewed 1658 times
2PlayerSetup.jpg
2PlayerSetup.jpg (151.86 KiB) Viewed 1658 times
62qBruv
Posts: 22
Joined: Sun Jul 12, 2020 5:38 pm

Re: Invector/Dialogue System mouse conflict?

Post by 62qBruv »

For some reason I couldn't add the 6th screenshot so here it is here.
Attachments
6DemoMenuSettings.jpg
6DemoMenuSettings.jpg (142.21 KiB) Viewed 1657 times
User avatar
Tony Li
Posts: 21925
Joined: Thu Jul 18, 2013 1:27 pm

Re: Invector/Dialogue System mouse conflict?

Post by Tony Li »

Hi,

The DemoMenu script was really only written to drive the demo scene. You might have an easier time with the simpler SaveSystemTestMenu script. It's also only for testing, not a release-quality menu system. But its mouse handling is a bit more straightforward. Ultimately you'll want to remove both and use a real menu system of your own design. In the meantime, if you want to set up the SaveSystemTestMenu:
  • Remove the DemoMenu script and add a SaveSystemTestMenu instead and tick Pause While Open and Allow Cursor While Open.
  • On the Dialogue Manager, tick the Input Device Manager's Detect Mouse Control, but leave the other checkboxes that you changed unticked.
The SaveSystemTestMenu doesn't have a menu button for the quest log window, but you can add a QuestLogWindowHotkey component to the quest log window or Dialogue Manager.
62qBruv
Posts: 22
Joined: Sun Jul 12, 2020 5:38 pm

Re: Invector/Dialogue System mouse conflict?

Post by 62qBruv »

Thank you so much once again. It's all working now. I had to fiddle with the mouse settings a little but in the end it was pretty much the way you suggested.

I do understand that it would be best to make my own menu but at this stage of my learning curve it's a bit beyond me. I just wanted something simple that would do the job until I get round to looking at all the UI assets I've bought and never used. I really want a stage by stage YouTube tutorial on how to make a menu system using Invector and Dialogue System.
But for now your Test Menu is just what I needed.

Thank you.
User avatar
Tony Li
Posts: 21925
Joined: Thu Jul 18, 2013 1:27 pm

Re: Invector/Dialogue System mouse conflict?

Post by Tony Li »

Glad to help! :-)
62qBruv
Posts: 22
Joined: Sun Jul 12, 2020 5:38 pm

Re: Invector/Dialogue System mouse conflict?

Post by 62qBruv »

Just one little extra thing. Sorry to be a nuisance.

I was still getting a small problem in that the mouse would persist after clicking the save button in the Test menu. I sort of solved it by editing the script and adding "Cursor.visible = false:" at the end of the save game sequence. I don't really know what I'm doing but it seemed to fix it. However, later I noticed the mouse would randomly persist after a dialogue had ended. I tried all the events, but it kept happening so I thought I would try a bit of Lua code in the script section at the end of a conversation branch. But I can't find the Lua equivalent of "Cursor.visible = false:"

Can you tell me what that might be? And also the Lua code for turning the cursor back on?

Just as a side note, I added the C# script instead of Lua and the interpreter got so confused banging out the error messages it quite forgot to show the mouse...so that fixed that. Every cloud eh? But if you could give me those Lua code lines I would be most grateful.
User avatar
Tony Li
Posts: 21925
Joined: Thu Jul 18, 2013 1:27 pm

Re: Invector/Dialogue System mouse conflict?

Post by Tony Li »

Hi,

There is no Lua code to hide the mouse cursor. (Side note: A programmer could write a C# method and register it with Lua, but nothing is built in.)

Don't rely on side effects to make things work. Try this:

1. Make a copy of SaveSystemTestMenu.cs (the one in the Common/Scripts folder) and rename it to something like MyTestMenu.cs.

2. Edit the script.
  • On line 13, change "public class SaveSystemTestMenu" to the name of the script -- for example: "public class MyTestMenu".
  • Change lines 84-85 to:

    Code: Select all

                        Cursor.visible = false;
                        Cursor.lockState = CursorLockMode.Locked;
3. Add a Dialogue System Events component to the player. Configure the OnConversationEnd() event to call the vThirdPersonInput component's ShowCursor (checkbox UNticked) and LockCursor (checkbox ticked) methods.
62qBruv
Posts: 22
Joined: Sun Jul 12, 2020 5:38 pm

Re: Invector/Dialogue System mouse conflict?

Post by 62qBruv »

Wow! Thank you so much. I did all that you said and then dragged my new save script into the Dialogue Manager. With the events you suggested set on conversation end everything worked perfectly. For the first time I was able to play through my project level without errors.

You really are the best.
User avatar
Tony Li
Posts: 21925
Joined: Thu Jul 18, 2013 1:27 pm

Re: Invector/Dialogue System mouse conflict?

Post by Tony Li »

Glad to help!
Post Reply