Check out my Patreon! www.patreon.com/peytonburnham Go there if you want to help me out a little more so I can make more videos like this (full turn-based RPGs, platformers, zelda-likes, beat 'em ups, etc)! There's a bunch of cool perks like getting videos before KZbin does, voting on future series, and getting the project files and assets from future videos! Thanks!
@masahiruQwQ2 жыл бұрын
i have a question
@masahiruQwQ2 жыл бұрын
can u explain how to make a sub menu if its option[0, 0] thx
@mercygoddd11 ай бұрын
i cant seem to see the text in my menu
@superstarichiban5 ай бұрын
Is there a way to have this menu system work with a mouse-based input?
@hayabusoft35043 ай бұрын
Hey Peyton could you flesh out this tutorial by showing how you would code changes to settings and store them? I think that would make for a great tutorial and would help a lot.
@SGTIvan921 Жыл бұрын
Timestamps for reference: 3:50 Declaration of variables in obj_side_menu 4:23 Array of options 5:21 Draw the menu 7:20 Brief demo 7:40 Draw the options, set up font (skip to10:07 if I already have a font) 9:27 Clean up event: font_delete the custom font. 10:07 Draw font 11:00 Use of for loop: draw the options if i < length of the option array 11:46 Add padding to the text 12:33 op_space * i will ensure that the options are not drawn on top of each other, they are drawn like a normal menu 13:04 Demo 13:20 pos variable in Create event - we're gonna start being able to select the options 14:25 up and down key 14:42 We want to prevent the pos from going above 2 or below 0. 15:44 Changing text colour to show which one selected 16:25 if pos == i, _c = c_yellow 17:12 Step event: add a switch statement (for the purpose of entering the option) 19:31 Demo 19:45 Submenu making 20:01 Make the option array 2-dimensional, add a variable menu_level (note to self: I could use regions as a way to open and close to see what are the options under the, say, settings menu. Here, he does it by separating the menus.) 21:09 Create event: set op_length to 0, since we will set the option lengths dynamically in the step event. 22:04 Change that bit of code to draw from a 2d array instead of the previous 1d array (option[menu_level, i]) 22:20 Changing up the organisation of the switch statement, and there will be another switch which checks for menu_level. 24:20 Set menu_level back to 0 if pressing back in settings menu, and set menu_level to 1 if pressing settings menu 25:00 Fixing the bug (the for loop) [Done by setting a local var _sml, whereby, in the switch statement of the menu_level, if it does not equal to menu_level, then set the pos = 0. This is to prevent the unexpected bug of the for loop looking for an option 3 in the main menu when there isn't one.] 26:45 Demo 27:24 Dynamically get width and height of menu 27:59 An important note related to string_height 29:34 The local variable _new_w: setting new menu width based on which option the longest 30:31 Centralise the menu
@downthispath65383 жыл бұрын
Oh wow you explained everything so easily and clearly that even as a non dev like me can understand. I'm trying to understand this cause I plan to give my sister a gift for her bday next year using your dialogue tutorial. I made her a simple platformer this year following random tutorials here on youtube and she absolutely loved it. So I'll try my hand at something more ambitious next year. Thanks a lot for these! I really appreciate it.
@Dextrolord Жыл бұрын
How did it go? Did you manage to make something cool?
@absin8078 Жыл бұрын
Coolest brother(?) ever
@StanzyPants8 ай бұрын
one of the things I love about your videos is that the comments garner such a wide range of experience from folks, every comment I see is either thanking you for the tutorials, talking about the things they made from the tutorials, or someone asking for help with something that wasn't exactly made apparent in the video and getting helpful replies from multiple people. I love it here :)
@electrosaber04293 жыл бұрын
This is one of the best tutorials I have seen, please continue this. Doing a great job.
@peytonburnham43163 жыл бұрын
Thank you so much!
@mercygoddd Жыл бұрын
@peytonburnham4316 how did you crate a folder
@EyeCanDraw9 ай бұрын
@@mercygodddyou click the plus button at the top of the asset menu and make a group :)
@RandomGameBenchmark Жыл бұрын
to play a sound when you change the menu lines create a line called last_selected = 0; in create event and go to step event now in step event, put this code there if (pos != last_selected) audio_play_sound(YOUR SOUND NAME, 1, false); last_selected = pos; thats all
@toddqdev Жыл бұрын
where to write the code?
@RandomGameBenchmark Жыл бұрын
@@toddqdev Read carefully!! last_selected = 0 goes into CREATE EVENT the second code if (pos != last_selected) audio_play_sound(YOUR SOUND NAME, 1, false); last_selected = pos; GOES INTO STEP EVENT
@toddqdev Жыл бұрын
@@RandomGameBenchmark Alright sorry and thanks!
@skymed3095 Жыл бұрын
I appreciate your help man, I'm pretty new so I can't figure out how to make small things like this, but this definitely helps But what about a playing a sound when you press "accept"? How would you do that?
@RandomGameBenchmark Жыл бұрын
@@skymed3095 you can do something like if keyboard_check_pressed(vk_enter) && !audio_is_playing(ACCEPTSOUND) { audio_play_sound(ACCEPTSOUND, 1, false) } This i think, i hope it works good luck
@myers4924 Жыл бұрын
Around 27:57 If you're using a Font that isn't set as by sprite. You could use the below code, with "fnt_menu..." being the custom font. Take this with a grain of salt, it worked for me, but I do not know much about coding. height = op_border * 2 + font_get_size(fnt_menu_dungeonfont) + (op_length - 1) * op_space;
@Shot666 Жыл бұрын
ffs tysm
@ripihy Жыл бұрын
fnt menu doesnt exist apparently??
@myers4924 Жыл бұрын
@@ripihy fnt menu is part of the font name. My font was named "fnt_menu_dungeonfont", yours could be something else like "Comic_Sans"
@RealCrackey Жыл бұрын
@@myers4924 I know this was a month ago but i need an answer desperately, how do you add a normal font into it without it being a sprite font???? i need to know! thank you :)
@Pika782 Жыл бұрын
tysm!
@martinsnape81043 жыл бұрын
Having almost bit the edge of my desk in frustration at not getting a menu system working properly, I found this. Such a clear and easy tutorial.
@ksenyajustkidding14843 жыл бұрын
i’ve bingewatched all your programming videos and made something… this guide is sooo coool! man i never thought it could be so interesting!!! pleeasaeee continue these tutorials it’s super cool!!!! also im quite surprised that your channel is so small so keep it up !!!!!!
@BritBox7773 жыл бұрын
Anyone having pixel issue with their 9 slice by the end- I recommend putting the code for centering the x and y in a " x = round( [code] ) " to round it. That solved the issue for me.
@Mackievellian2 жыл бұрын
Legend.
@nicholaswilshusen338710 ай бұрын
this has been driving me crazy for the past hour, thank you
@Onlyfaff3 жыл бұрын
if you want to use the WASD keys for the menu, put an OR state in the middle for example: up_key = keyboard_check_pressed(vk_up) || keyboard_check_pressed(ord("W"));
@mem3b0i_2 жыл бұрын
It might be good to know that you can also literally type "or" (no quotes btw) and it would do the same thing. But it's better (imo) to get used to typing these | | :)
@supbroski3202Ай бұрын
sorry ik this is super old and you probably won’t see this 😭 but i’m trying to do this, and it only somewhat works. it just faces in the direction when i use wasd, and i have to keep pressing the button (as opposed to holding it down) for my player to move. the code im using is: up_key = keyboard_check_pressed(vk_up)||keyboard_check_pressed(ord(“W”)); in the step event for the title menu object. i’m also doing that with the other directions, i just didn’t want to type them all out. can you (or anyone else) help me please? forgot to mention!! the code you suggested works great for the menu, just as you intended. i wanted to use the same kind of code to make my player move using wasd. so the code is probably different, i just don’t understand why or how
@cleverdragon27442 жыл бұрын
I honestly find these more straightforward and clear than the official gamemaker tutorials. Thanks!
@CGJournalist2 жыл бұрын
If anyone else is trying to use this on a 1920 x 1080 room, the easiest thing to do is to scale his values by 10. For example, where he put "width = 64" in the create page, I put "width = 640". Change this, the height (860), op_border(80), op_space(160) and also the last number of obj_settings --> Create --> line "global.font_main"... from 1 to 5. Then the rest of the math will all make sense. I also changed my font sprite to 70x90 and my textbox sprite to 200x200. Double check all these listed values for a 1920x1080 room and it will all work as demonstrated in the video!
@JackHuntYou2 жыл бұрын
Thank you for your help!
@CGJournalist2 жыл бұрын
@@JackHuntYou you’re welcome, it’s this god on the video that we really owe our thanks to xD
@mr.ranno5432 Жыл бұрын
What about the center menu?
@Cyranek2 жыл бұрын
well spoken perfectly paced informative tutorial
@Rykeroli2 жыл бұрын
cyranek rpg confirmed?
@disusdev3 жыл бұрын
Quick tip: Way to go through menu options without branches: just after `pos += down_key - up_key;` you can add `pos = (pos + op_length) % op_length;` instead of "if" statements
@simonl.34613 жыл бұрын
Nice tip! for some reason my code didn't work with the if statements, but with your code it did.
@lauraostler45403 ай бұрын
Halfway through the tutorial and I could NOT get this to work. Thank you
@Mvolkovin3 жыл бұрын
Holy crap man. Excited for Starcross to come out, it looks like an absolute blast. Thank you for doing these tutorials for us in the meantime. You've earned a loyal fan.
@LithtinaVtuber693 жыл бұрын
Thank you so much for posting this, can't wait for the textboxes, small nitpick though, could you zoom in on your code, sometimes I can't read it but other than that great job
@peytonburnham43163 жыл бұрын
Oh great idea! I’ll see if I can increase the font size in gamemaker or something before i record the next video!
@connerjacobs Жыл бұрын
@@peytonburnham4316 how do I create a new folder
@mixdevelops Жыл бұрын
@@ok-mb1bn even if you do that, its still hard to read it
@stevusbrevus43625 ай бұрын
This video's quite good, but I do wanna add something for anyone passing through. in 15:08, you dont really need to use 2 if statements, you can simplify it down to: pos = (pos + op_length) % op_length; or... pos = (pos + op_length) mod op_length; Basically, we do a modulo on where we're selected with op_length. Hope this helps!
@Nightfallz232 жыл бұрын
Amazing Tutorial - I actually supported your Kickstarter and somehow never realized you did tutorials like this. Keep up the incredible work on your tutorials, this was very clear and helpful to expand upon.
@carlospintor-fernandez81053 жыл бұрын
Gotta say very well explained for beginners such as myself.
@peytonburnham43163 жыл бұрын
That’s great to hear!
@kingparat12583 жыл бұрын
Hell yeah! Thanks for the stellar tutorial man, hope your game is a success it looks phenomenal!
@kkeough57593 жыл бұрын
You, sir, are the real MVP. This series has been a tremendous kick-start.
@schlatta-dirtydeeds93513 жыл бұрын
When I say this is an upgrade to my previous menu system it is NOT an understatement, thank you! Looking forward to checking out more of your stuff!
@xwxlx2 жыл бұрын
!understatement
@snoopcena45942 жыл бұрын
greatest people on earth
@guterversuch63379 ай бұрын
Bro i love you. thats so many videos of you that helped me. every time i find my answers with you
@georgedouros45223 жыл бұрын
Great video it helped me a lot to construct some cool menus in my projects. However I found a small problem, if your submenu has less options than your initial menu level you get an Index error. Example: options[0, 0] = "New Game"; options[0, 1] = "Load Game"; options[0, 2] = "Settings"; options[0, 3] = "Exit Game"; options[2, 0] = "Sound"; options[2, 1] = "Back"; If you choose Settings you will trigger an index error because pos will be 2 but pos in options[2] takes values 0 and 1, even if you change the pos and menu_level in the Step Event inside the switch statement. One way to solve this (bad) is to add an alarm trigger that deactivates the Draw Event for miliseconds OR in my case, I just made a 1d array of menus and I spawn additional objects for each submenus. Again, I'm just mentioning this for educational purposes. This example of menu system you propose is solid and follows good practices. Great job and good luck on your works!
@kingofspades97203 жыл бұрын
I had the same issue, your comment helped me a lot, but, I found a super super simple way to fix it. instead of just putting //Settings case 3: menuLevel = 1; break; instead, change the op_Length before changing menu level, like this. case 3: opLength = array_length(option[1]); menuLevel = 1; break;
@ChufoildQQ Жыл бұрын
just number in order from 0,1,2 and so on, of course there will be an error if you jump from 0 to 2
@botijooj Жыл бұрын
@@kingofspades9720omg thanks so much man, was having a headache with this error
@kingofspades9720 Жыл бұрын
@@botijooj Glad it could help!
@jupi8611Ай бұрын
@@kingofspades9720 im actually in love with you, thank you so much. I was about ready to gouge my eyes out trying to figure out what I did wrong, especially being a total beginner lol.
@LF21Hungry Жыл бұрын
i know its been quite a while but i really got into gamemaker thanks to you, and i am finally able to make my own games instead of just modding thank you, you just got my sub =]
@ashliiiiii3 жыл бұрын
Thank you!! This is the best menu tutorial that I've found online, and helped me develop my menu system. I'm just getting into GameMaker2 so this tutorial was very helpful for me. Infinitely grateful!
@steevelapointe11522 жыл бұрын
your tutorial , are insane, im not even an english speaker, and i have a lot of diffuculty while listening video in english, but not on your video, you are talking clearly, we hear every word you spell, thanks for these tutorial.
@shaneduquette Жыл бұрын
If you're building this menu into the RPG game from the previous tutorials, and if you want to access the menu from your game, I added this to the beginning of the step event for the player object (obj_player): if (keyboard_check_pressed(vk_escape)) { room_goto(rm_title_screen); instance_deactivate_object(obj_player); } It makes it so that pressing the escape key (vk_escape) loads the menu (rm_title_screen). It also deactivates the player so they don't show up on top of the menu.
@supbroski3202Ай бұрын
i don’t think this works because pressing “start game” brings you to the next room, which means it makes your player restart from the first room in their beginning position :(
@PidgenDev28 күн бұрын
@@supbroski3202 An easy solution to this is having Start Game be reworded to Continue Game and having it linked to a global variable rather than a specific room. So each time you press esc it sets the variable to whatever room the player is currently in.
@supbroski320228 күн бұрын
@@PidgenDev i'll try that, ty!
@rinkun66893 жыл бұрын
I had to subscribe man seriously you’re a big help c: will you be covering an rpg battle system as well? I’ve been trying to figure out how to do an earthbound type of battle perspective, like how it’s first person but I dunno how to approach it..
@peytonburnham43163 жыл бұрын
Thank you! And I'm not sure yet what types of gameplay-oriented systems I'll be covering. As far as turn-based combat goes, an Earthbound style system would be one of the easier ones to cover but they're still pretty involved! But never say never, I suppose!
@reneilabayon22602 жыл бұрын
hey sir, i know its already been a year since you created this tutorial. I just wanted to say thankyou so much, I learn a lot from your videos.
@LunaRiddle773 жыл бұрын
literally a life saver for this one WOOO i had been looking for something like this all WEEK THANK YOU
@vela73582 жыл бұрын
best tutorial i've done and i've been hopeless with everyone elses tutorials, thanks.
@thumbsup54272 жыл бұрын
So I'm only up to 6:29 and the menu isn't drawing at all. I've copied all of your code, and it shows up in the room editor but it isn't drawing.
@thumbsup54272 жыл бұрын
The object is marked visible btw.
@GoldenponyboyCrossback2 жыл бұрын
Do you have the starting room set to be the room you have the menu in? That was the thing tripping me up.
@NoLongerTwee3 жыл бұрын
I love this guy and his tutorials
@gabrielpiche5024 Жыл бұрын
i got a problem. The game is running perfectly, i did everything you said, but when the menu opens, the Menu background sprite isn't there anymore. There's just the big black void behind the text and it looks to me like it's not well-centered like it's supposed to. Can you and the others help me, please? UPDATE: I found where the problem is coming from. It's the part where you have to position the menu. This part, to be more precise: width = _new_w + op_border*2; height = op_border*2 = string_height(option[0, 0]) + (op_length-1)*op_space; I deleted it and the background menu sprite reappeared, but it looks ugly and it doesn't fit the options nicely. Any ideas on how i can fix it?
@TornadoTwisterYT2 жыл бұрын
Could you make a tutorial for how to make the buttons in the sub menu (Window size, Brightness, and Controls) actually work?
@NingyoHimeDoll2 жыл бұрын
Great tutorial! I suggest putting this video in a playlist, because i couldn't find it while going through your playlists. After the RPG basics tutorial series i wanted to watch more tutorials, so clicked on the first dialogue tutorial video because it was in a playlist, and only at the beginning of that video i realized there was a previous video (this one) i had missed, and only because that video mentions it.
@commanderuseless1685 Жыл бұрын
Thank you very much for your videos, Peyton - I just recently got started with GameMaker Studio 2 and your videos have been entertaining, educational and extremely helpful!
@joandersonoliveira68023 жыл бұрын
thank u so much for creating this kind of content. u're really helping me a lot :)
@ponez85183 жыл бұрын
I'm running into a few problems while doing it. First of all, the object I put in the room is very small when I run it. What should I do? and finally, can we get the font ready instead of creating it ourselves?
@DanielAlvarez-oq8ex3 жыл бұрын
Same issue here. could you fix it?
@王润发-i9f2 жыл бұрын
i met the same problem, have you resolved it?
@Wakakakakaku2 жыл бұрын
1. just put object in the room, dont stretch It :) 2. create font(right click on workspace>assets>create font), name it font_main(or whatever you want), then in obj_settings create event instead of tutorial code put these code: global.font_main = font_main;
@ItswildII2 жыл бұрын
@@Wakakakakaku how would i type this code for the clean up would it be it says idk what im doing wrong anytips? trying to delete non-existing font. at gml_Object_Obj_settings_CleanUp_0 (line 1) - font_delete(global.font_text);
@lauraostler45403 ай бұрын
12:52 if anyone had the same problem where an error pops up from the for loop at line 10 I changed the local variable from "i" to "_i" Example: for (var i=0; i < op_length; i++ ) as for (var _i=0; i < op_length; i++ ) And changed all of the "i" variables from i to _i in the function below Don't know why it worked but it did.
@Deadsmile11239 ай бұрын
i got this error ERROR in action number 1 of Create Event for object oSetting: global variable name 'font' index (100030) not set before reading it. at gml_Object_oSetting_Create_0 (line 1) - global.font.main = font_add_sprite(xxxfont, 32, true, 1) how do i fix it?
@nemuri62959 ай бұрын
Remove global and just write "draw_set_font(font_main);" instead. That's what worked for me.
@ppk3552 жыл бұрын
At 9:47, how did he put the question mark in the top left and what does it do ?
@perra88242 жыл бұрын
he dragged the object from the assets bar to the room, and its a question mark cause there is no sprite associated with it and it wont show up in the game im not really sure what it does cause it has been about a week since i start trying to make a game but i think that since it was a font object it might be sorta storing it in the game or something? im not so sure about it since its an object having fonts but i have different stuff like that in my game and it activates what is written in the event stuff for me
@gtbgabe1478 Жыл бұрын
I'm having a small problem where when i select "back" to return to the main menu, it imediatly selects the top option, and i have no idea why
@Busterbrown1902 Жыл бұрын
I had the same issue, the problem was I forgot to put "break;" in the switch(menu_level) cases.
@gtbgabe1478 Жыл бұрын
@@Busterbrown1902 Turns out it was something way stupider instead of "Keyboard_check_pressed(vk_space)" I had put "Keyboard_check(vk_space)"
@SangHendrix3 жыл бұрын
I'm new to coding, I have zero knowledge of it and even tho your videos are basic, I'm still worried if I can understand all of this. Like what's the logic behind those codes? Do I need to understand it first or I just need to follow the tutorial and other tutorials and wait for the day I eventually get it?
@peytonburnham43163 жыл бұрын
If you haven’t watched my “How to make an RPG” series, watch that first, it goes by everything very slowly and i explain how everything works! It’s a bit simpler than this video. At first you’re going to be learning a lot at once so it might feel like you don’t understand, but thats how learning ANY new thing works! Keep following beginner tutorials, pay attention to them very closely, and REWATCH many of them after you’ve finished them. That will help a lot. Soon lots of this stuff will just stick with you and you’ll find your footing! Just keep going!
@oldbomb3 жыл бұрын
Great video, thank you so much, this was just the right thing to get me to finally program some menu systems for my games! I will definitly check you dialogue system too, looking forward to that!
@susgus133 жыл бұрын
i can't get the code at 28:05 or the code fix to work, it just gives me a small sliver of the background with nothing on it
@PickledPotato3 жыл бұрын
I had the same problem and fixed it by only copying this one line "draw_set_font(global.font_main);" instead of the whole draw code
@damage82793 жыл бұрын
I don't even know if you are still checking the comments for this video but if you are, one quick question: for some reason when I attempt to load my title screen at 13:04 in the tutorial, my letters are in the incorrect order? instead of: Start game Settings Quit game It shows: Tubsu Gbnf Tfuu joht Rvju Gbnf So I realized that the letters may in the incorrect order in my custom font because it is showing the letter after what's supposed to show. I double checked the sprite and your video and my custom one has the same amount and everything besides the squiggly line at the very very end(I tried removing and adding this nothing changed when I opened up the game). Please let me know if you can help me with this.
@thunkytank3 жыл бұрын
I had the same issue, but then realized it was missing a letter or 2. doubled check that your not missing a letter and you have Every symbol that's shown at the 1:10!
@sousukesagara6958 Жыл бұрын
What happens if you don't want to use a custom font or if you just want to use a downloaded font?
@KokomiFish09 ай бұрын
just write the font you have in the "draw_set_font();" line and don't add the custom part :D
@VeilOfBlood7 ай бұрын
@@KokomiFish0oh my god thank you so much your a doll😭😭
@digitalswordplay3 жыл бұрын
Great tutorial! - How would I go about adding a little triangle indicator beside the text when cycling through the options?
@scootie_scoot3 жыл бұрын
i second this!! i've been struggling to find an updated gamemaker tutorial about this
@PinesOfChaos3 жыл бұрын
In the draw event, you'd do something like: draw_sprite(spr_triangle, 0, x, y+op_border+(op_space*pos)) may need to offset the values depending on your sprite, but this should work
@KingOfFoolz2 жыл бұрын
Great video! But I still have a few questions. How would I go about making 2 more submenus? I tried just essentially following all the steps again creating 2 more cases. But my new submenues only have 2 cases in them each. But for some reasong when I try to open them it gives me an error. Saying there was something wrong on my Draw event 12, this one, draw_text_color(x+op_border, y+op_border + op_space*i, option[menu_level, i], _c, _c, _c, _c, 1);
@mcdaysalive65862 жыл бұрын
If you ever figured it out can you let me know, hitting the same error message and can't seem to figure it out...
@blanktheblanket8081 Жыл бұрын
You need to update your op_length variable when switching to a smaller menu(in your example a menu with 2 cases), let's say that the main menu has three cases, when you switch into your smaller submenu without updating op_length, gamemaker remembers that op_length is three so when it's trying to draw the submenu it returns an error because there is no 3rd case. Here's my code in the step event in case you don't understand: //Check for accept input if acceptK { //Switch pos switch menuLevel { //Main menu case 0: switch pos { case 0: room_goto_next(); break; case 1: menuLevel = 1; break; case 2: menuLevel = 2; opLen = menuLevel; break; //Updating opLen to current menu level case 3: game_end(); break; } break; //Options menu case 1: switch pos { case 0: break; case 1: break; case 2: break; case 3: menuLevel = 0; break; } break; //About menu case 2: switch pos { case 0: break; case 1: menuLevel = 0; break; } break; } } Sorry for late response and I hope this helps :)
@scootie_scoot3 жыл бұрын
i can't believe you made that font!! it looks just like old rpgmaker games or ds rpgs...i wish i could download it
@RobTFG25 күн бұрын
Loving this tutorial so far! I'm trying to adapt the steps in the video to make this work with individual button objects to allow for mouse clicking each options, instead of using the keyboard to select the menu options by drawing the sprite with different colours. Am I being silly and there is a simple way to allow for mouse-clicking the options without creating individual objects for each options? Still a WIP but currently I'm calling a loop to create each button instance and passing a struct with the text from the options array. Then on the object's mouse click event I have an if statement for what action to perform based on the string for the button's text.
@indiepunch34433 жыл бұрын
Amazing, thanks for sharing! I hope you continue to make more! :]
@peytonburnham43163 жыл бұрын
Thank you!
@prod.kasper3 жыл бұрын
what if the next menu level has less options than the first menu level? I kinda merged your video and shaun spalding's, I have a little arrow to show what you're selecting as well as colour. But yeah I have that error. Here's my draw code, the error is "var txt = menu[menuLevel, i]" for (var i = 0; i < menuItems; i++) { var offset = 2; var txt = menu[menuLevel, i];
@KingOfFoolz2 жыл бұрын
I think I'm having the same issue as you. Did you ever figure it out?
@prod.kasper2 жыл бұрын
@@KingOfFoolz no sadly I did not. I kinda gave up on it lol but there has to be some sort of solution
@eggman5712 Жыл бұрын
I don't know why but I can't for the life of me get the camera centering to work, I've got the x = camera_get_view_x(view_camera[0]) + camera_get_view_width(view_camera[0])/2 - width/2; y = camera_get_view_y(view_camera[0]) + camera_get_view_height(view_camera[0])/2 - height/2; but for whatever reason it disappears whenever I use this code.
@unoreversecard812911 ай бұрын
I had this issue and it ended up being me forgetting to configure my viewport lol Make sure U enabled viewport, make viewport 0 visible, configure your camera properties height and width and viewport properties width and height to whatever your games properties are and have the camera follow the obj_tile_menu (or whatever you chose to call your menu object) and it should show up when you run the game 👍
@kersod92166 ай бұрын
HELP, when I try to start the game, it says that, the code "draw_text( x+op_border, y+op_border + op_space*i, opción[i]) it's not set before reading it, can someone tell me how ti fix it ????? 😭😭😭
@Digikid02 жыл бұрын
is there a way to make this menu pop up over the screen and make the game pause with it? If so please make a part 2 to this showing how to code it :)
@SunnieMunch2 жыл бұрын
my code isn't perfect but I have something like this working well enough in my game describing what you're asking. For set up I have 2 instances layers for my game, one with all of the main elements and visuals like the player, obstacles, interactables, etc and one just for holding meta objects. In the step event of an overall controller object, I set up a if key pressed input that would be pausing the game, and use this line that toggles the state of being paused and not: global.gamePause = -global.gamePause + 1; then I have an if then statement that says if the game is paused, everything on the main game layer's image speed will be 0 to stop all animations with the instance of the menu being created on a separate layer above (additionally in the player's code if the game is paused, all movement code is stopped). else, the image speed of the main game layer is set back to it's original and the menu instance is destroyed. There may be a better way to do this or explain this but it's the best I have for now!
@flaminshotgun10 ай бұрын
19:28, how did you minimize the code into a smaller window like that? Or maybe "collapse" would be a better word.
@deadatyourside10 ай бұрын
there should be a plus button next to the code
@flaminshotgun9 ай бұрын
@@deadatyourside Thanks!
@LocalLialec Жыл бұрын
that last part when you were trying to say itchio was hilarious lmao
@lizagnaBITRАй бұрын
you are the best person alive. absolute lifesaver 😭
@shaneduquette Жыл бұрын
Why the clean up event to delete the font? The object is persistent, so won't it live until the game ends? When the game ends, won't the font go away anyway?
@0x44_3 жыл бұрын
Not sure if you addressed this in another video, but when I press down/up, the menu cycles WAY too fast. I had to create a variable for allowing access with another variable for giving it a cooldown timer, but I'm worried this might be an issue on faster/slower machines. I was wondering how you addressed this. Edit - My mistake, I was new to the engine and didn't know the difference between check vs check_pressed.
@fa_speedysnack2 жыл бұрын
Thanks man, this video really helped, though. I do a have a question, Can you make a part 2 where it covers actually setting up stuff like the volume, reso. etc?
@sewagecarrie3 жыл бұрын
Hey Peyton this series is helping me develop my own game right now, and I'm very happy that this series exist but I need help with a problem with the menu. My menu select is very fast, if i press up or down i just freaks out and lands on a random option. Nevermind, I got it lmao!
@bloxanimates25183 жыл бұрын
Wait how'd you fix that?
@bloxanimates25183 жыл бұрын
Im really confused on that too
@dialfrodie3 жыл бұрын
@@bloxanimates2518 you do keyboard_check_pressed instead of keyboard_check
@sewagecarrie3 жыл бұрын
@@dialfrodie Thats how ya do it
@bloxanimates25183 жыл бұрын
Thanks so much! @eidy and @Hattless Foe
@superstarichiban9 ай бұрын
I would love to see this system used for a turn-based rpg combat system!!
@realitygamer35243 жыл бұрын
Could you do a video on sprint/dash mechanics using the movement script from the rpg series? It'd be really helpful
@nathanreyc2 жыл бұрын
if keyboard_check(shift_key) { move_spd = 2; } if keyboard_check_released(shift_key) { move_spd = 1; } the values of the move speed can be whatever fits your game
@Gturtle10x6 ай бұрын
This series has helped me so much thank you
@Abdulrahman_tramsy3 жыл бұрын
Can you please do a tutorial for text boxes and how did you do the text box that was in the end of part 6
@peytonburnham43163 жыл бұрын
Yep I'm still planning on doing it! I have it outlined and everything I just need to find some time in the next few days to record and edit it!
@Abdulrahman_tramsy3 жыл бұрын
@@peytonburnham4316 and whenever will you do it iam waiting for you bro
@catalyst_87592 жыл бұрын
The tutorial has been very helpful so far, but I seem to have encounter a problem. I set the obj_title to w288 h216, everytime I start the game it’s small compared to what’s seen to your tutorial. Any help? 5:54
@erysecret2 жыл бұрын
thats because you need to enable the viewport on your test room. the room is set to 288 / 216, but the viewport properties are set to 866 and 648
@morrisharrison_ Жыл бұрын
thank you
@Kaemonster19 күн бұрын
bruh your tutorials are fantastic. Thank you.
@explodedkidboi3004 Жыл бұрын
I started using GameMaker recently. These tutorials really helped me understand how GameMaker works. Although, i used GameMaker Visual to code, i was able to make sure I was matching the code by useing the Live Preview function, which shows your code if typed out, but doesnt permanently convert it. Thanks for this 😊
@MoBoRoS2 жыл бұрын
Hi There Peyton, followed your tutorial to the dot! The difficulty skyrockets in this one compared to your 6-part series. I love your tutorials so far! they are really helpful! I managed to make the menu work as intended but with a few problems: 1st of all I do not know how to adjust the height and width of the box and letters to make them appear a bit bigger compared to the screen and 2nd when I click on "back" on the settings menu the game crashes and it returns the following error: ############################################################################################ ERROR in action number 1 of Draw Event for object obj_title_menu: Variable Index [3] out of range [3] at gml_Object_obj_title_menu_Draw_0 (line 5) - var _op_w = string_width(option[menu_level, i]); ############################################################################################ gml_Object_obj_title_menu_Draw_0 (line 5) Thanks again in advance! Keep up the awesome work!!
@gamerompstudios2 жыл бұрын
I'm having this same issue with the menu options. The only way it works for me currently is if both menus have the same amount of choices. My best guess is because arrays now only come in 1D, no longer 2d, technically.
@fatmen73912 жыл бұрын
i'll help u
@fatmen73912 жыл бұрын
STEP EVENT //get inputs up_key = keyboard_check_pressed(vk_up); down_key = keyboard_check_pressed(vk_down); accept_key = keyboard_check_pressed(vk_enter); //store number of options in current menu; op_length = array_length(option[menu_level]); //move through the menu pos += down_key - up_key; if pos >= op_length {pos = 0}; if pos < 0 {pos = op_length-1}; //using the options if accept_key { var _sml = menu_level; switch(menu_level) { //pause menu case 0: switch(pos) { //start game case 0: room_goto_next(); break; //settings case 1: menu_level = 1 break; //quit game case 2: game_end(); break; } break; //settings case 1: switch(pos) { //window size case 0: break; //brightness case 1: break; //controls case 2: break; //back case 3: menu_level = 0; break; } break; } //set position back if _sml != menu_level {pos = 0}; //correct option length op_length = array_length(option[menu_level]); }
DRAW EVENT //dynamically get width and height of menu var _new_w = 0; for (var i = 0; i < op_length; i++) { var _op_w = string_width(option[menu_level, i]); _new_w = max(_new_w, _op_w); } width = _new_w + op_border*2; height = op_border*2 + sprite_get_height(spr_main_font) + (op_length-1)*op_space; //center menu x = camera_get_view_x(view_camera[0]) + camera_get_view_width(view_camera[0])/2 - width/2; y = camera_get_view_y(view_camera[0]) + camera_get_view_height(view_camera[0])/2 - width/2; //draw the menu background draw_sprite_ext(sprite_index, image_index, x, y, width/sprite_width, height/sprite_height, 0, c_white, 1); //draw the options draw_set_font(global.font_main); draw_set_valign(fa_top); draw_set_halign(fa_left); for (var i = 0; i < op_length; i++) { var _c = c_white; if pos == i {_c = c_yellow}; draw_text_color(x+op_border, y+op_border + op_space*i, option[menu_level, i], _c, _c, _c, _c, 1); }
@flmaster101718 күн бұрын
big question, how do you make submenus for the first option (option [0, 0])? the second number changes the level as far as i'm concerned but doing [0, 1], [0, 2] and so on would just replace the values set before
@MoulderBoldr2 жыл бұрын
at like around 20:00 the code says there's duplicates of the cases. i have no idea what is happening, i have copied the code EXACTLY.
@TheBuckweat3321 күн бұрын
Okay I mean it works great...but is still very tiny. How do I make the text and box big enough to fit the entire screen? Like how do i zoom in?
@dc37wwe2kmods Жыл бұрын
why are my texts gibbirish? Like Start Game is like Tubsu Gbnf?
@dc37wwe2kmods Жыл бұрын
Fixed my problem: I missed a character on my font. Be sure to not miss one or else it'll go chaotic.
@ScrDesh Жыл бұрын
tubsu gbnf, words i will never forget lol! I did the same thing, missed the speech marks when making the font
@ApotheoChaos3 жыл бұрын
It worked fine for me at first, but all of a sudden the menu background started being incredibly small and out of proportion. I don't think I changed anything and my code seems to be the same as yours. It honestly feels like a bug with gms2 but I have no way of knowing that. Why would it suddenly work differently one day?
@TampopoInteractive3 жыл бұрын
Try putting the draw event code into the draw gui event. You might have to change some things around and set the gui size first though.
@DanielAlvarez-oq8ex3 жыл бұрын
Hello same issue here. Could you fix it?
@ApotheoChaos3 жыл бұрын
@@DanielAlvarez-oq8ex yes, I had to have the pixel font be a specific width, I think it was 4 pixels, but you should experiment. I couldn't find a code solution
@NavaSalehi-h5zАй бұрын
help so i did everything and instead of showing "start" "settings" and "quit" it just says "1" for all three options
@remixtrick3 жыл бұрын
I am having a strange issue. When I start the game, everything in the menu looks fine at first. But when I press "Settings", the only option that shows up is "Back" which doesn't work. Nothing I press can get me back to the main menu, the only way to get out is to exit and run the game again. I would really appreciate your help with this problem if you have the time. Do you have any idea what could be wrong, or do you need more details?
@remixtrick3 жыл бұрын
I fixed the issue! The problem was that all my options in settings had 0. So it looked like this option[1, 0] = "Window Size" option[1, 0] = "Brightness" option[1, 0] = "Controls" option[1, 0] = "Back" I guess I didn't notice this issue as I was copying and pasting. I've fixed it by changing them all to this: option[1, 0] = "Window Size" option[1, 1] = "Brightness" option[1, 2] = "Controls" option[1, 3] = "Back"
@gargoyled_drake3 жыл бұрын
a lot of cutting, would be nice to be able to just see how you do things from scratch, adding in, importing, creating new folders and so on, other than that it's great. don't listen to those that complain about too much information, there is no such thing, but there is a setting on youtube to speed up a video in case people are in a hurry 😜
@metalsonic4.1therobothedge24 Жыл бұрын
I did that, but since i have the room for the character spawn first, what do i do ?
@kanglongbutler2 жыл бұрын
Thank you for the tutorial, it's really well made. I need help please; I've been trying to find a way to make a pause menu like in the beginning of the video with but it keeps telling me that op_length isn't set before being read. Here's my code : In the step even of the player object: pause_key = keyboard_check(vk_escape); if pause_key = 1 { instance_create_layer(0, 0, "Instances", obj_pause_menu); } I haven't made any code to remove the instance yet because I'm not able to create it in the first place. I'd really appreciate any help, thanks.
@jcdenton72732 жыл бұрын
remove the "= 1" from the if statement. also when checking for things in if statements, you must use two equal signs. one equal sign means that you are setting the value of something, and two equal signs are how you check for the value of something inside a conditional (which is if statements, while statements, etc.). also the pause_key variable would be a boolean, which is true or false. checking if it's equal to one wont work because one is an integer, and pause_key is not an integer value. you would use if pause_key == true. however, that is unnecessary when checking if a boolean is true. hope this helps and was informative for you, id recommend watching some coding basics tutorials. learning things in once language can translate to all languages, even with syntax differences theres universal things that you need to know in coding
@maysonhuang3 ай бұрын
srry if I am talkative, but I just love the keyboard sound in the background of your audio, it is just satisfying XD
@rei26843 жыл бұрын
Can you make a tutorial for textbox and multiple choices?
@peytonburnham43163 жыл бұрын
Yep I am! Just need to find some time to record and edit the video in the next few days
@rei26843 жыл бұрын
@@peytonburnham4316 super i am struggling since months with my game because I don't find good tutorials. But yours are very good and easy to understand 👍Thank you 😊 Hope you will continue and have fun 😀
@mr.kofeek3 жыл бұрын
I have a question about the font. What if I use the ttf file? Should I do the same steps like from 7:50 or draw_set_font will be enough?
@pathetic_girl3 жыл бұрын
I was personally having problems with setting up a TrueType font so I just decided to do the sprite method
@mr.kofeek3 жыл бұрын
@@pathetic_girl i also did the sprite option, however i tried usual font before at least to get known about this opportunity
@novelistarchives3 жыл бұрын
At 28:41 and beyond, the codes for the height and width of the menu borders don't seem to be working for me, so I skipped this process. The borders don't match themselves with the height and width of my font. Can someone help me please? Thank you
@flopr3 жыл бұрын
yes me too, i dn't understand why
@hopefulsparks2 жыл бұрын
What should you do if the rendered text comes out as a jumbled mess? I followed everything here, including making my own font in the same string order as you did, and the output text is not even close to what it should be saying
@hopefulsparks2 жыл бұрын
You should add an empty frame at the start of the string, I figured it out :D
@AngryhammerGames2 жыл бұрын
That was an awesome video! I loved the tempo\speed of the video too. My UI always gets messy when I add sub menus and features. I like what you did as its quick/simple and dynamic. I dont know if it matters much, but I am not sure about having for loops in the draw event. Can be a cpu/gpu killer if your not careful. Lately I like to use a menu_controller object which keeps track of what menu your at and what buttons to show. Then I have button objects that can change as needed in size, text or image. Also more advanced animations and such using delays or loading. They are easy to control too as each menu button is an object and all that entails. It can help when mixing input from mouse, keyboard or joystick as I like to have all of them available. But anyways, I really liked this video and your code is pretty awesome!
@wanderslight96253 жыл бұрын
Quick question regarding the initial length and width values. In the beginning of the tutorial you set width and height values for the menu border and later on you made the menu border size dependent on the text and fonts. Would the initial length and width values still matter? Or could you just set them to 0 and let the step event change them dynamically according to what’s being displayed?
@shabanotti2 жыл бұрын
I chaged them to 0 and it seems to work fine so I think it's ok to initialize them all at 0.
@PossiblyStxrmy3 жыл бұрын
could somebody help i get to 26:17, but it keeps giving me either "empty if statement" or "got 'if' expected 'case' or 'default'"
@shabanotti2 жыл бұрын
You probably have something like if (condition); { Remove the semicolon as that ends the if statement befor evaluating the code inside its curly brackets.
@Moogy7686 ай бұрын
If your menu disappears when you add Center Menu code, try dividing it by different values. I had divide my x by 9 and y by 7 to center it. instead of the /2
@TampopoInteractive3 жыл бұрын
This is so great and simple to implement! Thank you!
@distopia843 жыл бұрын
Hey! could you teach how to make the Rose of Starcross combat system, please?
@peytonburnham43163 жыл бұрын
Heyo! I’ll probably do some kind of dev talk on RoS once it’s finished down the line. But for now I can’t really show off anything under the hood! I might do a simpler turn based tutorial at some point though!
@distopia843 жыл бұрын
Ok
@Learnjapanesefromsomeguy3 жыл бұрын
I can press spacebar on 'settings' and have it take me to the next menu but when I click "Back" it does not go back to the pause menu. Instead, it takes me into my game as if I had pressed "Start Game." Has anyone else had this issue, or could possibly guess as to why this might be happening? Edit: Never mind. I figured it out. I had typed accept_key = keyboard_check(vk_space) instead of accept_key = keyboard_check_pressed(vk_space). So, 'Back' was actually bringing me back to the pause menu, but because the spacebar was still pressed, it would select "Start Game" immediately then I would find myself in my game without ever seeing the pause menu.
@peytonburnham43163 жыл бұрын
Glad you figured it out on your own! It's great to start building that skill of being able to identify little problems like that and knowing what was actually happening! Great work!
@totallytoffy2 жыл бұрын
Hippity Hoppity, Your code is my property!
@spacecase73313 жыл бұрын
Great tutorial overall, loved it! Just one question, how would I add a sound effect every time I switch to a new option?
@TampopoInteractive3 жыл бұрын
I’m not the video poster, but in the step event within the input checks, where there are two if loops under “//move through the menus”, you could put an audio play in each of those loops.
@mproxima47912 жыл бұрын
probably you already solved but I went this route work pretty well right now. if up_key { audio_play_sound(sound,1,0) } and same for the down key
@Sora-sb2fd3 жыл бұрын
Help, I speak Spanish and I need to put the "Ñ" but when I put it in the custom font of my menu, all the letters are scrambled and the word I want does not appear but it keeps the spaces, how can I do it?