You prolly dont care but does anyone know a way to get back into an instagram account? I somehow forgot my login password. I would appreciate any help you can give me!
@Axl Albert I really appreciate your reply. I found the site thru google and Im trying it out now. Looks like it's gonna take quite some time so I will get back to you later when my account password hopefully is recovered.
To do a mouse interaction with menu, I added some thing at FriendlyCosmonaut's code, making this: 1 - ///Step event //Mouse imput imput_mouse_enter = mouse_check_button_pressed(mb_left); //Confirm selected page if (imput_enter_p) || (imput_mouse_enter) { switch( ds_grid[# 1, menu_option[page]] ) { case menu_element_type.script_runner: break; case menu_element_type.page_transfer: page = ds_grid[# 2, menu_option[page]]; break; case menu_element_type.shift: case menu_element_type.slider: case menu_element_type.toggle: case menu_element_type.imput: //imputting = !imputting; break; } //audio_play_sound(snd_pickup, 5, false); } 2 - //Draw GUI Event // MAKE SURE THAT THE MOUSE MOVEMENT AREA IS PROPORTIONED TO THE VIEWPORT SIZE OF THE GAME WINDOW (if you don't do this your mouse will not be accurate). var view_x = camera_get_view_x(view_camera[0]); var view_y = camera_get_view_y(view_camera[0]); var view_width = camera_get_view_width(view_camera[0]); var view_height = camera_get_view_height(view_camera[0]); var mouse_actual_x = view_x + device_mouse_raw_x(0) * (view_width/window_get_width()); var mouse_actual_y = view_y + device_mouse_raw_y(0) * (view_height/window_get_height()); var x_buffer = 32; var y_buffer = 64; var start_x = gwidth/2; var start_y = ( gheight/2 ) - ( ( ( ( ds_height-1 ) /2 ) * y_buffer ) ); var ds_grid = menu_pages[page]; var ds_height = ds_grid_height(ds_grid); repeat(ds_height) { xo = 0; if (yy == menu_option[page]) { xo = -(x_buffer/2); }
rxx = ltx + xo - string_w , ryy = lty - (string_h * 0.6); //0.6 change this value if the rectangle around the string does not match vertically // This creates a collision rectangle around the strings, and when you hover over one of them,menu_option[page] will change selected item. if (point_in_rectangle(mouse_actual_x, mouse_actual_y, rxx, ryy, rxx + string_w, ryy + string_h)) { menu_option[page] = yy; }
yy++; } // I advise you to draw the rectangle on the screen to understand the real position of the collisions. //var c = c_white; //draw_rectangle_color(rxx, ryy, rxx + string_w, ryy + string_h, c,c,c,c, true); Sorry my English, I hope this can help. Thank you FriendlyCosmonaut! Bye all!
You are my new favorite GM youtuber. This is by far one of the best practical tutorials I have seen. Thank you so much. edit* I actually have not switched to GM:2 yet but I am really thinking about it now.
This was really helpful! I often have trouble using ds grids because I'm not very good at maths, but you laid them out in such a clear manner that they make a lot more sense to me now
I really enjoy your organization/explanation of the concept behind the ideas. The chart on excel was very easy to grasp/adapt and utilize after getting started
I love your videos because your teaching style is very visual with your charts and diagrams combined with awesome explanations. I had never seen an array provided as an argument like you did for the script in Game Maker. Like always, I learned a new way to use Game Maker. Thanks for your hard work and sharing your knowledge!
GREAT TUTORIAL! It really put me off to start a game not knowing how to make a menu. Btw, thank you for putting the camera closer/zomming in. Some of your other videos are really difficult to watch when I have a half the screen for the video and the other half with game maker. This reads perfect! Love from Mexico.
Thanks so much, I'm glad it helped! Yeah, most of my earliest videos don't have any zooming unfortunately - lately I've been remembering to increase the font size, at least.
Thank you. This was exactly what i was looking for! Well coded and very organized as clean as it can get. Such a proper way of using enum and DS. (if i would make a menu would make sure to use these features, you just showed me how and clarified things out, thank you soo much for this).
Exactly what I was looking for. Coming from Javascript/NodeJS Background I really needed to see an idea of the basic workflow of GameMaker ... reeeealllly helpful thanks @FriendlyCosmonaut !
Hey, FriendlyCosmonaut just saw a few videos from you, and its easy to see how hard are you working to upload the most refined content that you can do, and thats amazing! i'm thinking about patron your work at this moment! Keep up this amazing work please! Love it! Greetings!
Thanks so much! I'm really enjoying making these tutorials. That's really kind of you to say. Though don't feel obligated; I know most of us are wearing the same shoes as self-funded indies :). Hopefully I see you around!
I was watching this like, "OK, yep, gotcha, makes sense. Hmmm...well that escalated quickly!" I'm going to have to come back later when I understand some of these things better. Still very well done.
Thank you! Yeah it's definitely a more intermediate/advanced tute. Still though, it might be my fault if I haven't explained something well enough. Can I ask which part lost you?
13:53 when suddenly you have a ds grid containing a script containing an array containing enums. This isn't your fault, I just don't know anything about ds grids or arrays, and I haven't yet started using scripts that take arguments. I understand the basic concept of an array, but I'm not at the point where I'm fluent enough to start using them to solve problems or organize things. Ironically I already have an options menu containing most of these things (and it works!)- volume/sfx sliders, vsync and fullscreen toggles and configurable controls for keyboard and gamepads that save and load from an ini file. I just set the menu up in a basic way that works with my current skills. I'm making a point to not include any code in my game that I didn't write and don't understand so I actually learn how to do things.
Ah that makes sense, thank you for the feedback. That's great if you already have a working menu - if it works and does what you need, then you needn't look any further! Definitely a good policy to only put in code you fully understand.
ive been looking for videos like this a looong time and only found heartbeast and shaun videos but yours are amazin as well! and even more detailed! keep on making videosl like this, its like the core things we all need and almost NO ONE gives good content, tutorials or at least help with this things in GMS2! ;(
For anyone with complex menu systems >> at 22:40 there's use of a loop inside a loop, if you're familiar with bigO-notation || data-structures&algorithms you'll know nested loops are considered very slow processes. Perhaps someone could enlighten me? I'm looking for a more efficient way to render a large complex menu with many rows and columns ~ I'm trying to create an IDE/Code-editor for a programming game in the style of 'Papers Please' ~ would really appreciate any advice :) Loved the video! Awesome in-depth analysis on menu's in GameMaker ❤
Hi, I really love how you take your time to really explain each step of the process. You give me confident to go on my first serious "game" ( More like an alpha with no graphisme and animation but with fonctional turn per turn battle, a fantastic open world (3 dungeons and 1 city) and a cut-scene for basique story .
You should clear the Grid (19:40) with 'undefined' so you can always check for an undefined value and json_encode() saves these as "null". Otherwise the grid is filled with 0 and so it is saved and loaded as a 0 which is hard to track.
I'm a bit confused with the debug. I can't see any instances there, but I noticed you're looking at the Menu step event in the video. Before the debug, the video ended with the menu object only having Create and Clean Up events. Did I miss something and should have a step event somewhere? Thanks!
I don't think we went into the Step event in this tutorial - it's possible I actually ran that in another project that was displaying code from the next tutorial. If you can't see any instances in the tab, it may be that you haven't pressed "pause" on the debugger
Yeah, I've been pausing it. I went ahead in the next video a bit too and the Draw GUI event isn't working either so I must have messed the code up somewhere. I'm not getting any errors and and went through the video a second time, so I guess I'll try it a 3rd later.
Even after following the complete tutorial, I'm getting an error that states "The function 'create_menu_page' takes no more than 0 arguments but 2 are provided." Any advice or tips on how to resolve the error?
With respect to controls it gets a bit more complicated if you set multiple options for the controls. For example (ARROW KEYS, WASD, and gamepad). left_key = keyboard_check(vk_left) || keyboard_check(ord("A")) || (gamepad_button_check(0,gp_padl) > 0); I was thinking you could do something like primary_left = secondary_left || tertiary_left. The real problem comes with setting those (to many screens). Maybe it should just be simpler: keyboard controls | gamepad controls?
Any know why I'm getting the following error ? ERROR at line 40 pos 6: Unexpected symbol in expression. Also im using gms 1.x Line 39: ds_menu_main = create_menu_page( Line40 ["RESUME", menu_element_type.script_runner, resume_game], Line41 ["SETTINGS", menu_element_type.page_transfer, menu_page.settings], Line42 ["EXIT", menu_element_type.script_runner, exit_game], ); it also does ths for all of the others such as ds_settings, ds_menu_audio
Ah, it's because you can't declare arrays with the square brackets in GMS 1. You can create a script that will allow you to create arrays in a similar way though: Create a script and call it create_array. In it, put: ///create_array(val1, val2...) var arg = 0, i = 0, arg_count = argument_count; repeat(arg_count){ arg[i] = argument[i]; i++; } return arg; /// So instead of putting the square brackets, you'd have to put: ( create_array(arg1, arg2), create_array(arg3, arg4) ). You could call the script something else if writing "create_array" is annoying! Hope that makes sense.
This is what my v.2.3.0 create_menu_page script looks like if it helps anyone. function create_menu_page() { // Creating the grid var ds_grid_id = ds_grid_create(5, argument_count);
// Assigning elements from array to the grid. var i = 0; repeat(argument_count) { var array = argument[i]; var array_len = array_length_1d(array);
var xx = 0; repeat(array_len) { ds_grid_id[# xx, i] = array[xx]; xx++; } i++; } return ds_grid_id; }
I'm not sure if you'd even need that anymore, you can just probably use an array with arrays inside of it. Like array_main = [ ["Resume", menu_ET.script_runner, resume_game], ["Settings", menu_ET.script_runner, menu_page.settings] ];
It won't show up as an instance when I run the debug. I thought maybe I needed to set the object in the room under an instance layer, but that doesn't do anything but show the location of said object. I don't know which step I missed, but I've watched this over a few times and I feel more like an idot every time I go through checking to see what I screwed up on.
I have no idea how I missed it, but I spelled height and view like an idiot 3 times and so I guess it wasn't even running the object. Idk how it didn't send me an error or what happened, but I dropped GMS for a little while because school started, and then came back to that mess. It works now. I appreciate you making these tutorials and responding. I'm sorry I got back so late.
The instance still doesn't show, but I can physically see it in the preview. I need to relearn everything again anyway. I'll mention something if I get a solution other than double checking spelling mistakes.
Hi there, I am a professional software engineer who decided I wanted to get into game dev. Can I ask why some variables are declared with var like "i" and "ds_menu_main" is not declared with var? Is this a code style thing and GML is flexible or is var only for stack-allocated types and skipping var is for objects/heap-allocated types. What is the deal exactly?
It's the difference between global, local and (I'm not sure the exact name) code variables. Globals can be initiated anywhere are are saved forever, regardless if that object is destroyed or there is a room change That is the 'global.number = 2 format.' It's good for info you will need throughout the entire game, like what key is up. object variables are usually established in a create event and are saved as long as that object exists. That is when just say 'ds_menu_main = whatever' format. It's good for info an object needs to remember, like the state of an enemy. Then local 'var' variables are established with in a script, and then are forgotten when that script reaches an end. 'var number = 0' is that, if you try to use that var anywhere else other then in that specific script after you establish it, you will get an error because it's gone. It's good for temporary calculations and such, info needed in that moment alone.
@@coachcookie_ lol being largely self taught sometimes means you forget the 'proper' terms while understanding the base concept lol. I edited the post so it's lot as confusing.
Thank god for this tutorial. I've been searching high and low on UA-cam for a good menu tutorial and this one is not only the best and most detailed, but it has single handedly made programming as a whole feel so much easier. Thank you and keep doing what you're doing. Do you have any online courses or is your UA-cam your main stuff?
Hi I did the guide correctly. But in some of the global variables it shows me that they have only been mentioned once. How do I fix this? I would appreciate your assistance
hey, about the tutorial about resolution, have you done it? I wanted to put in my game but I am struggling because I am new, if you didn't, can you recommend a video to watch?
Does anyone know how to convert this code to work the same in newer versions? The script update for 2.3 messes this code up and I don't know how to fix it :/
Close to the end. for some reason in debug mode, i cannot get the option to pop up allowing me to view as a grid. None of the options light for my ds grids. I am assuming at some point it is not actually creating a grid but pretty sure the code is right.
Yes there must be something in the creating menu script. It might be something as silly as a misspelled variable. Unfortunately I can only speculate without seeing your code. If you can't find the problem, feel free to send me your project file at friendlycosmonaut@gmail.com, or take a screenshot of your create menu page script!
I think ive found the problem. Even though I hit pause the graph is showing the game is still going. It's the only difference I can find between your video and my code.
Im very new to GameMaker but I found if you put the REDMARKER think its called breaker or something(by clicking the left side where the number of the code line is, it should add a red circle) in the ending line of the ds_men_main, or ds_settings, etc this line being the one where you end with " ); ", then clicking debugg then go to all Instances and yo should be able to view as ds_grid. idk how to view it wiithout this... but i guss its a proof that it is working :)
Hello, I have a question about game maker I would like to know if it is possible to make an interface / window system that displays long texts and images, and that contains a scroll bar to be able to show the entire text. As if it were a web page, for example from wikipedia (besides being something that would also resemble the text document system of Resident Evil and Silent Hill. However it would not run in a specific room, it would in fact be a window that appears during the game when the player presses a button. I would also like to know if it is possible to create a notepad system too, something very simple that the player can write down a text and that will be saved for him to check later and lastly, is it possible to create a music player? a GUI that allows the player to choose songs and has play, restart and etc. buttons if possible, can you give me a reference for me to search for please? and another question, is this type of functionality too advanced for a beginner or unstable for the game maker to run? (The idea of the game involves a lot of reading texts and taking notes)
For a scroll bar, you probably draw everything with a scroll var, that starts at 0, and when you scroll down just decrease that number into the negatives and add it to the y coordinate of everything. To show that in a window, you could probably use a surface. Draw it to a surface smaller then the screen size, and anything drawn to it outside of it's range will just not be visible. For a notepad, there is functions for getting strings from the keyboard and saving it to whatever. You should prob look at GMS2's official documentation for info on surfaces, strings, keyboard input, and drawing text.
Is there a method to set global.key_revert and global.key_enter, etc. to multiple keys? I did: *global.key_revert = ord("X") || vk_backspace;* and it worked fine. However, when I did: *global.key_enter = vk_space || vk_enter;* every time I hit up or down on the keyboard, it registered it as a "key_enter" event. Seems inconsistent...
Thank you for the tutorial! I have no idea if you or anyone is looking at the comments now, but I was wondering if and/or how this can work with Gamemaker Studios 2.3? There were changes to how scripts were and I don't believe I can make the script the same as in the tutorial. Any advice is appreciated. But I have used your tutorials for other aspects and they were great and easy to follow. I hope you make more tutorials in the future.
Really nice tutorial, FriendlyCosmonaut. Is there any chance to implement a smooth and accurate mouse control for this type of menu though? I've tried several methods but failed every time. It could be that I am just dense but I'd still appreciate a helping hand.
i don't know if this could to help you, but try to use point in rectangle, and make this rectangle around each array number you have defined for your menu to interact with them with the mouse.
@@schaichhornchen6283 Hey Schaichhörnchen, I think I managed to do a mouse interaction, I maked this: 1 - ///Step event //Mouse imput imput_mouse_enter = mouse_check_button_pressed(mb_left); //Confirm selected page if (imput_enter_p) || (imput_mouse_enter) { switch( ds_grid[# 1, menu_option[page]] ) { case menu_element_type.script_runner: break; case menu_element_type.page_transfer: page = ds_grid[# 2, menu_option[page]]; break; case menu_element_type.shift: case menu_element_type.slider: case menu_element_type.toggle: case menu_element_type.imput: //imputting = !imputting; break; } //audio_play_sound(snd_pickup, 5, false); } 2 - //Draw GUI Event // MAKE SURE THAT THE MOUSE MOVEMENT AREA IS PROPORTIONED TO THE VIEWPORT SIZE OF THE GAME WINDOW (if you don't do this your mouse will not be accurate). var view_x = camera_get_view_x(view_camera[0]); var view_y = camera_get_view_y(view_camera[0]); var view_width = camera_get_view_width(view_camera[0]); var view_height = camera_get_view_height(view_camera[0]); var mouse_actual_x = view_x + device_mouse_raw_x(0) * (view_width/window_get_width()); var mouse_actual_y = view_y + device_mouse_raw_y(0) * (view_height/window_get_height()); var x_buffer = 32; var y_buffer = 64; var start_x = gwidth/2; var start_y = ( gheight/2 ) - ( ( ( ( ds_height-1 ) /2 ) * y_buffer ) ); var ds_grid = menu_pages[page]; var ds_height = ds_grid_height(ds_grid); repeat(ds_height) { xo = 0; if (yy == menu_option[page]) { xo = -(x_buffer/2); }
rxx = ltx + xo - string_w , ryy = lty - string_h * 0.6); //0.6 change this value if the rectangle around the string does not match vertically // This creates a collision rectangle around the strings, and when you hover over one of them,menu_option[page] will change selected item. if (point_in_rectangle(mouse_actual_x, mouse_actual_y, rxx, ryy, rxx + string_w, ryy + string_h)) { menu_option[page] = yy; }
yy++; } // I advise you to draw the rectangle on the screen to understand the real position of the collisions. //var c = c_white; //draw_rectangle_color(rxx, ryy, rxx + string_w, ryy + string_h, c,c,c,c, true); Sorry my English, I hope this can help. Bye!
i want to move the text a bit to the right when i select it, not only make it change color. i tried drawing it a bit further but it just draws it over the first one. Help!
Hey, Im 6 years late to this tutorial, but in the scripting section, you use a nested repeat loop. I've been trying to write it as a for loop as I'm more used to those. Would there be any issue using this in place of it? " //loop through arrays, store menu data in ds_grid for(var xi = 0; xi < array_length(arg); xi++) { var array = arg[xi]; var array_len = array_length(array);
for(var yi = 0; yi < 5; yi++) { ds_grid_id[# xi, yi] = array[yi]; } } "
Hi there, you probably don't check these comments anymore, but two things. 1) First, I wanted to thank you for all the tutorials you've put up. Your manner of explaining things really works for me and I appreciate the time and effort you put into these. 2) I'm new to Gamemaker Studio and this is probably a stupid question, however, when I run the debugger and press the Pause/Break button, my game doesn't actually seem to pause. The button depresses like you'd expect and stays so, but unlike yours in the video I can still see my framerate changing which indicates to me it's not paused. Do you have any idea why this would be the case?
phenomenal tutorial, far too complicated for me to implement into my tiny little game, but thank you for the information regardless. The 10 people who disliked it have to be too thick to understand because this is impossible to genuinely dislike, its honestly just too good.
Ik this video came out awhile ago but I’m new to coding so I have no clue what I’m doing wrong. I pretty much copied the code but when I open up the debugger and go to the object the values just don’t match the ones in the tutorial. Help?
I'm currently trying to make the menu element shift dynamic, Because I have a max_zoom variable for the screen resolution that changes. So I've setup an array called zoom[i] and each increment of zoom[i] contains a different string simply called X1, X2, X3, etc until it reaches max_zoom. When it works the player should be able to select their desired zoom amount, But I've no idea how to actually input this into the fifth argument of create_menu_page, so I was wondering does anyone know how to do this?
Anyone that needs help with this issue, my qeustion has been answerd here: www.reddit.com/r/gamemaker/comments/97y3uj/changing_the_size_of_a_menu_selection_option/
Hey FriendlyCosmonaut, I've been following your farming tutorial and run into a little bit of a problem with the menu now. My DS grids for farming and the menu's are having the same values now and are bothering each other, so now my menu is using the DS grid for the crop data and ofcourse that isn't supossed to happen, but I'm not quite sure how to fix it. So I was wondering if you could point me in the right direction to solve this problem? Here's the error game maker gives me: FATAL ERROR in action number 1 of Other Event: Room End for object con_crops: unable to convert string "Audio" to int64 at gml_Object_con_crops_Other_5 (line 25) - ds_crop_data[# 2, slot] = inst.crop_type;
Hey honestly this looks like a tough one. I'd guess some of the maps aren't being destroyed/updated properly, as you said they were sharing values (that should NOT be happening!). If the menu works fine when the other grids aren't there (you could test this by moving the menu system to a different room and not putting the crop etc objects in there), then the culprit must be the crops. From there I could only suggest looking over those sections again and ensuring everything is getting destroyed and saved as it should be.
@@FriendlyCosmonaut The culprit was definitly the crops, I forgot the place a curly brace properly for the room check in the con_crops(crop controller) room end event. Thank you so much for pointing me in the right direction!
@@DarkzFlame I seem to be having the same error but it seems to be conflicting with FriendlyCosmonaut's Depthgrid system. I've been looking if i messed up curly braces anywhere in the depthgrid system but I can't seem to find anything. I don't suppose you could tell me a bit about how you went about debugging this issue could you? Thanks heaps
@@BrentBruthaa Personally I haven't had the need to implement the Depthgrid system, so I have no idea how it works so far. As for how I found the bug, I kinda forgot, but now I would use the built in debugger and go line by line and see if the code behaves weirldy. Also make sure that you didn't set your ds grids to 0 as Friendly Cosmonaut coverd in part 9 of the farming series instead set the ds grids at -1. Assuming that is uses data structures, the same might also apply to ds_lists.
@@DarkzFlame Dude! You're a legend! I set my ds_depthgrid to -1 from 0 and it's not conflicting anymore. Thanks heaps man. And thanks FC for the tutorial.
I really wonder how you or anyone else can make such system, you really have to be a genious/professor to find all these solutions to organise everthing so good, it cant be only prelearned procedures from a book that you execute. I acctually wonder did you learn this yourself, or what kind of education provides you the skills to make your own complex systems?
Any reason why I shouldn't be able to group arguments like in the video? my_function( [arg1, arg2], [arg2, arg3] ) isn't working for me. I'm on GM:Studio 1 but I'm really hoping that's not why. Great series btw, I've been meaning to thank you for your great content for a while. It's clear how much effort you put into visualizing and clarifying advanced concepts, and I, for one, totally appreciate it :)
Thank you! Unfortunately GMS1 doesn't let you declare arrays like this, so I'd suggest making a script that allows you to do something similar. We can call this script create_array. In it, put: ///create_array(val1, val2...) var arg = 0, i = 0, arg_count = argument_count; repeat(arg_count){ arg[i] = argument[i]; i++; } return arg; So instead of putting the square brackets, you'd have to put: ( create_array(arg1, arg2), create_array(arg3, arg4) ) Or of course you could call the script something else to try and reduce the clutter this introduces!
Ahhhh, haha funny story :) I saw TMCicuurd's comment below about returning 'arg', and also earlier comments by other people using GM:S 1.4 who had problems, and I realized I'd have to come up with a work-around. So I spent a not-so-insignificant amount of time going about it a slightly unusual way. I basically added every argument separately without the [ brackets ], and made sure there were 5 entries in every menu_page (filling in blanks with "-1"). From there I could just create an array based on the number of arguments I had divided by 5, and assuming I had filled everything out correctly (I added an error check to make sure), it seemed to be an effective band-aid. I got it all working nicely and decided to save before heading to your next tutorial... Buuut, big mistake. The classic bug that seems to be plaguing the saving functionality of GM:S 1.4 was back at it again, and all of the data files I had for my entire project were removed from the game. This wasn't my first rodeo, so I had backups, but unfortunately I lost all progress made over the past few hours. Usually I just get back on the horse, but this was the final straw. Your tutorial, combined with my laborious attempts to band-aid the game engine's antiquity, made a compelling argument for never using GM:S 1.4 again, and I eventually just bit the bullet and bought GMS 2. I'm about an hour in and already I can't imagine myself without it. What a sight for sore eyes. TL;DR: Thank you very much for your helpful reply, as, if nothing else, it has helped to confirm my decision to buy GMS 2. I look forward to the next menu vid! Happy holidays :)
Hey, FriendlyCosmonaut, I love your videos and I have learned so much from them! Now I know I'm probably late to the party by about 2 years, but hopefully you could help me. I follow your tutorials pretty much to the letter but I still try my best to understand the content to apply to future games. I seem to have ran into a road bump, I can move on to the next page. I have taken a look at the other comments and have re watched your videos to see if I missed something but I can't find what I'm missing. Any suggestions?
I'm sorry if this is irritating, especially since this project is pretty big, but i have a small doubt. So essentially I'm using GMS 1.4.x, but the square brackets don't work so i decided to create arrays another way,I don't know if this will work, but could anyone please check this out. //CREATE MENU PAGES ds_menu_main = create_menu_page( array["RESUME", menu_element_type.script_runner, resume_game], array["SETTINGS", menu_element_type.page_transfer, menu_page.settings],................................etc ) Thanks if anyone helps. EDIT: I did see the comment on making a script create_array, but every time I use it I still get an error but when I did the above code there were no errors, maybe this is because I'm implementing the code wrongly. If the aforementioned code doesn't work properly could anyone tell me how to implement that code: ( create_array(arg1, arg2), create_array(arg3, arg4) )
another way i did it is by doing it according to this forum: forum.yoyogames.com/index.php?threads/initialize-an-array-in-one-line.4232/ The end result: ds_menu_main = create_menu_page( array("RESUME", menu_element_type.script_runner, resume_game), array("SETTINGS", menu_element_type.page_transfer, menu_page.settings), array("EXIT", menu_element_type.script_runner, exit_game) ); NOTE: the function array in this code is a script with the code of Salvakiya, unlike last time where it wasn't a script. Any help on which is correct would help.
This is correct! You do need "array()" to be a script that is going to take in your inputs as arguments, shuttle them into an array, and then return its ID.
Simply... amazing. It's difficult to see that much quality content and deep explanations over the internet. Thank you for what you do! Keep it up!
You prolly dont care but does anyone know a way to get back into an instagram account?
I somehow forgot my login password. I would appreciate any help you can give me!
@Bowen Layne Instablaster :)
@Axl Albert I really appreciate your reply. I found the site thru google and Im trying it out now.
Looks like it's gonna take quite some time so I will get back to you later when my account password hopefully is recovered.
@Axl Albert It worked and I actually got access to my account again. I am so happy:D
Thank you so much you saved my ass :D
@Bowen Layne No problem :)
*clicks on video, "its only 28 minutes long"* 2 hours of pausing later, "wow im done", *realises theres anther part*, *universe implodes*
actually me
@@johanssonts we all did
To do a mouse interaction with menu, I added some thing at FriendlyCosmonaut's code, making this:
1 - ///Step event
//Mouse imput
imput_mouse_enter = mouse_check_button_pressed(mb_left);
//Confirm selected page
if (imput_enter_p) || (imput_mouse_enter)
{
switch( ds_grid[# 1, menu_option[page]] )
{
case menu_element_type.script_runner: break;
case menu_element_type.page_transfer: page = ds_grid[# 2, menu_option[page]]; break;
case menu_element_type.shift:
case menu_element_type.slider:
case menu_element_type.toggle:
case menu_element_type.imput:
//imputting = !imputting;
break;
}
//audio_play_sound(snd_pickup, 5, false);
}
2 - //Draw GUI Event
// MAKE SURE THAT THE MOUSE MOVEMENT AREA IS PROPORTIONED TO THE VIEWPORT SIZE OF THE GAME WINDOW (if you don't do this your mouse will not be accurate).
var view_x = camera_get_view_x(view_camera[0]);
var view_y = camera_get_view_y(view_camera[0]);
var view_width = camera_get_view_width(view_camera[0]);
var view_height = camera_get_view_height(view_camera[0]);
var mouse_actual_x = view_x + device_mouse_raw_x(0) * (view_width/window_get_width());
var mouse_actual_y = view_y + device_mouse_raw_y(0) * (view_height/window_get_height());
var x_buffer = 32;
var y_buffer = 64;
var start_x = gwidth/2;
var start_y = ( gheight/2 ) - ( ( ( ( ds_height-1 ) /2 ) * y_buffer ) );
var ds_grid = menu_pages[page];
var ds_height = ds_grid_height(ds_grid);
repeat(ds_height)
{
xo = 0;
if (yy == menu_option[page])
{
xo = -(x_buffer/2);
}
var str = string(ds_grid[# 0, yy]),
string_w = string_width(str),
string_h = string_height(str),
ltx = start_x - x_buffer,
lty = start_y + (yy * y_buffer),
rxx = ltx + xo - string_w ,
ryy = lty - (string_h * 0.6); //0.6 change this value if the rectangle around the string does not match
vertically
// This creates a collision rectangle around the strings, and when you hover over one of them,menu_option[page] will change selected item.
if (point_in_rectangle(mouse_actual_x, mouse_actual_y, rxx, ryy, rxx + string_w, ryy + string_h))
{
menu_option[page] = yy;
}
yy++;
}
// I advise you to draw the rectangle on the screen to understand the real position of the collisions.
//var c = c_white;
//draw_rectangle_color(rxx, ryy, rxx + string_w, ryy + string_h, c,c,c,c, true);
Sorry my English, I hope this can help. Thank you FriendlyCosmonaut! Bye all!
are you sure it properly work?
You are my new favorite GM youtuber. This is by far one of the best practical tutorials I have seen. Thank you so much.
edit* I actually have not switched to GM:2 yet but I am really thinking about it now.
Hey thank you! I really prefer GMS2. I'm finding it really jarring to open GMS1 now: it feels so clunky!
This was really helpful! I often have trouble using ds grids because I'm not very good at maths, but you laid them out in such a clear manner that they make a lot more sense to me now
I really enjoy your organization/explanation of the concept behind the ideas. The chart on excel was very easy to grasp/adapt and utilize after getting started
Also, the height clarifying endcap inside your enum was exactly why you need subs
I love your videos because your teaching style is very visual with your charts and diagrams combined with awesome explanations. I had never seen an array provided as an argument like you did for the script in Game Maker. Like always, I learned a new way to use Game Maker. Thanks for your hard work and sharing your knowledge!
Thanks so much for the kind comments! Good luck on your gamedev learning journey :)
GREAT TUTORIAL! It really put me off to start a game not knowing how to make a menu.
Btw, thank you for putting the camera closer/zomming in. Some of your other videos are really difficult to watch
when I have a half the screen for the video and the other half with game maker. This reads perfect!
Love from Mexico.
Thanks so much, I'm glad it helped! Yeah, most of my earliest videos don't have any zooming unfortunately - lately I've been remembering to increase the font size, at least.
Thank you. This was exactly what i was looking for!
Well coded and very organized as clean as it can get.
Such a proper way of using enum and DS. (if i would make a menu would make sure to use these features, you just showed me how and clarified things out, thank you soo much for this).
That's one of your wonderful tutorials. You explained systems so clearly. Quests, dialog, menus... Please make more of such systems tutotirals.
Exactly what I was looking for. Coming from Javascript/NodeJS Background I really needed to see an idea of the basic workflow of GameMaker ... reeeealllly helpful thanks @FriendlyCosmonaut !
Hey, FriendlyCosmonaut just saw a few videos from you, and its easy to see how hard are you working to upload the most refined content that you can do, and thats amazing! i'm thinking about patron your work at this moment! Keep up this amazing work please! Love it! Greetings!
Thanks so much! I'm really enjoying making these tutorials. That's really kind of you to say. Though don't feel obligated; I know most of us are wearing the same shoes as self-funded indies :). Hopefully I see you around!
I was watching this like, "OK, yep, gotcha, makes sense. Hmmm...well that escalated quickly!" I'm going to have to come back later when I understand some of these things better. Still very well done.
Thank you! Yeah it's definitely a more intermediate/advanced tute. Still though, it might be my fault if I haven't explained something well enough. Can I ask which part lost you?
13:53 when suddenly you have a ds grid containing a script containing an array containing enums. This isn't your fault, I just don't know anything about ds grids or arrays, and I haven't yet started using scripts that take arguments. I understand the basic concept of an array, but I'm not at the point where I'm fluent enough to start using them to solve problems or organize things.
Ironically I already have an options menu containing most of these things (and it works!)- volume/sfx sliders, vsync and fullscreen toggles and configurable controls for keyboard and gamepads that save and load from an ini file. I just set the menu up in a basic way that works with my current skills. I'm making a point to not include any code in my game that I didn't write and don't understand so I actually learn how to do things.
Ah that makes sense, thank you for the feedback. That's great if you already have a working menu - if it works and does what you need, then you needn't look any further! Definitely a good policy to only put in code you fully understand.
Thanks for advices and helps! I will be sure to keep this in mind!
Happy to see your list of patreon supporters growing :) Big thanks to all involved!!!
I usually dread the menu portion of my game... now im looking forward to this!
Thanks!
ive been looking for videos like this a looong time and only found heartbeast and shaun videos but yours are amazin as well! and even more detailed! keep on making videosl like this, its like the core things we all need and almost NO ONE gives good content, tutorials or at least help with this things in GMS2! ;(
Cheers, I'm really glad you've found them so useful! :)
I started to see your videos just yesterday and you're becoming one of my favorite game maker's youtuber!
Thank you very much! I hope they help you :)
man this is so organized
ikr
Nice tutorial! Very clear and organized.
For anyone with complex menu systems >> at 22:40 there's use of a loop inside a loop, if you're familiar with bigO-notation || data-structures&algorithms you'll know nested loops are considered very slow processes.
Perhaps someone could enlighten me? I'm looking for a more efficient way to render a large complex menu with many rows and columns ~ I'm trying to create an IDE/Code-editor for a programming game in the style of 'Papers Please' ~ would really appreciate any advice :)
Loved the video! Awesome in-depth analysis on menu's in GameMaker ❤
thank you for infromation Friendly Cosmonaut :)
Thank you :D, I need to sharpen up my code using your ideas.
Fantastic video! Great style, clear explanations, valuable and unique content. Subbed!
Cheers! :)
The height thing. Brilliant.
Will this work in the original gamemaker studio since i only have that version?
Hi, I really love how you take your time to really explain each step of the process. You give me confident to go on my first serious "game" ( More like an alpha with no graphisme and animation but with fonctional turn per turn battle, a fantastic open world (3 dungeons and 1 city) and a cut-scene for basique story .
Awesome)))You'll be credited in titles screen of my game =))) Best tutorial.
Haha, glad you enjoyed it!
Wow really great menu system! Great work
You should clear the Grid (19:40) with 'undefined' so you can always check for an undefined value and json_encode() saves these as "null". Otherwise the grid is filled with 0 and so it is saved and loaded as a 0 which is hard to track.
Can you show how you code this please ?
Can you still do functions with variable amount of arguments with how scripts have changed so they have the thing(){ } added? How?
I'm a bit confused with the debug. I can't see any instances there, but I noticed you're looking at the Menu step event in the video. Before the debug, the video ended with the menu object only having Create and Clean Up events. Did I miss something and should have a step event somewhere?
Thanks!
I don't think we went into the Step event in this tutorial - it's possible I actually ran that in another project that was displaying code from the next tutorial. If you can't see any instances in the tab, it may be that you haven't pressed "pause" on the debugger
Yeah, I've been pausing it. I went ahead in the next video a bit too and the Draw GUI event isn't working either so I must have messed the code up somewhere. I'm not getting any errors and and went through the video a second time, so I guess I'll try it a 3rd later.
Ah! I'm an idiot. I just never dropped the object into the room.
Ahh! Haha, I'm glad you solved it :)
Even after following the complete tutorial, I'm getting an error that states "The function 'create_menu_page' takes no more than 0 arguments but 2 are provided." Any advice or tips on how to resolve the error?
Try read the feather documentation, there show one way to ignore this error
With respect to controls it gets a bit more complicated if you set multiple options for the controls. For example (ARROW KEYS, WASD, and gamepad). left_key = keyboard_check(vk_left) || keyboard_check(ord("A")) || (gamepad_button_check(0,gp_padl) > 0); I was thinking you could do something like primary_left = secondary_left || tertiary_left. The real problem comes with setting those (to many screens). Maybe it should just be simpler: keyboard controls | gamepad controls?
would love to know this
thanks for the help. your videos give us so much help
Any know why I'm getting the following error ?
ERROR at line 40 pos 6: Unexpected symbol in expression. Also im using gms 1.x
Line 39: ds_menu_main = create_menu_page(
Line40 ["RESUME", menu_element_type.script_runner, resume_game],
Line41 ["SETTINGS", menu_element_type.page_transfer, menu_page.settings],
Line42 ["EXIT", menu_element_type.script_runner, exit_game],
);
it also does ths for all of the others such as ds_settings, ds_menu_audio
Ah, it's because you can't declare arrays with the square brackets in GMS 1. You can create a script that will allow you to create arrays in a similar way though:
Create a script and call it create_array. In it, put:
///create_array(val1, val2...)
var arg = 0, i = 0, arg_count = argument_count;
repeat(arg_count){ arg[i] = argument[i]; i++; }
return arg;
///
So instead of putting the square brackets, you'd have to put: ( create_array(arg1, arg2), create_array(arg3, arg4) ). You could call the script something else if writing "create_array" is annoying!
Hope that makes sense.
Perfect xD thanks for sorting that.
This is what my v.2.3.0 create_menu_page script looks like if it helps anyone.
function create_menu_page() {
// Creating the grid
var ds_grid_id = ds_grid_create(5, argument_count);
// Assigning elements from array to the grid.
var i = 0;
repeat(argument_count) {
var array = argument[i];
var array_len = array_length_1d(array);
var xx = 0;
repeat(array_len) {
ds_grid_id[# xx, i] = array[xx];
xx++;
}
i++;
}
return ds_grid_id;
}
oh thanks god
I'm not sure if you'd even need that anymore, you can just probably use an array with arrays inside of it.
Like
array_main = [
["Resume", menu_ET.script_runner, resume_game],
["Settings", menu_ET.script_runner, menu_page.settings]
];
This fixed my problem, thank you so much
OMG THANK YOU SO MUCH!!!! i was stuck like 2h! :D
Your a hero, thanks man
what should I do
34ds_menu_main = create_menu_page(
35 ["RESUME", menu_element_type.script_runner, resume_game],
36 ["SETTINGS", menu_element_type.page_transfer, menu_page.settings],
37 ["EXIT" menu_element_type.script_runner, exit_game]
38);
39
40 ds_settings = create_menu_page(
41 ["AUDIO", menu_element_type.page_transfer, menu_page.audio],
42 ["DIFFICULTY", menu_element_type.page_transfer, menu_page.difficulty],
43 ["GRAPHICS", menu_element_type.page_transfer, menu_page.graphics],
44 ["CONTROLS", menu_element_type.page_transfer, menu_page.controls],
54 ["BACK", menu_element_type.page_transfer, menu_page.main],
Object: menu Event: Create at line 41 : got 'menu_element_type' expected ',' or ']'
Object: menu Event: Create at line 41 : got 'menu_element_type' expected ']'
Object: menu Event: Create at line 41 : got 'menu_element_type' expected ',' or ')'
Object: menu Event: Create at line 41 : got 'menu_element_type' expected ')'
Object: menu Event: Create at line 38 : malformed assignment statement
It won't show up as an instance when I run the debug.
I thought maybe I needed to set the object in the room under an instance layer, but that doesn't do anything but show the location of said object.
I don't know which step I missed, but I've watched this over a few times and I feel more like an idot every time I go through checking to see what I screwed up on.
That's odd - you've definitely placed it in the room? It shouldn't matter what layer it's on. Is there any reason it would be deleting itself?
I have no idea how I missed it, but I spelled height and view like an idiot 3 times and so I guess it wasn't even running the object. Idk how it didn't send me an error or what happened, but I dropped GMS for a little while because school started, and then came back to that mess.
It works now.
I appreciate you making these tutorials and responding.
I'm sorry I got back so late.
The instance still doesn't show, but I can physically see it in the preview.
I need to relearn everything again anyway. I'll mention something if I get a solution other than double checking spelling mistakes.
i have the same issue
fixed it, its in all instances not just instances
Hi there, I am a professional software engineer who decided I wanted to get into game dev. Can I ask why some variables are declared with var like "i" and "ds_menu_main" is not declared with var? Is this a code style thing and GML is flexible or is var only for stack-allocated types and skipping var is for objects/heap-allocated types. What is the deal exactly?
It's the difference between global, local and (I'm not sure the exact name) code variables.
Globals can be initiated anywhere are are saved forever, regardless if that object is destroyed or there is a room change
That is the 'global.number = 2 format.'
It's good for info you will need throughout the entire game, like what key is up.
object variables are usually established in a create event and are saved as long as that object exists.
That is when just say 'ds_menu_main = whatever' format.
It's good for info an object needs to remember, like the state of an enemy.
Then local 'var' variables are established with in a script, and then are forgotten when that script reaches an end.
'var number = 0' is that, if you try to use that var anywhere else other then in that specific script after you establish it, you will get an error because it's gone.
It's good for temporary calculations and such, info needed in that moment alone.
@@larryinc64 They're actually called global, object and local variables (respective to the order you listed them in)
@@coachcookie_ lol being largely self taught sometimes means you forget the 'proper' terms while understanding the base concept lol.
I edited the post so it's lot as confusing.
@@larryinc64 It's all good dude, understanding the logic is way more important than knowing the labels!
Thank you, this is very helpful!!
Great video! Can't wait for part 2
I know that you've started a new series but seeing as this is one of the better menu tutorials, do you still use DS Maps or do you now use Structs?
Thank god for this tutorial. I've been searching high and low on UA-cam for a good menu tutorial and this one is not only the best and most detailed, but it has single handedly made programming as a whole feel so much easier. Thank you and keep doing what you're doing. Do you have any online courses or is your UA-cam your main stuff?
Thanks so much! Yes UA-cam is my hub of content creation, I don't have any courses elsewhere. But thank you for the interest!
Hi I did the guide correctly.
But in some of the global variables it shows me that they have only been mentioned once.
How do I fix this?
I would appreciate your assistance
In GMS2 v2 .3.3.574
Thanks, I enjoy the work. Keep it UP!
hey, about the tutorial about resolution, have you done it? I wanted to put in my game but I am struggling because I am new, if you didn't, can you recommend a video to watch?
отличное решение по структурированию.
Does anyone know how to convert this code to work the same in newer versions? The script update for 2.3 messes this code up and I don't know how to fix it :/
Close to the end. for some reason in debug mode, i cannot get the option to pop up allowing me to view as a grid. None of the options light for my ds grids. I am assuming at some point it is not actually creating a grid but pretty sure the code is right.
Yes there must be something in the creating menu script. It might be something as silly as a misspelled variable. Unfortunately I can only speculate without seeing your code. If you can't find the problem, feel free to send me your project file at friendlycosmonaut@gmail.com, or take a screenshot of your create menu page script!
I think ive found the problem. Even though I hit pause the graph is showing the game is still going. It's the only difference I can find between your video and my code.
Sorry for the late reply (I've been away for a bit) - that's a little strange. Try closing the debugger and then starting debug mode again fresh?
I have the same issue did you solve it ?
Im very new to GameMaker but I found if you put the REDMARKER think its called breaker or something(by clicking the left side where the number of the code line is, it should add a red circle) in the ending line of the ds_men_main, or ds_settings, etc this line being the one where you end with " ); ", then clicking debugg then go to all Instances and yo should be able to view as ds_grid.
idk how to view it wiithout this... but i guss its a proof that it is working :)
Hello, I have a question about game maker
I would like to know if it is possible to make an interface / window system that displays long texts and images, and that contains a scroll bar to be able to show the entire text.
As if it were a web page, for example from wikipedia (besides being something that would also resemble the text document system of Resident Evil and Silent Hill. However it would not run in a specific room, it would in fact be a window that appears during the game when the player presses a button.
I would also like to know if it is possible to create a notepad system too, something very simple that the player can write down a text and that will be saved for him to check later
and lastly, is it possible to create a music player? a GUI that allows the player to choose songs and has play, restart and etc. buttons
if possible, can you give me a reference for me to search for please? and another question, is this type of functionality too advanced for a beginner or unstable for the game maker to run?
(The idea of the game involves a lot of reading texts and taking notes)
For a scroll bar, you probably draw everything with a scroll var, that starts at 0, and when you scroll down just decrease that number into the negatives and add it to the y coordinate of everything.
To show that in a window, you could probably use a surface. Draw it to a surface smaller then the screen size, and anything drawn to it outside of it's range will just not be visible.
For a notepad, there is functions for getting strings from the keyboard and saving it to whatever.
You should prob look at GMS2's official documentation for info on surfaces, strings, keyboard input, and drawing text.
Is there a method to set global.key_revert and global.key_enter, etc. to multiple keys?
I did:
*global.key_revert = ord("X") || vk_backspace;*
and it worked fine. However, when I did:
*global.key_enter = vk_space || vk_enter;*
every time I hit up or down on the keyboard, it registered it as a "key_enter" event. Seems inconsistent...
(I'm guessing it has something to do with the numerical values ascribed to certain keys by GM?)
Thank you for the tutorial! I have no idea if you or anyone is looking at the comments now, but I was wondering if and/or how this can work with Gamemaker Studios 2.3? There were changes to how scripts were and I don't believe I can make the script the same as in the tutorial. Any advice is appreciated. But I have used your tutorials for other aspects and they were great and easy to follow. I hope you make more tutorials in the future.
Really nice tutorial, FriendlyCosmonaut. Is there any chance to implement a smooth and accurate mouse control for this type of menu though? I've tried several methods but failed every time. It could be that I am just dense but I'd still appreciate a helping hand.
i don't know if this could to help you, but try to use point in rectangle, and make this rectangle around each array number you have defined for your menu to interact with them with the mouse.
@@celesteorsa3918 Since I have never heard of that function I'm quite baffled at the moment. I will look into it and see if it works. Thank you!
@@schaichhornchen6283 Hey Schaichhörnchen, I think I managed to do a mouse interaction, I maked this:
1 - ///Step event
//Mouse imput
imput_mouse_enter = mouse_check_button_pressed(mb_left);
//Confirm selected page
if (imput_enter_p) || (imput_mouse_enter)
{
switch( ds_grid[# 1, menu_option[page]] )
{
case menu_element_type.script_runner: break;
case menu_element_type.page_transfer: page = ds_grid[# 2, menu_option[page]]; break;
case menu_element_type.shift:
case menu_element_type.slider:
case menu_element_type.toggle:
case menu_element_type.imput:
//imputting = !imputting;
break;
}
//audio_play_sound(snd_pickup, 5, false);
}
2 - //Draw GUI Event
// MAKE SURE THAT THE MOUSE MOVEMENT AREA IS PROPORTIONED TO THE VIEWPORT SIZE OF THE GAME WINDOW (if you don't do this your mouse will not be accurate).
var view_x = camera_get_view_x(view_camera[0]);
var view_y = camera_get_view_y(view_camera[0]);
var view_width = camera_get_view_width(view_camera[0]);
var view_height = camera_get_view_height(view_camera[0]);
var mouse_actual_x = view_x + device_mouse_raw_x(0) * (view_width/window_get_width());
var mouse_actual_y = view_y + device_mouse_raw_y(0) * (view_height/window_get_height());
var x_buffer = 32;
var y_buffer = 64;
var start_x = gwidth/2;
var start_y = ( gheight/2 ) - ( ( ( ( ds_height-1 ) /2 ) * y_buffer ) );
var ds_grid = menu_pages[page];
var ds_height = ds_grid_height(ds_grid);
repeat(ds_height)
{
xo = 0;
if (yy == menu_option[page])
{
xo = -(x_buffer/2);
}
var str = string(ds_grid[# 0, yy]),
string_w = string_width(str),
string_h = string_height(str),
ltx = start_x - x_buffer,
lty = start_y + (yy * y_buffer),
rxx = ltx + xo - string_w ,
ryy = lty - string_h * 0.6); //0.6 change this value if the rectangle around the string does not match
vertically
// This creates a collision rectangle around the strings, and when you hover over one of them,menu_option[page] will change selected item.
if (point_in_rectangle(mouse_actual_x, mouse_actual_y, rxx, ryy, rxx + string_w, ryy + string_h))
{
menu_option[page] = yy;
}
yy++;
}
// I advise you to draw the rectangle on the screen to understand the real position of the collisions.
//var c = c_white;
//draw_rectangle_color(rxx, ryy, rxx + string_w, ryy + string_h, c,c,c,c, true);
Sorry my English, I hope this can help. Bye!
i want to move the text a bit to the right when i select it, not only make it change color. i tried drawing it a bit further but it just draws it over the first one. Help!
Hey, Im 6 years late to this tutorial, but in the scripting section, you use a nested repeat loop. I've been trying to write it as a for loop as I'm more used to those.
Would there be any issue using this in place of it?
" //loop through arrays, store menu data in ds_grid
for(var xi = 0; xi < array_length(arg); xi++)
{
var array = arg[xi];
var array_len = array_length(array);
for(var yi = 0; yi < 5; yi++)
{
ds_grid_id[# xi, yi] = array[yi];
}
}
"
I tried it, but it doesn't work
Correction: I forgot to put the obj in the room
Would this still work with modern Gms2? I followed a tutorial similar to this recently and it done nothing.
Hi there, you probably don't check these comments anymore, but two things.
1) First, I wanted to thank you for all the tutorials you've put up. Your manner of explaining things really works for me and I appreciate the time and effort you put into these.
2) I'm new to Gamemaker Studio and this is probably a stupid question, however, when I run the debugger and press the Pause/Break button, my game doesn't actually seem to pause. The button depresses like you'd expect and stays so, but unlike yours in the video I can still see my framerate changing which indicates to me it's not paused. Do you have any idea why this would be the case?
#metoo
I'm having the EXACT same issue as you! I tweeted FC to see if she could help and seems to be on the case!
same here, was looking at comments to see if there was already an answer...
15:02 is my spot
phenomenal tutorial, far too complicated for me to implement into my tiny little game, but thank you for the information regardless. The 10 people who disliked it have to be too thick to understand because this is impossible to genuinely dislike, its honestly just too good.
Ik this video came out awhile ago but I’m new to coding so I have no clue what I’m doing wrong. I pretty much copied the code but when I open up the debugger and go to the object the values just don’t match the ones in the tutorial. Help?
Did you tried this: 26:45 ?
I'm currently trying to make the menu element shift dynamic,
Because I have a max_zoom variable for the screen resolution that changes.
So I've setup an array called zoom[i] and each increment of zoom[i] contains a different string simply called X1, X2, X3, etc until it reaches max_zoom.
When it works the player should be able to select their desired zoom amount,
But I've no idea how to actually input this into the fifth argument of create_menu_page, so I was wondering does anyone know how to do this?
Anyone that needs help with this issue, my qeustion has been answerd here:
www.reddit.com/r/gamemaker/comments/97y3uj/changing_the_size_of_a_menu_selection_option/
May be I didn't get all good but my menu_option is the same as my menu_page so what's the use to create it any way ?
Thx for video bye the way
Thanks ;) I realy enjoy your voice and video :D
Hey FriendlyCosmonaut,
I've been following your farming tutorial and run into a little bit of a problem with the menu now.
My DS grids for farming and the menu's are having the same values now and are bothering each other,
so now my menu is using the DS grid for the crop data and ofcourse that isn't supossed to happen, but I'm not quite sure how to fix it.
So I was wondering if you could point me in the right direction to solve this problem?
Here's the error game maker gives me:
FATAL ERROR in
action number 1
of Other Event: Room End
for object con_crops:
unable to convert string "Audio" to int64
at gml_Object_con_crops_Other_5 (line 25) - ds_crop_data[# 2, slot] = inst.crop_type;
Hey honestly this looks like a tough one.
I'd guess some of the maps aren't being destroyed/updated properly, as you said they were sharing values (that should NOT be happening!). If the menu works fine when the other grids aren't there (you could test this by moving the menu system to a different room and not putting the crop etc objects in there), then the culprit must be the crops. From there I could only suggest looking over those sections again and ensuring everything is getting destroyed and saved as it should be.
@@FriendlyCosmonaut The culprit was definitly the crops, I forgot the place a curly brace properly for the room check in the con_crops(crop controller) room end event.
Thank you so much for pointing me in the right direction!
@@DarkzFlame I seem to be having the same error but it seems to be conflicting with FriendlyCosmonaut's
Depthgrid system. I've been looking if i messed up curly braces anywhere in the depthgrid system but I can't seem to find anything. I don't suppose you could tell me a bit about how you went about debugging this issue could you? Thanks heaps
@@BrentBruthaa Personally I haven't had the need to implement the Depthgrid system, so I have no idea how it works so far.
As for how I found the bug, I kinda forgot, but now I would use the built in debugger and go line by line and see if the code behaves weirldy.
Also make sure that you didn't set your ds grids to 0 as Friendly Cosmonaut coverd in part 9 of the farming series instead set the ds grids at -1.
Assuming that is uses data structures, the same might also apply to ds_lists.
@@DarkzFlame Dude! You're a legend! I set my ds_depthgrid to -1 from 0 and it's not conflicting anymore. Thanks heaps man. And thanks FC for the tutorial.
Love your vídeos!
can i use the ds_menu in gms 1.x ?
Yes, I'm pretty sure data structure functions are all the same in 1 and 2.
will give it a bash :D
I really wonder how you or anyone else can make such system, you really have to be a genious/professor to find all these solutions to organise everthing so good, it cant be only prelearned procedures from a book that you execute.
I acctually wonder did you learn this yourself, or what kind of education provides you the skills to make your own complex systems?
Great one thanks i really needed this
Can you please upload the project files so we can open it and pick it apart to learn from it better. Thanks
Any reason why I shouldn't be able to group arguments like in the video? my_function( [arg1, arg2], [arg2, arg3] ) isn't working for me. I'm on GM:Studio 1 but I'm really hoping that's not why. Great series btw, I've been meaning to thank you for your great content for a while. It's clear how much effort you put into visualizing and clarifying advanced concepts, and I, for one, totally appreciate it :)
Thank you! Unfortunately GMS1 doesn't let you declare arrays like this, so I'd suggest making a script that allows you to do something similar. We can call this script create_array. In it, put:
///create_array(val1, val2...)
var arg = 0, i = 0, arg_count = argument_count;
repeat(arg_count){ arg[i] = argument[i]; i++; }
return arg;
So instead of putting the square brackets, you'd have to put: ( create_array(arg1, arg2), create_array(arg3, arg4) )
Or of course you could call the script something else to try and reduce the clutter this introduces!
Ahhhh, haha funny story :)
I saw TMCicuurd's comment below about returning 'arg', and also earlier comments by other people using GM:S 1.4 who had problems, and I realized I'd have to come up with a work-around. So I spent a not-so-insignificant amount of time going about it a slightly unusual way. I basically added every argument separately without the [ brackets ], and made sure there were 5 entries in every menu_page (filling in blanks with "-1"). From there I could just create an array based on the number of arguments I had divided by 5, and assuming I had filled everything out correctly (I added an error check to make sure), it seemed to be an effective band-aid.
I got it all working nicely and decided to save before heading to your next tutorial...
Buuut, big mistake. The classic bug that seems to be plaguing the saving functionality of GM:S 1.4 was back at it again, and all of the data files I had for my entire project were removed from the game. This wasn't my first rodeo, so I had backups, but unfortunately I lost all progress made over the past few hours. Usually I just get back on the horse, but this was the final straw. Your tutorial, combined with my laborious attempts to band-aid the game engine's antiquity, made a compelling argument for never using GM:S 1.4 again, and I eventually just bit the bullet and bought GMS 2.
I'm about an hour in and already I can't imagine myself without it. What a sight for sore eyes.
TL;DR: Thank you very much for your helpful reply, as, if nothing else, it has helped to confirm my decision to buy GMS 2. I look forward to the next menu vid! Happy holidays :)
What's the point of doing arg[i] = argument[i]? Why not just use argument[i]?
yes, I'm also curious about that
By golly this is fantastic
i really like your content!
Could you make a video of melé attacks please.
could you do i tutorial on how to make a visual novel type thing
thanks a lot, from Brazil!!
BR kkk é nois
BR
Could you give us the excel file please?
Ah sorry, I made that just for recording the video! (I deleted it afterwards)
Hey, FriendlyCosmonaut, I love your videos and I have learned so much from them! Now I know I'm probably late to the party by about 2 years, but hopefully you could help me. I follow your tutorials pretty much to the letter but I still try my best to understand the content to apply to future games. I seem to have ran into a road bump, I can move on to the next page. I have taken a look at the other comments and have re watched your videos to see if I missed something but I can't find what I'm missing. Any suggestions?
Oops it looks like a responded to the wrong video
I'm sorry if this is irritating, especially since this project is pretty big, but i have a small doubt.
So essentially I'm using GMS 1.4.x, but the square brackets don't work so i decided to create arrays another way,I don't know if this will work, but could anyone please check this out.
//CREATE MENU PAGES
ds_menu_main = create_menu_page(
array["RESUME", menu_element_type.script_runner, resume_game],
array["SETTINGS", menu_element_type.page_transfer, menu_page.settings],................................etc
)
Thanks if anyone helps.
EDIT: I did see the comment on making a script create_array, but every time I use it I still get an error but when I did the above code there were no errors, maybe this is because I'm implementing the code wrongly. If the aforementioned code doesn't work properly could anyone tell me how to implement that code: ( create_array(arg1, arg2), create_array(arg3, arg4) )
another way i did it is by doing it according to this forum:
forum.yoyogames.com/index.php?threads/initialize-an-array-in-one-line.4232/
The end result:
ds_menu_main = create_menu_page(
array("RESUME", menu_element_type.script_runner, resume_game),
array("SETTINGS", menu_element_type.page_transfer, menu_page.settings),
array("EXIT", menu_element_type.script_runner, exit_game)
);
NOTE: the function array in this code is a script with the code of Salvakiya, unlike last time where it wasn't a script. Any help on which is correct would help.
This is correct! You do need "array()" to be a script that is going to take in your inputs as arguments, shuttle them into an array, and then return its ID.
Thank you so much for your help. I wanted to replicate this menu because it's so good. Keep up the good content.
Not to brag but I'm a smart man
but this is kinda complicated XD
I'll probably learn it over time
lel ok, smart man
After you see the little 's'es in the menu fonts zeros you can't unsee them...
Thank you!!!!
10:24
Super!!!
Slow down holy crap!
take notes
FIRST!
zu alt