Game Development Community

Mouse input problem found (and solved)

by Ben Smith · in Torque Game Engine · 11/20/2006 (10:29 pm) · 14 replies

Hello All!

I am brand spankin new to the torque platform (and loving it so far!), and am in my first day, so this might be a really dumb thing. (and although i figured out a way around it, i thought i would put it up here in case anyone had some insight, or was having a similar problem)

Anyhow, I am developing on Torque 1.5 on the Mac, and I am went through the tutorial. Everythign seemed to be going OK until i quit and restarted with all the scripts in place ready for a 'real' test of the 'pick up the logos' game.

When i dropped into the mission, i had no mouse control. i could still move via the keyboard, but i couldnt look a different direction than the one i was facing when i fell in. Anyhow, I managed to collect all the logos and everything else was working fine.

After a bit of tweaking i managed to remap the key commands to turnRight and turnLeft , panUp and panDown, so i could see that the interface was fine, but still no mouse. i even put echo statements in the mousetrigger callbacks, and stil nothing.

if i switch back to tutorial.base for the defaul, the mouse worked fine.

i waded through the forums and searched the docs and I couldnt find anything.

So, after a bit of good old fashioned debugging, i discovered that the tutorial.base/clinet/ui/playGUI.gui file contained:

noCursor = "1";

in the GameTSCtrl(PlayGui) declaration.

wheras the one in my gameOne/client/ui/playGUI.gui file did not.

(note it also had: helpTag = "0"; which i don't know what it does)

Anyhow, i added noCursor = "1"; by hand to the playGUI.gui file and everything works great now. (i noticed after all this that without the nocursor declaration, you do, in face have the mouse arrow in the gui (altho it does nothing at this point) and with the nocursor = 0; the arrow is gone (fancy that) and you have full camera control back)

The problem now is that whenever i make a change to the playGUI.gui in the GUI editor, it saves it without the noCursor = "1"; line that seems so important. and so to really test i have to manually edit that file. (which isn't a really big deal) I am wondering if anyone knows how to fix this? (i havent yet delved into the C code yet, as it is my first day and all, but i am planning on it soon)

Thanks!
-Ben

About the author

Recent Threads


#1
11/20/2006 (10:41 pm)
I just posted the exact same problem in the SDK bugs forum. The editor changes a lot of code for some reason.

www.garagegames.com/mg/forums/result.thread.php?qt=54117

I guess we just have to open the playGui.gui in notepad everytime and replace the 'GameTSCtrl(PlayGui)' with:

new GameTSCtrl(PlayGui) {
   profile = "GuiContentProfile";
   horizSizing = "right";
   vertSizing = "bottom";
   position = "0 0";
   extent = "640 480";
   minExtent = "8 8";
   visible = "1";
   helpTag = "0";
      noCursor = "1";

or just add the noCursor line :D
To keep format: copy paste in wordpad, select all and copy/paste in your editor.
#2
11/20/2006 (11:16 pm)
Ahh! OK, groovy.

I am glad it is a known issue and not just something i am doing. (and hopefully we have both added some more searchable text for the next newb to come around :-)

I will probably just write a little perl script to do it for me, since i am in that learning phase where i change the gui seven kabillion times a day :-)

Cheers!
-ben
#3
11/21/2006 (4:08 am)
You need to set canSaveDynamicFields = "1"; so that it doesnt happen next time you save the PlayGui.

I fixed this in 1.4 SVN fairly recently, and 1.5 just now, so it'll filter back out eventually.
#4
11/22/2006 (8:37 pm)
Thanks so much, I had this problem and couldn't figure out how to fix it. This helped alot! =)

xnemorax
#5
01/19/2007 (4:47 am)
Really Thanks, it was help a lot!!!!

;)
#6
01/20/2007 (8:44 am)
@mb
@Tom Bampton

Thanks, the cursor.problem was driving me nuts. :-)
#7
02/07/2007 (12:58 pm)
Hey guys, just to let you know that it happens with TGB too. So, people is having trouble with that in TGB this solution also works in TGB.
#8
02/09/2007 (12:26 am)
Hey thanks

Thought i was being a dumbass when i couldn't work out why the curser stayed on screen and stopped me from turning.
:D
#9
02/14/2007 (4:14 pm)
Thank you Ben!
#10
02/22/2007 (3:49 am)
Puzzled was I as well! ;)

I was close. Thanks!
#11
03/11/2007 (5:42 pm)
I tried to add a link to this thread on the Torque Intro tutorial page (http://tdn.garagegames.com/wiki/Beginner/Torque_Intro) but for some reason adding the link kept breaking the page.
#12
03/13/2007 (2:04 pm)
@Tom:
Quote:You need to set canSaveDynamicFields = "1"
The same aggravating thing was happening to me, so I intend to include this sort of gotcha in the documentation I am writing for the Gui Editor.

@Ouchie: You tried to add the following to Beginner/Torque_Intro:
If you can't move your player's view with your mouse, please see this thread: 
http://www.garagegames.com/mg/forums/result.thread.php?qt=54116
Because the the point where you added it was inside the argument of a template, you have to escape the "=" character in the url. Try, instead:
If you can't move your player's view with your mouse, please see this thread: 
http://www.garagegames.com/mg/forums/result.thread.php?qt<nowiki>=</nowiki>54116
#13
03/02/2009 (3:40 pm)
Thanks mate!
I was having same problem and couldn't work out the solution.
Cheers for the help
#14
05/11/2009 (2:22 pm)
O thank you. I thought I was losing my mind!