I searched the forums and the articles, didn't find anything good so I'm making a post about this.
I've seen games here that lets the player customize the controls to his/hers liking.
How can that be done? I "think" it's got something to do with the String Parser object, but I dunno what.
Does anyone know?
Mendokuse...
DaVince This fool just HAD to have a custom rating
On the Extension List I only found one for TGF, the Advanced Control Object. But I can't test it now, I don't even know if it'll work with the keyboard.
Set up your options screen(or a subapplication or external program) to save the keys the user chooses to use in an INI file. This is done by asking the user "Press Key for Attack/Jump/Up/Down etc etc" and then once each key is pressed, setting the appropriate value in the INI file to the value of the last key pressed(via the Control X object).
Then, rather than having "Repeat while right arrow pressed" in the actual game, use the Control X object, and use the formula "Repeat while pressing Value(INI, "Right")"(assuming you are using the word 'Right' to store the value). (Use the 'Repeat while key (value) pressed' option.)
A nice way of doing this is to store the key as a string instead of a value, that way the chosen key can be displayed on screen via text, i.e. "Shift" rather than the key being stored as a number. This is done in the same way but just retrieving the last key pressed as a string(yes, the Control X object can do that too) and retrieving the string instead of the value by using the normal 'Repeat while key pressed' option instead of 'Repeat while key (value) pressed'.
There are *so many* extensions to help you do this. You can go to click.spatang.com to find a bunch that would. Some even have the "Change Button" command built into them, so that you dont need to do the whole INI or value writing process(tho INIs of course are neccecary to save).
There's not really much point though. The extensions usually keep you limited to 2 buttons and would require my method in order to save the option anyway rather than having to change the controls each time you play the game. When changing the key you would probably need to use the Control X object to get the lastkeypressed information anyway so using one of these extensions would just make things take longer.
If you don't have MMF (Control X is only for MMF), you can use the TimeX object. I know it sounds strange, but for some reason TimeX has the same functions as ControlX, such as 'repeat while pressing ""(string for a key)'. Together with the ini (plus) object it should work too.