Game Development Community

Working with OptionsDlg for keybinding?

by Jon Mitchell · in Torque Game Builder · 04/25/2007 (12:04 pm) · 25 replies

I have started to work a little with the OptionsDlg gui. Video and sound work pretty well as it although there seems to be a bit of an issue in full screen, the resolution really does not change as I would have expected.

Anyhow the question I wanted to ask is if anyone has edited OptionsDlg binding menu?
I am curious where the keybinding menu that is currently there gets its data to display, and when bindings are updated and saved where it is stored?

With my project I had been working on, I re-invented the keybinding system and it is horrible! I erally would like to work with what Garage games has already provided in T2D.
Page«First 1 2 Next»
#21
05/10/2007 (6:11 pm)
Ok, I am starting to understand how the custom binds are loaded. It finally sunk in that the reason the stuff in bind.cs was not reloading was because the function to do that was only called on closing and re-launching TGB.
I though to myself, well onlevel load would not call setupInputs(); that only loads when the game starts! and either that was the wrong guess or I am not setting my mappings up correctly because calling that only leads to:

Improperly specified bind for key: moveDown1
Improperly specified bind for key: moveTurretCCW1
Improperly specified bind for key: moveTurretCW1
Improperly specified bind for key: Fire1
Improperly specified bind for key: moveDown2
Improperly specified bind for key: moveTurretCCW2
Improperly specified bind for key: moveTurretCW2
Improperly specified bind for key: Fire2


Now here is the really weird part, notice it is not complaining about the move up binds or the turning binds.....
And they are all set up the same :-\ Right now I am at a huge loss on what the heck is going on.
#22
05/13/2007 (7:54 am)
Ok, so I figured out where bind lived in TGB terms so I wrote a little function to call it

function loadCustomBind()
{
exec("common/preferences/bind.cs");
}

And I call that function in line 380 of option.gui after the new keymap is dumped, but the behavior is that of the original issue, nothing happens until a new level is loaded. Which keeps me looking for something that is only loaded at the start of a new level that related to loading the bindings.
#23
06/10/2007 (4:38 pm)
I just found out (because I never tested it before) that the TGB adventure kit has the same exact problem if the dump keybind is not used.

The keybinding will work as long as you play the game, you quit and it resets (no big surprise) and that hitting reset defaults results in no bound keys which happens as well if you do dump the keybinding. Maybe Garage games can drop some insight into this, maybe it is a bug?
#24
06/11/2007 (1:21 pm)
So ... if you don't dump the keybindings, it doesn't remember the settings ... if you do dump the keybindings and use the 'reset to defaults' you wind up with unbound keys?

Sounds like a quirky bug ... or ... the 'reset defaults' code is doing something that is conflicting with the dump keybindings code ...

in the 'Reset Defaults' code ... set a boolean var ... and where you call 'dumpkeybindings' ... check the var, and only dump if the var is false ... this will prevent calling dump keybindings after you execute the 'reset to defaults' code ...

although ... not really sure ... the 'reset to defaults' code might not write the bindings to disk ... it could, possibly ... just delete the bind.cs ... and reset the keymap ... but it might reset the keymap improperly ... or something ... sounds kind of 'quirky' ;)
#25
06/12/2007 (8:09 am)
It is indeed a bug. While posting in the Adventure kit Neo Binedell confirmed it is a bug and GG will have it resolved in 1.5.
So here is looking forward to 1.5 I guess :)
Page«First 1 2 Next»