Game Development Community

Should mouse work in "GameOne" tutorial?

by Steve Howson · in Torque Game Engine · 10/26/2006 (9:17 pm) · 18 replies

Hi all!
Just DLd 1.5 after about a year away from Torque, so figured I'd start from scratch.

I went through the 'Getting Started' tutorial and everything works, except the mouse.

Should the mouse work in this?
Just want to make sure something didn't get hosed.

Thanks!

#1
10/27/2006 (1:03 am)
You mean in the start? where it sais all those options and stuff? the guis? if theres no mouse on that then its a problem
#2
10/27/2006 (3:53 am)
Should the mouse work like what?

I can't see what you're doing so you'll have to be more descriptive :)

The mouse should work the same as it does in the demos and earlier versions of Torque. If it's not or it's behaving strangely, then yes, something is wrong there.

More detail will help GG staff or the forum members help you track down the problem :)

Good luck!
#3
10/27/2006 (7:01 pm)
I'm having the same issue. All is well, following the GameOne tutorial to a T.. I get to the Scripting section (where you add the onCollision function to logoitem.cs), and all of a sudden the mouse is no longer rotating the camera/player; rather, it is showing up as a cursor on the screen after starting the mission. I tried getting rid of the onCollision function I added, but it does not help. I ran starter.fps and tutorial.base just to see if the mouse worked properly in those and it did. I checked console.log for any mouse related issues but saw none. I put

if ( isObject( mouse ) ) echo( " ** Mouse DOES exist!" );


into client\default.bind.cs just to see (not even sure if mouse is a proper object, but worth a shot) and sure enough, it doesn't come up. Not sure what the issue is..
#4
10/27/2006 (7:43 pm)
Saska and James,
I mean in the game, menus work fine.
In fact in the game the mouse pointer is still visible, it's like the control over the mouse never gets passed to the game.

Corey,
I've done similar stuff that you have and haven't been able to solve it either, not sure what happened.

If you find a solution please post it here for others and I'll do the same.

Thanks.
#5
10/28/2006 (6:56 am)
Any luck with this, Steve? I prodded and poked a bit here and there but still no luck. Rather discouraging, as I can't come up with any logical reason why this should be occuring..
#6
10/28/2006 (7:28 am)
Well, this morning I decided to try things form a different angle, so I once again copied over tutorial.base and called it GameTwo. I redid my mission file, added in the appropriate gui files, and everything was working great. I got the collision code in for the torque logos, and everything was swell, this was farther than I got with GameOne. I exited the game, added in the client commands (clientCmdScoreCounter and clientCmdSetScore), and started the game back up. Now I have the same problem. I have a mouse cursor, but the mouse cursor is not controlling the movement of the player character.

Does anyone have any tips on things to look for in console.log, or some bit of code I can chuck in to make sure the mouse is functioning properly? Seems like a silly bug to be getting so hung up on.
#7
10/28/2006 (12:09 pm)
I wanted to try a little experiment to see what I *could* do with the mouse, and modified default.binds.cs to reflect the following:

function mouseTrigger(%val)
{
   echo( "Mouse trigger hit!" );
   $mvTriggerCount0++;
}
moveMap.bind( mouse, button0, mouseTrigger );

And sure enough, no echo to the console when you hit the mouse button. I examined the starter.fps binds and saw that there, the mouse is refferenced as mouse0. I tried modifiying the above code to reflect this, but it made no visible difference. Theres got to be some reason the scripts are 'turning off' feedback from the mouse all together..
#8
10/28/2006 (12:50 pm)
I've tried several things with only modest luck...I copied starter.fps to a new folder, then copied the data folder from my project over to the copy of starter.fps and loaded it up. It fixed the mouse issue in that case, so it appears to me that it has to be something written to or in one of the scripts at some point...the new 1.5 version of Torque seems to have a few quirks. I'm going to try to line-by-line through some of the scripts and find the problem. Maybe a tiny bit of data gets written that introduces an error in the script??
#9
10/28/2006 (12:54 pm)
Thats the only thing I can come up with. I tried pasting the mouse binds into logoitem.cs, which gets exec'ed much later than default.binds.cs (thinking maybe it was a script called after which that was messing it up) but it produced no results. I tried locating some kind of isEnabled type function to call on mouse or mouse0 to determine whether it was an initialization issue, but to no avail.
#10
10/28/2006 (2:05 pm)
I found the problem. It (at least for me) is in the /client/ui/playGui.gui file. It appears that if you edit the menu for the game while it's running, there is a line omitted from this file once you save it.

It appeared as this:

// --- OBJECT WRITE BEGIN ---
new GameTSCtrl(PlayGui) {
canSaveDynamicFields = "0";
Profile = "GuiContentProfile";
HorizSizing = "right";
VertSizing = "bottom";
position = "0 0";
Extent = "640 480";
MinExtent = "8 8";
canSave = "1";
Visible = "1";
hovertime = "1000";
applyFilterToChildren = "1";
cameraZRot = "0";
forceFOV = "0";

Add noCursor = "1"; immediately after forceFOV, save and load the entire program from scratch. It should resolve your problem.
#11
10/28/2006 (6:37 pm)
Nice job!
That's what my problem was as well.

Thanks a lot for posting the resolution here!
#12
11/06/2006 (8:20 pm)
Cool! nice one - I've been sweating over this one all day (or should that be swearing), after having huge probs compiling the source then this prob with the tutorial I was starting to regret having forked out 80 quid for the SDK - now I'm happy again. Cheers
#13
11/10/2006 (11:32 am)
Regretable that editing and saving the playgui results in that value being excluded. This issue has manifested itself in several ways and is the source of much angst on the forums recently. Thanks for finding the solution, my friends.

-Robert
#14
11/10/2006 (10:14 pm)
Yes, thanks afharris! I posted on this issue in another thread on Nov. 1st and have been looking for an answer since then. Knew it was something with the playGui, but didn't know what. Just replaced the playGui with the tutorial.base one and left the problem alone. Now I can get back to working with it. Thanks!

Zach
#15
11/11/2006 (1:48 pm)
No problem guys....glad I could help :) I'm going to start looking into a source code fix...I have to keep popping into the playGui file every time I make adjustments!
#16
11/12/2006 (5:08 am)
As a side note to fix you having to update your PlayGui.gui file everytime you 'edit' it in the Gui editor put your setting after the OBJECT WRITE comment block.

//--- OBJECT WRITE BEGIN ---
new GameTSCtrl(PlayGui) {
..... Gui Object defination
};
//--- OBJECT WRITE END ---

PlayGui.noCursor="1";

This way you NEVER have to go update your GUI file after saving it out in the editor.
#17
01/07/2007 (3:01 pm)
Thank you afharris_83 for finding what this bug was.
Thank you Terence Tan for finding a solution to this bug.
You have saved me hrs looking for the problem and finding a solution.
Thanks again.
#18
02/02/2007 (8:35 pm)
Ah yes! Thank you afharris_83 from myself as well!