C
ChrisMG12
Guest
I'm using the settings tutorial from this vid,
I followed the entire tutorial step by step and did everything correctly and was pretty pleased with my work. However I wanted to add an extra notch to the project, so i decided to add Gamepad support to the game.
But here's the deal though there is a simple way to do this in keyboard, which is keyboard_lastkey (13:34 in the video, you can see the code she used). I soon realized that there is no gamepad alternative, and since I'm a programming noob (GML-wise anyway) I decided to go to the forums and stumbled onto this forum
(https://forum.yoyogames.com/index.p...eck-if-any-input-in-pressed-on-gamepad.10232/)
I thought that this was it and tried to do everything in the forum, including the other forum it links to, and make the IsPressed variable global instead of local. Then I added this in step even :
//Input
case menu_element_type.input:
var kk = keyboard_lastkey;
if(kk != vk_enter){
ds_grid[# 3, menu_option[page]] = kk;
variable_global_set(ds_grid[# 2, menu_option[page]], kk)
}
break;
var gg = global.IsPressed;
if(gg !=gp_start || gp_select || gp_axislh || gp_axislv || gp_axisrh || gp_axisrv || gp_stickl || gp_stickr){
ds_grid[# 3, menu_option[page]] = gg;
variable_global_set(ds_grid[# 2, menu_option[page]], gg)
}
However this doesn't work i also tried to change the values of string_val in draw gui to make it appear but still it doesn't work . Can anyone tell me what I'm doing wrong or tell me what to actually do if this entire thing was a mistake.
But here's the deal though there is a simple way to do this in keyboard, which is keyboard_lastkey (13:34 in the video, you can see the code she used). I soon realized that there is no gamepad alternative, and since I'm a programming noob (GML-wise anyway) I decided to go to the forums and stumbled onto this forum
(https://forum.yoyogames.com/index.p...eck-if-any-input-in-pressed-on-gamepad.10232/)
I thought that this was it and tried to do everything in the forum, including the other forum it links to, and make the IsPressed variable global instead of local. Then I added this in step even :
//Input
case menu_element_type.input:
var kk = keyboard_lastkey;
if(kk != vk_enter){
ds_grid[# 3, menu_option[page]] = kk;
variable_global_set(ds_grid[# 2, menu_option[page]], kk)
}
break;
var gg = global.IsPressed;
if(gg !=gp_start || gp_select || gp_axislh || gp_axislv || gp_axisrh || gp_axisrv || gp_stickl || gp_stickr){
ds_grid[# 3, menu_option[page]] = gg;
variable_global_set(ds_grid[# 2, menu_option[page]], gg)
}
However this doesn't work i also tried to change the values of string_val in draw gui to make it appear but still it doesn't work . Can anyone tell me what I'm doing wrong or tell me what to actually do if this entire thing was a mistake.