Game Development Community

Usb mouse zaxis does not work

by arda · in Torque Game Engine · 04/02/2005 (2:44 pm) · 6 replies

Hi, I want to implement switching between different camera modes. So first I need to
bind keys to different camera modes, then command server to do so.

The First steps is...

moveMap.bind( mouse0, zaxis, zoomCamera );
moveMap.bind(keyboard, f, zoomInCamera);
moveMap.bind(keyboard, g, zoomOutCamera);

above bindings does not call corresponding functions.
I want to switch to different camera modes and zoom in/out with 3th Person view.
But I couldn't have my moveMap bindings work, in ~/client/scripts/default.bind.cs file.

Thanks,



function zoomCamera(%val)
{
	Echo("Mouse zaxis %val=" SPC %val);
     $advCamera::Zoom = getMouseAdjustAmount(%val)*$cameraZoomSpeed;
}

function zoomInCamera(%val)
{
	Echo("Keyboard R %val=" SPC %val);
     //$advCamera::Zoom = getMouseAdjustAmount(%val)*$cameraZoomSpeed;
}

function zoomOutCamera(%val)
{
	Echo("Mouse F %val=" SPC %val);
     //$advCamera::Zoom = getMouseAdjustAmount(%val)*$cameraZoomSpeed;
}

moveMap.bind( mouse0, xaxis, rotateCameraHorizontal);
moveMap.bind( mouse0, yaxis, rotateCameraVertical );
//
// This command is not working for USB mouses
// Instead use  'r' and 'f' to zoom in and out
//
moveMap.bind( mouse0, zaxis, zoomCamera );
moveMap.bind(keyboard, f, zoomInCamera);
moveMap.bind(keyboard, g, zoomOutCamera);

#1
04/02/2005 (11:54 pm)
The RTS pack does something just like this, and it works fine. Are you sure the mousewheel is actually using the z axis?
#2
04/03/2005 (1:28 am)
Hi Ben,
This topic says zaxis is mouse whell,

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

I guess this is my fault, but could not figure it out why? f and g keys also are not working. Also Checked out if I override f g and zaxis, but they seem to be ok.

client/config.cs file is listing all working bindings, except for zaxis, f, and g keys which I added to switch to different camera modes.

Thanks

BTW (GMT+2)
#3
04/03/2005 (9:15 am)
What happens if you try entering this code into the console directly?
#4
04/03/2005 (11:46 am)
I entered moveMap.bind(mouse0, zaxis, zoomCamera), and now it's calling zoomCamera function.

It also works when I enter this into client/config.cs, but does not work when enter in default.bind.cs.

I'll try to solve the rest. Thanks.
#5
04/03/2005 (3:29 pm)
I find out the problem.

Even I add bindings in default.bind.cs, this moveMap is later cleared by config.cs.

Just added it to config.cs and it works.

Thanks.
#6
04/04/2005 (9:34 am)
You have to have default.bind.cs properly filled out as it is used to generate config.cs in certain situations. Best way to test is to delete config.cs and run the game. It should be regenerated with your new configuration.