Game Development Community

RC3: Crash bug - TGB crashes when using a mousebind

by Dennis Harrington · in Torque Game Builder · 06/17/2006 (3:00 pm) · 4 replies

When binding the mouse with this syntax:

moveMap.bindCmd(mouse0, "zaxis", "zoomCamera();", "");

TGB crashes upon use of the mousewheel. (BTW, even if I include a second function in this command it still crashes.) But when using this syntax:

moveMap.bind(mouse0, "zaxis", zoomCamera);

Everything functions as it should. This crash also occurs with RC2.

#1
06/17/2006 (3:37 pm)
This is not a bug, it's just incorrect usage. The mousewheel is not a button, it's an axis. So you don't have a press/release, which is what bindCmd is for. Use bind for axes, bindCmd for buttons.
#2
06/17/2006 (3:42 pm)
Regardless of whether it's correct usage, TGB should not be crashing because of incorrect syntax/usage. I've had other experiences where even if a key has been bound incorrectly it didn't crash the entire app. It just threw up on error in the console. That's what this should be doing as well.
#3
07/18/2006 (9:50 am)
Dennis,

This has been resolved and will be in the 1.1.1 release, thanks for the report!

Cheers,
-Justin
#4
07/18/2006 (10:45 am)
Thanks for fixing this. Even though I now know better, I'm sure new users will be much happier to get an error instead of the app crashing. ;)