Powered by Invision Power Board

 
    Reply to this topicStart new topicStart Poll

> Custom Keyboard Set-Up GM6
Unspecified
Mariotroid
Posted: Sep 5 2007, 11:11 PM
Quote Post


What is love?
[*][*][*]

Group Icon
Group: Members
Posts: 4756
Member No.: 2334
Joined: 14-July 06

Status: (0d) [--]


People say this is easy. I, however, am clueless. :P

How do you allow users set their own keyboard set-up when they play your game?

If anyone is confused by what I mean by this, here's an easier explination:
How do you allow users set their own keys for the jump button, the shoot button and movement buttons in GM6?

Thanks in advance.

This post has been edited by Mariotroid on Sep 5 2007, 11:13 PM


--------------------
PMEmail PosterUsers WebsiteAOLMSN
Top
United States
Grant
Posted: Sep 6 2007, 12:21 AM
Quote Post


John Freeman said
[*][*][*][*][*]
[*][*][*]

Group Icon
Group: Members
Posts: 8260
Member No.: 2900
Joined: 31-October 06

Status: (0d) [--]


I expect keyboard-mapping functions - keyboard_set_map(), keyboard_get_map(), keyboard_unset_map() - are the things to use here. Unfortunately, I've never tried using those functions yet myself, so I'm unsure of precisely how they work. From what I can see, though, it looks fairly self-explanatory; just look them up in the GM Help file.


--------------------
user posted image

QUOTE (oh youtube trolls)
u guys r retarded hippocrates

QUOTE (Piemanthe3rd)
Pie is not random. I wish people would realize this.
PMEmail PosterUsers WebsiteAOLMSN
Top
United States
Sploder
Posted: Sep 6 2007, 11:56 AM
Quote Post


Standard Member
[*][*][*][*]

Group Icon
Group: Members
Posts: 781
Member No.: 2317
Joined: 12-July 06

Status: (0d) [--]


Well, you could use global variables for the key settings.
Something like:
CODE
global.key[0]=vk_control;


And then you'd have to code the control events manually like this in the step event:
CODE
if (keyboard_check(global.key[0])){
//code stuff here
}


Then, if you want to be able to save key settings, you're going to have to use an external file.

Really, if you want an example, I have one. I might be able to get it up if want it...
PMEmail Poster
Top
United States
Littlink
Posted: Sep 6 2007, 01:31 PM
Quote Post


hip 2b square
[*][*][*][*][*]
[*][*]

Group Icon
Group: Members
Posts: 5146
Member No.: 2010
Joined: 11-April 06

Status: (0d) [--]


Another note to make is every key on the keyboard has a unique number that identifies it from the others. I would harvest that number and save it to a variable somehow.


--------------------
[████████░░] 80%

user posted image
PMUsers WebsiteMSN
Top
Unspecified
Mariotroid
Posted: Sep 6 2007, 02:38 PM
Quote Post


What is love?
[*][*][*]

Group Icon
Group: Members
Posts: 4756
Member No.: 2334
Joined: 14-July 06

Status: (0d) [--]


QUOTE (Sploder @ Sep 6 2007, 11:56 AM)
Well, you could use global variables for the key settings.
Something like:
CODE
global.key[0]=vk_control;


And then you'd have to code the control events manually like this in the step event:
CODE
if (keyboard_check(global.key[0])){
//code stuff here
}


Then, if you want to be able to save key settings, you're going to have to use an external file.

Really, if you want an example, I have one. I might be able to get it up if want it...

I'd like to take a look at that example before i try this myself. Thanks for the suggestions people.


--------------------
PMEmail PosterUsers WebsiteAOLMSN
Top
United States
Sploder
Posted: Sep 6 2007, 03:05 PM
Quote Post


Standard Member
[*][*][*][*]

Group Icon
Group: Members
Posts: 781
Member No.: 2317
Joined: 12-July 06

Status: (0d) [--]


Well, this is it. This shows the basics.

BTW, I didn't make this, but I don't know who did. Please DON'T credit me.

I also have another example that sets keys the normal way (click button, wait until key is pressed, set key), but it has a bunch of other stuff that I haven't taken out yet...

Attached File ( Number of downloads: 2 )
Attached File  ConfigurableControlsExample.gm6
PMEmail Poster
Top
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

  Topic Options Topic Options Reply to this topicStart new topicStart Poll

 




[ Script Execution time: 0.0553 ]   [ 14 queries used ]   [ GZIP Enabled ]   [ Server Load: 1.56 ]