Game Development Community

Input Configuration GUI

by WesTT · in Torque Game Builder · 10/05/2008 (6:15 am) · 3 replies

Hi all. I am currently looking for a simple way to allow the player to redefine controls in our game. We have a basic options menu with some custom controls on it, then below that we have an input definition area. I want to keep it fairly simple, so I want the player to click "redefine controls" then go through the redefine controls process. They will be required to enter an input for each function. In this case: up, down, left, right, shoot and reload.

My problem is that there doesn't seem to be an easy way to interface with arbitrary inputs. You have ActionMaps that allow you to define function calls based on predefined inputs, and there's the "anykey" command for keyboard input but this doesn't really help in this instance. There's the GUIInputCtrl that seems to have a nasty habit of locking the GUI Builder up as well. I suppose I could manually put a GuiInputCtrl in the scene and use it to trap "onInputEvent" calls though this does seem a bit hacky.

Also, we currently allow the user to control the game via keyboard, kayboard + mouse and Xbox 360 controller so it would have to be able to interface with all of these. Basically a function that callbacks on arbitrary input and describes that input so I can then plug it into the player ActionMap would be great.

This seems like a pretty simple thing to do so if anyone has that simple way I'd love to know. ;)

#1
10/05/2008 (12:41 pm)
TGB already has some Gui's for this in the common folder. In fact if you hit ctrl + o in your game it might pop-up.

Look at the common/gameScripts: keybindings, options and the common/Guis: remap, options.

RemapGui uses a GuiInputCtrl which does exactly what you want. I'm not sure if it works with gamepads, etc, but it might.
#2
10/08/2008 (7:52 pm)
Hi Wes,

In TGB 1.2 version also, complete gui for this purpose is available. name is "OptionDlg.gui". You can open TGB project and take a look. I think it is solving your purpose.



cheers
#3
10/10/2008 (3:41 am)
@Haider:

Yeah, I had found that however we use standard scene objects for our very basic interface requirements so don't wish to use that in our game. However the good news is that I'm just going to use the GuiInputCtrl to snatch the various inputs and assign them to a slot. Should work ok and not look too out of place.