The Daily Click ::. Forums ::. Klik Coding Help ::. Customizable controls.
 

Post Reply  Post Oekaki 
 

Posted By Message

Lukas Hägg



Registered
  02/01/2004
Points
  642
19th February, 2005 at 13:11:22 -

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

Registered
  04/09/2004
Points
  7998

Game of the Week WinnerClickzine StaffHas Donated, Thank You!Cardboard BoxDos Rules!
19th February, 2005 at 13:23:27 -

Oh, if I knew....

 
Old member (~2004-2007).

Knudde (Shab)

Administrator
Crazy?

Registered
  31/01/2003
Points
  5125

Has Donated, Thank You!Clickzine StaffKlikCast StarVIP MemberGhostbuster!Dos Rules!I donated an open source project
19th February, 2005 at 13:26:09 -

search the extention archive

 
Craps, I'm an old man!

Johan Hargne (Wartagon)

Lover Of Circys

Registered
  15/06/2003
Points
  1289

Game of the Week WinnerCROBASOFTVIP MemberPS3 OwnerWii OwnerMushroom
19th February, 2005 at 13:32:30 -

Press Alt+F4

 
Music Composer.
http://johan.hargne.se

Crobasoft
www.crobasoft.com

Lukas Hägg



Registered
  02/01/2004
Points
  642
19th February, 2005 at 14:22:23 -

I'm guessing you're being sarcastic Phizzy.

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.

 
Mendokuse...

ChrisB

Crazy?

Registered
  16/08/2002
Points
  5457
19th February, 2005 at 15:54:16 -

ControlX works well for me, but the new Virtual Key object should be a lot more compatible.

 
n/a

Hernan



Registered
  04/03/2003
Points
  707

VIP Member
19th February, 2005 at 16:23:49 -

I used customisable controls in my game Deadly Swords 2. It's really easy, by using a combination of ControlX and the ini object.

 
This space is for rent

Crystal Clear (H.E.S)

Possibly Insane

Registered
  06/10/2002
Points
  2548
20th February, 2005 at 02:05:06 -

ControlX will do the job, ive never used Virtual Key object before, downloaded it but havent fiddled around with it.

 
HES homepage:
http://www.distinctiv-efair.com/heretic/studios
Crystal Clear Productions: http://www.distinctiv-efair.com/heretic/crystalclear

RapidFlash

Savior of the Universe

Registered
  14/05/2002
Points
  2712
20th February, 2005 at 15:00:06 -

This article might help: http://www.klik-me.com/KMv2/article.asp?id=3 </shameless_plug>

 
http://www.klik-me.com

Assault Andy

Administrator
I make other people create vaporware

Registered
  29/07/2002
Points
  5686

Game of the Week WinnerVIP Member360 OwnerGOTM JUNE - 2009 - WINNER!GOTM FEB - 2010 - WINNER!	I donated an open source project
21st February, 2005 at 02:07:29 -

It's good to know that you actually used the search button. Well done.

 
Creator of Faerie Solitaire:
http://www.create-games.com/download.asp?id=7792
Also creator of ZDay20 and Dungeon Dash.
http://www.Jigxor.com
http://twitter.com/JigxorAndy

ChrisB

Crazy?

Registered
  16/08/2002
Points
  5457
21st February, 2005 at 12:59:12 -

HE IS NOT BEING SARCASTIC.



(no, really, look at the first sentence of the first post...)

 
n/a

DistantJ [FZ Games]



Registered
  02/08/2004
Points
  855
21st February, 2005 at 18:27:14 -

Here's what I do:

You'll need the Control X object.

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'.

I hope I helped.

Image Edited by the Author.

 
http://www.fzgames.com

RC



Registered
  17/02/2004
Points
  141
22nd February, 2005 at 02:58:53 -

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).

 
http://www.sepwich.com/solemnity/projects/s4comingsoon.JPG
Sonic: Corrupted Chaos. Coming soon..

DistantJ [FZ Games]



Registered
  02/08/2004
Points
  855
22nd February, 2005 at 16:28:01 -

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.

 
http://www.fzgames.com

Hernan



Registered
  04/03/2003
Points
  707

VIP Member
23rd February, 2005 at 09:01:32 -

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.

 
This space is for rent
   

Post Reply



 



Advertisement

Worth A Click