Master Game Community

Master Game Productions (MGP) presents Master Game Community (MGC). A forum for all your Game Maker needs.


    How To Create User Defined Controls

    Share
    avatar
    Nocturne
    Nocturne Games

    Posts : 17
    Reputation : 2
    Join date : 2010-09-16
    Age : 44
    Location : Spain

    How To Create User Defined Controls

    Post by Nocturne on Mon Oct 04, 2010 1:34 am

    User Defined Controls And Ini Saving
    An example file with scripts that show how to define keys and save them

    Compatibility: GM7 and GM8
    Tutorial Type: Example
    Downloadable Content: GM7(pro) and GM8(pro)
    Skill Level: Beginner/Intermediate
    Objective: Learn to use global variables and ini files
    Category: General

    This example is an introduction to customizable controls and basic use of ini files and is recommended for intermediate users. It is for anyone who wishes their game to have a user defined keys menu and should work in GM6, GM7(light), and GM8(light) but I have not tested it so it may be that GM7(pro) or GM8(pro) is necessary.

    There are two objects (one for mouse and another for keyboard, they are both basically the same, only the way of selecting the keys to map changes) which use arrays to define the keys and then save the values to an ini file. The ini file must always be located in the same directory as the game file.

    Before starting to modify this please run the example and to create an ini file, then open the ini file in a text editor to see how it is structured and read through all the codes and comments to make sure you understand everything.

    This can be merged into any game (delete everything except the object that you want to use and the scripts) but will need modifying to adapt to your needs. Pay particular attention to the arrays and drawing options...

    Thank you for downloading this and as always, no credit is necessary but would be apreciated! Oh, and please comment if you download this...

    Mark13673




      Current date/time is Wed Nov 22, 2017 9:46 am