Overview
001 lets you bind keys to certain controls just by pressing the desired button. However that is only possible in the engine editor and the Start Up menu of a built game.In this guide you will find an Interface along with an Input Set that you can download and import into your game.
Preparations
To implement this feature into your game you’ll need to download and import an Interface and an Input Set.
Interface & Input Set Link[drive.google.com]
The Input Set is pretty easy to import. Just click on Resources>Import Resources, find the file and click Go to import it.
The Interface is going to be a little different since there’s no way to directly Import/Export Interfaces through the engine. To do it you’ll just need to locate your game’s folder or just click Tools>Open Project Folder… and paste the Interface file over there.
The “Keyboard” Input Set
This is where all the bindable keys are. By default I have set up the most common keyboard keys which include all FN keys, Esc, all symbols, the english alphabet, numbers from 0 to 9(include those on the numpad), Tab Caps Lock both Shifts Controls and Alts, Space, fn, App, the arrow keys, prt sc(or Sys rq), Scroll Lock, Pause, Ins, Home, Page Up/Down, Del, End. The Windows key wouldn’t work but what kinda game would use that button?
Now say your keyboard has more keys than most or you want to set up buttons for a controller or a mouse. How’d you do it?
Simple really. Take a look at the image below.
When at step 3, press the key(or button) you want to insert. It should appear with a certain name. Now all you need for the script is a single event. Interface Variable Operation. Select the Interface Controls, then the variable Control and lastly set it whatever the key’s name was previously on step 3. The two MUST be identical. For example if you press the Page Up key it will appear as PgUp. Then you set the variable to PgUp.
NOTE: Certain buttons for controllers like Triggers, D-Pads and Analogue Sticks will require you to input them manually through the Gamepad X dropdown menu.
The Controls Interface
Here’s the interface the player will be able to access through the game to change the controls.
In the interface I’ve created there are only 7 controls just to get you started and give you an example on how to set up new controls.
So let’s say you wanna add an Attack control. Rather than creating it from scratch, just copy paste another control and edit it instead.
First you’ll need to rename the field of the control’s name. Note that it must be IDENTICAL to the name of the actual control that’s in the editor’s Controls section.
Now for the script in the Retrieve Text: Use Value box.
What you see here is a Multi-Comparison Branch that checks to see if the assigned key that this Field is responsible for, is equal to the key of another control. If it is, it will normally display it’s name but will also attach a (!) at the end so that the player will know that there are conflicting controls.
If you need to add extra controls than those 7, you will need to also edit the script for all previous controls too!
For example, you wanna add an Attack control. I’ll pick Jump to demonstrate to you how to set up the other fields too. On the branch event, add the same value as one of the previous ones but make sure to change the name between (” “) to the new control. If there are more than 10 controls, simply add another Multi-Comparison Branch event on the rightmost branch of the previous one.
Next you gotta edit the Return Value events to match your new control. The only edit they need is to change the control’s name between (” “) to the new one.
That’s it. Apply this for all previous controls and your new control is all set up!
Well, almost. As you might’ve already noticed there’s also a Reset to Default Field which, when activated sets the controls’ keys to anything you set it to. Open the Field’s Activated Trigger and copy paste 2 Remove/Add Control events, 1 for each. Again, like previously, just replace the control’s name between (” “) with your new control(for the Remove Control event) and for the Add Control event just set the Key to whatever you want to be considered “Default”.