For those of you wondering how to put code into the new version of game maker, right click the space, and select "change to GML" then you will be able to type stuff in
Excellent tutorial. My only criticism is that the font size is pretty small when you're inputting code. If there's a way to increase it a few sizes for better readability that would be awesome! Thanks!
Thanks,man! I always see videos about how to make menus but they all always with the old version of the program but your video with the new version made me make a menu for my game! thanks,man!
Hey, thank you for your very nice comment! Life has been very busy and I have not been able to make videos for a while, but there's always a chance I will come back. :)
Excellent tutorial, thanks. A suggestion: you occasionally drift into "coder logic," like at 14:20, that is a little difficult to follow. I mean, I get it when I see you do it, but I don't normally think like that, so some additional explanation of that style of imagining problems would be beneficial. For example, when you set up the buttons index, it wasn't clear what the reasoning was behind that until later. You said something like "you'll see why I did that later," but it would have been helpful to understand the *approach* you're taking.
Thanks so so much. What a great tutorial! Bit of fiddling required for gamepad controls, but still works really well. Have used this as the basis for my pause menu also. Thanks again!
Thank you so much for this tutorial. I love my menu I just have a quick question. How do I give the players options to use things other than (vk_down) etc? I tried keyboard_check_pressed(vk_down) or keyboard_check_pressed(ord("S")) - keyboard_check_pressed(vk_up) or keyboard_check_pressed(ord("W")) And I also tried it separately like keyboard_check_pressed(vk_down) - keyboard_check_pressed(vk_up) or keyboard_check_pressed(ord("S") - keyboard_check_pressed(ord("W") But neither worked ): Tips?
You were close with your first try. You need to add extra parenthesis around each of the parts checking for up and down. This is the pseudo code: (check_s or check_down) - (check_w or check_up) Now replace check_s, check_down, etc... with the real checks: (keyboard_check_pressed(ord("S")) or keyboard_check_pressed(vk_down)) - (keyboard_check_pressed(ord("W")) or keyboard_check_pressed(vk_up));
If you did all the code right and the text isn't showing up then in the draw event type in "draw_set_color(c_white);" on the very first line because it might default to black text on a black background.
Great tutorial. Still works in 2023. I just made a small modification - I use Input library that takes care of the controller input. The code to check input then looks like this: if(input_check_pressed("down")) { menu_index += 1; } if(input_check_pressed("up")) { menu_index -= 1; }
ive found this problem a lot whenever i try coding ANYTHING it keeps crashing before even starting up saying that stuff hasnt been read before starting even though im copying the code down EXACTLY and triple checking everything i put down. somebody please help me because i really want to use this program but nothing seems to be working right
How do you lock certain menu indexes so that the menu index will skip to the next one? Let's say that I can't select "Load Game" because I have no files available. If I move down to load game then it will skip to options, but if I move up to load game, it goes to new game.
I need a slight bit of assistance, I followed everything as it was inputted, however the outcome on my end resulted in the text showing up, and even being highlighted red on option 1, but the problem is the arrow keys don't work, despite me writing code for them. Great video though!
when I wrote "draw_text(menu_x, menu_y, + button_h * i, buttons[i])" it said "number of arguments for function draw_text expected 3 got 4" what can I do with it
a bit late but for anyone who stumbles across this, remove the comma after menu_y since you're adding this with button_h and multiplying by buttons[i] revised code: draw_text(menu_x, menu_y + button_h * i, buttons[i]) good luck and have a good day ✨
when i set it up like you did code workshop and the game loads in, i press the key or the button that moves you know to the thing yiu want to press like new game, well when i press the up button it only goes to the first option and the last one and if i press down when its on the last option it goes off screen
Just to toss thought a nice add to this, when you get to the step part and do the menu_move part, I suggest this snip of code, it aided me to use wsda or arrow keys. FYI I am using GMS-2. menu_move = max(keyboard_check_pressed(vk_down),keyboard_check_pressed(ord("S")),0) - max(keyboard_check_pressed(vk_up),keyboard_check_pressed(ord("W")),0);
how did it aid you? Not being a troll, rather some of the code i have never saw before so I am not able to understand why it would be helpful in that circumstance. :)
Hello Code Workshop, first of all, thank you for these videos they are such a huge help, I had some question about coding as I'm pretty new to it and attempting to create my first game. Is there any way I could ask you some questions about what to do after the menu stage of the game is complete. Thank You!
So I've followed this exactly and when I go to test it I get an error. "Object: o_menu Event: Draw at line 4 : unknown function or script button puu.sh/ADzk6/23ada538c8.png
Looks good but I'd put the alignment and font assignments before the repeat statement, not in it. No need to set them for every menu item unless you're changing them based on the current selection.
So im trying to make it go to the game when i hit "start" but its not letting me this is my code, the case 2 works but not case 0 switch(menu_index) { case 0: room_goto(0) break;
@@CodeWorkshop no like when I load up the game it doesnt go to the menu, it just goes to the game itself. Actually it does work, but it only works half of the time so, yeah
hi, I followed his tutorial and also I'm not able to make the "0" button work, if for some reason you still remember how it was resolved, please tell me!
If you hover over the triangle, it should say something like "Variable XX only referenced once." This just means that you haven't used that variable in your code yet and this will always happen when you first set up your variables. Once you use the variable later in the code, the yellow triangle goes away.
all worked up until testing color change for selected. it either selected all or none... i triple checked and followed your every step update: my mistake was I had failed to check for ; at end of codes
what about a menu similar to xenoblade chronicles with a backgroud that has its own day/night cycle and the item or monado flashing and pulsating at night
the same as any but rather then using a code to draw the menue use codes for pressing on "obj name" with if mouse_check_button_pressed(mb_left) in the step event
everything seems fine but nothing is appearing at all, Attempting to set gamepadcount to 12 DirectX11: Using hardware device Collision Event time(microsecs)=0 Total memory used = 5464562(0x005361f2) bytes **********************************. Entering main loop. **********************************.
you just have you put in the step event : if (menu_index == button[0]) room_goto(the room you want); (for the new game option) Do that for every single option but just don't forget to change the index of the button array !
what if I want to put a picture behind it? ( Solved it, just make a sprite, import the picture into the sprite, the go on the background layer in rooms and use that sprite as the background. )
I know there are copyright issues, but can you make a Zelda series for GMS 2? The engines are becoming too different to follow your old series. Also will you continue the 4 part beginner series? (Long time fan and keep up the good work)!
Hehehe... looks just like mine... ive put a round rectangle on top of the keys... its simple but not acurate aa1 = string_length(menuGM[menuPos])*4; draw_roundrect_colour(hori-aa1-2, vert-6+menuSpace, hori+aa1, vert+4+menuSpace, c_white, c_white, false); the rectangle width is the string lenght (aa1)
Nice dude, by the end I felt confident in easily adding my gamepad as well.
For those of you wondering how to put code into the new version of game maker, right click the space, and select "change to GML" then you will be able to type stuff in
Excellent tutorial. My only criticism is that the font size is pretty small when you're inputting code. If there's a way to increase it a few sizes for better readability that would be awesome! Thanks!
Good point. I will increase the font size next time.
Fluffy TKC to increase font size open your code and press f8. f7 shrinks it
Absolutely perfect, I was just getting ready to figure out how to do a menu system. Thank you!
Thanks,man! I always see videos about how to make menus but they all always with the old version of the program but your video with the new version made me make a menu for my game! thanks,man!
I like the sound of your voice and how you make your videos. PLEASE DON'T STOP MAKING VIDEOS! Thanks.
just realized it's been a year since you last made a video :(
Hey, thank you for your very nice comment! Life has been very busy and I have not been able to make videos for a while, but there's always a chance I will come back. :)
@@CodeWorkshop Awesome! I'll be looking forward to it!!
I followed literally character for character but it doesn't work, down in the Bottom under output it just says "FAILED: run program complete"
For everyone who doesn't get it:
At 10:00 he clearly says Va_center and you can't read it bc the quality is too bad.
He actually means fa_center
Excellent tutorial, thanks. A suggestion: you occasionally drift into "coder logic," like at 14:20, that is a little difficult to follow. I mean, I get it when I see you do it, but I don't normally think like that, so some additional explanation of that style of imagining problems would be beneficial. For example, when you set up the buttons index, it wasn't clear what the reasoning was behind that until later. You said something like "you'll see why I did that later," but it would have been helpful to understand the *approach* you're taking.
Almost fooled me but not quite...
@@JustCubeIt I don't get it.
@@rivaantyc6826 It's because 14:20 is the end of the video!
Great tutorial, thanks, i would like how i can select with click mouse ? please
Thanks so so much. What a great tutorial! Bit of fiddling required for gamepad controls, but still works really well. Have used this as the basis for my pause menu also. Thanks again!
Hi. I have small problem. I did everything liske you, but when I start the game, it shows me only black screen. Please help
Hello I have a question, when I've gotten up to 8:39 on this Video and when I run My Game nothing comes up it's just all black!!!?
Hmmm - the only thing I can think of is to make sure you placed the o_menu object in the room
Thank you so much for this tutorial.
I love my menu I just have a quick question.
How do I give the players options to use things other than (vk_down) etc?
I tried keyboard_check_pressed(vk_down) or keyboard_check_pressed(ord("S")) - keyboard_check_pressed(vk_up) or keyboard_check_pressed(ord("W"))
And I also tried it separately like
keyboard_check_pressed(vk_down) - keyboard_check_pressed(vk_up)
or keyboard_check_pressed(ord("S") - keyboard_check_pressed(ord("W")
But neither worked ): Tips?
You were close with your first try. You need to add extra parenthesis around each of the parts checking for up and down. This is the pseudo code:
(check_s or check_down) - (check_w or check_up)
Now replace check_s, check_down, etc... with the real checks:
(keyboard_check_pressed(ord("S")) or keyboard_check_pressed(vk_down)) - (keyboard_check_pressed(ord("W")) or keyboard_check_pressed(vk_up));
@@CodeWorkshop This worked! Thank you so much!! :))
I'm getting a "trying to index a variable which is not an array" error on the buttons array in the Draw tab. Anyone else?
If you did all the code right and the text isn't showing up then in the draw event type in "draw_set_color(c_white);" on the very first line because it might default to black text on a black background.
Can you show how to do a warning screen before the game? I am missing several variables to make it.
Glad you're back! Can you please continue the tutorial. Cuz you're the only who made a tutorial from zero. Thank you so much. Regards.
Thanks. Which series? Zelda or the Game Maker Studio 2 series?
Plz answer I’ve been stuck for days how on Mac keyboards do you get this*
Great tutorial. Still works in 2023. I just made a small modification - I use Input library that takes care of the controller input. The code to check input then looks like this:
if(input_check_pressed("down")) {
menu_index += 1;
}
if(input_check_pressed("up")) {
menu_index -= 1;
}
ive found this problem a lot whenever i try coding ANYTHING it keeps crashing before even starting up saying that stuff hasnt been read before starting even though im copying the code down EXACTLY and triple checking everything i put down. somebody please help me because i really want to use this program but nothing seems to be working right
How do you lock certain menu indexes so that the menu index will skip to the next one? Let's say that I can't select "Load Game" because I have no files available. If I move down to load game then it will skip to options, but if I move up to load game, it goes to new game.
I, I want to put the different texts in different places, can you help me???? Please
can somebody help me - all the menu options are overlapping with each other...
I can’t find it can you tell me the code that started with draw_text (menu_x, menu_y
8:18 - I can't understand.... What symbol is that?
When I try to place curly brackets, it says "nested function calls are not allowed". Please Help.
how do you make the same menu but with sprites instead of plain text?
I need a slight bit of assistance,
I followed everything as it was inputted, however the outcome on my end resulted in the text showing up, and even being highlighted red on option 1, but the problem is the arrow keys don't work, despite me writing code for them. Great video though!
whats write in 8:20 ?
pls help
a star *
[...] button_h * i
Is there a way to do these but horizontally?
Hi, so when i add another text to the room it changes his color too ' in this tutoriel it's red)
How do you add actions for new game and load game?
For me its saying nested functions are not allowed.
Pardon me, but, how would i be able to use a different key than the arrows to select options in the menu? I was hoping to use the 'w' and 's' keys.
Why when you go down to the last entry that the other draw text objects ion the room also turn red? HOW DO I FIX THIS?
how do you do the 1 after var at 7:56 ?? or what is this for a symbol
you can change it for any letter ;)
when I wrote "draw_text(menu_x, menu_y, + button_h * i, buttons[i])" it said "number of arguments for function draw_text expected 3 got 4" what can I do with it
a bit late but for anyone who stumbles across this, remove the comma after menu_y since you're adding this with button_h and multiplying by buttons[i]
revised code: draw_text(menu_x, menu_y + button_h * i, buttons[i])
good luck and have a good day ✨
@@airconditioningac thx a lot
thank you so much!!! I tried another tutorial but it was too old, this one still works :D
when i set it up like you did code workshop and the game loads in, i press the key or the button that moves you know to the thing yiu want to press like new game, well when i press the up button it only goes to the first option and the last one and if i press down when its on the last option it goes off screen
hi im a complete noob at gamemaker, what shortcut did you use at the beginning to create the variables?
mine are gonna be in boxes, can you fix that?
How could one do this but using W and S keys instead
Just to toss thought a nice add to this, when you get to the step part and do the menu_move part, I suggest this snip of code, it aided me to use wsda or arrow keys.
FYI I am using GMS-2.
menu_move = max(keyboard_check_pressed(vk_down),keyboard_check_pressed(ord("S")),0) - max(keyboard_check_pressed(vk_up),keyboard_check_pressed(ord("W")),0);
Sorry to bother you asking this, but why exist a zero in the end of the max parameters? :o
how did it aid you? Not being a troll, rather some of the code i have never saw before so I am not able to understand why it would be helpful in that circumstance. :)
How i make to game start
Put "room_gotto(name of room)" in case 0
@@whoverland i did it it worked, changed a few things and now it freezes evry time PLS HEELP.
@@borzageorgemarian4924 you probably forgot to change the name of the room (or the room name in the code)
Hello Code Workshop, first of all, thank you for these videos they are such a huge help, I had some question about coding as I'm pretty new to it and attempting to create my first game. Is there any way I could ask you some questions about what to do after the menu stage of the game is complete.
Thank You!
When I click play I get unassigned variable buttons
can you please make a video with making buttons with your own sprites??
My computer was strait up not having a good time it had a fatal error
So I've followed this exactly and when I go to test it I get an error. "Object: o_menu Event: Draw at line 4 : unknown function or script button
puu.sh/ADzk6/23ada538c8.png
same here!
Looks good but I'd put the alignment and font assignments before the repeat statement, not in it. No need to set them for every menu item unless you're changing them based on the current selection.
So im trying to make it go to the game when i hit "start" but its not letting me this is my code, the case 2 works but not case 0
switch(menu_index)
{
case 0:
room_goto(0)
break;
case 2:
game_end()
break;
}
okay i figured it out, but now it goes straight to the game
Glad you figured it out. "but now it goes straight to the game"...is that not what you want?
@@CodeWorkshop no like when I load up the game it doesnt go to the menu, it just goes to the game itself. Actually it does work, but it only works half of the time so, yeah
hi, I followed his tutorial and also I'm not able to make the "0" button work, if for some reason you still remember how it was resolved, please tell me!
?What if i wanted to make the buttons next to each other
im getting errors in my keypressed enter section despite the fact what you have and what I have is exactly the same
What would be the code for new game, save game, and load game?
I have 1 complaint and that is why do you only show how to make the end game button work
There's more videos
Can you send me a link to the sound download
how do you do sliders, or a box where you can click and change a number?
I've added this to the list of potential future tutorials.
when i insert the first comands of menu, a yellow triangle appears. Why?
If you hover over the triangle, it should say something like "Variable XX only referenced once." This just means that you haven't used that variable in your code yet and this will always happen when you first set up your variables. Once you use the variable later in the code, the yellow triangle goes away.
all worked up until testing color change for selected. it either selected all or none... i triple checked and followed your every step
update: my mistake was I had failed to check for ; at end of codes
Glad you were able to figure it out! :)
@@CodeWorkshop cheers. Iv made small games b4 but none have a menu so when I seeked help your videos came 1st. Absolutely love your style of tutorial
what about a menu similar to xenoblade chronicles with a backgroud that has its own day/night cycle and the item or monado flashing and pulsating at night
i cant type in the create event....
How exactly do you make this work with pre-made sprites though?
the same as any but rather then using a code to draw the menue use codes for pressing on "obj name" with if mouse_check_button_pressed(mb_left) in the step event
do a moving animation when you select an option it moves
how do add this in a current game
My suggestion is to make a room before the current room that has all the game stuff. Add this in and have New game go to the next room.
I will cover this in a future tutorial.
Code Workshop I did it I finally got it thank you so much
I did everything you said to do and double checked that I did it right multiple times but in the end it just made it so my project wouldn't work
everything seems fine but nothing is appearing at all,
Attempting to set gamepadcount to 12
DirectX11: Using hardware device
Collision Event time(microsecs)=0
Total memory used = 5464562(0x005361f2) bytes
**********************************.
Entering main loop.
**********************************.
May I use this for a game I'm making?
Yes.
How do you change rooms after clicking start
you just have you put in the step event :
if (menu_index == button[0]) room_goto(the room you want); (for the new game option)
Do that for every single option but just don't forget to change the index of the button array !
I just put it in the "key press - enter" event. So instead of
case 0:
show_debug_message("New Menu");
break;
I have
case 0:
room_goto(room);
break;
RampantOracle Not bad actually ! It works too
RampantOracle where do you live I want to hug you
how can I make the times symbol
hold shift and press 8 or enable number pad and its the star on the left of the - button
i have a problem with draw
This was exactly what i needed, many thanks :)
Nice! This is just what i need, thanks!
what if I want to put a picture behind it? ( Solved it, just make a sprite, import the picture into the sprite, the go on the background layer in rooms and use that sprite as the background. )
Error on Line 8
your sound file name have to be exactly the same as in the source code
it didnt work for me
I know there are copyright issues, but can you make a Zelda series for GMS 2? The engines are becoming too different to follow your old series. Also will you continue the 4 part beginner series? (Long time fan and keep up the good work)!
Thanks for being a fan! :) I will start up the beginner series and I'm still looking into what to do with the Zelda series long-term.
I cant make the exit works
This video is in 480p for me. I can't read what your typing.
you can turn the quality of the video up if you can't see
THANK YOU!!!!!!!! Got a new sub☺️
Thanks for posting the video! life saver!
did'nt work for me it just kept switching nuttons in a infinate loop
I've added a link to the code in the description. See if comparing the code to yours helps.
zoom the code please...
Create event:
menu_y =y;
menu_x =x;
menu_h =32;
button[0] = "Novo Jogo";
button[1] = "Carregar Jogo";
button[2] = "Opções";
button[3] = "Sair";
buttons = array_length_1d(button);
menu_index =0;
last_selected=0;
error :/
Thanks for the video!
thank you very much
Very Cool!!!! :)
IT DIDNT WORK
My game crashed
well... it's a good tutorial thou..
but. i can't see the code as well :)
dang it man, dunno what to say
Thanks and sorry about the font size. I increase the size in the next video and you can also download the code from the description.
dude its 2018 now so the coding is gone, now its just this assign variable, what do i do next?
6:46
Hehehe... looks just like mine... ive put a round rectangle on top of the keys... its simple but not acurate
aa1 = string_length(menuGM[menuPos])*4;
draw_roundrect_colour(hori-aa1-2, vert-6+menuSpace, hori+aa1, vert+4+menuSpace, c_white, c_white, false);
the rectangle width is the string lenght (aa1)
is !=?
"!=" is a comparison that means "not equal".
I had a fatal error so I downloaded it.
ultra hd 4k :/
noicee
please help