Organising Data | Menus: GMS2 [P1]

Поділитися
Вставка
  • Опубліковано 18 гру 2024

КОМЕНТАРІ •

  • @bob80808
    @bob80808 6 років тому +71

    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!

    • @bowenlayne3363
      @bowenlayne3363 3 роки тому

      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!

    • @axlalbert6689
      @axlalbert6689 3 роки тому +1

      @Bowen Layne Instablaster :)

    • @bowenlayne3363
      @bowenlayne3363 3 роки тому

      @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.

    • @bowenlayne3363
      @bowenlayne3363 3 роки тому +1

      @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

    • @axlalbert6689
      @axlalbert6689 3 роки тому

      @Bowen Layne No problem :)

  • @jkempe3093
    @jkempe3093 6 років тому +48

    *clicks on video, "its only 28 minutes long"* 2 hours of pausing later, "wow im done", *realises theres anther part*, *universe implodes*

  • @celesteorsa3918
    @celesteorsa3918 4 роки тому +25

    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!

    • @abesses6630
      @abesses6630 3 місяці тому

      are you sure it properly work?

  • @mcKrawll
    @mcKrawll 7 років тому +23

    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.

    • @FriendlyCosmonaut
      @FriendlyCosmonaut  7 років тому +4

      Hey thank you! I really prefer GMS2. I'm finding it really jarring to open GMS1 now: it feels so clunky!

  • @Acreedah
    @Acreedah 6 років тому +1

    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

  • @LspRevenge
    @LspRevenge 6 років тому +1

    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

    • @LspRevenge
      @LspRevenge 6 років тому +1

      Also, the height clarifying endcap inside your enum was exactly why you need subs

  • @burteetee5063
    @burteetee5063 6 років тому +1

    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!

    • @FriendlyCosmonaut
      @FriendlyCosmonaut  6 років тому

      Thanks so much for the kind comments! Good luck on your gamedev learning journey :)

  • @souleater1109
    @souleater1109 7 років тому +2

    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.

    • @FriendlyCosmonaut
      @FriendlyCosmonaut  7 років тому

      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.

  • @ykyjohn
    @ykyjohn 6 років тому +5

    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).

  • @federicopanichi2805
    @federicopanichi2805 4 роки тому

    That's one of your wonderful tutorials. You explained systems so clearly. Quests, dialog, menus... Please make more of such systems tutotirals.

  • @Superturds
    @Superturds 6 років тому +2

    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 !

  • @JefeArcadios
    @JefeArcadios 7 років тому +30

    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!

    • @FriendlyCosmonaut
      @FriendlyCosmonaut  7 років тому +5

      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!

  • @chadcoyle
    @chadcoyle 7 років тому +1

    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.

    • @FriendlyCosmonaut
      @FriendlyCosmonaut  7 років тому

      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?

    • @chadcoyle
      @chadcoyle 7 років тому

      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.

    • @FriendlyCosmonaut
      @FriendlyCosmonaut  7 років тому

      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.

  • @sunguestartdev5734
    @sunguestartdev5734 2 роки тому

    Thanks for advices and helps! I will be sure to keep this in mind!

  • @1wolfcubb
    @1wolfcubb 7 років тому

    Happy to see your list of patreon supporters growing :) Big thanks to all involved!!!

  • @ericjames8765
    @ericjames8765 7 років тому +1

    I usually dread the menu portion of my game... now im looking forward to this!
    Thanks!

  • @Ninololcss
    @Ninololcss 7 років тому +2

    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! ;(

    • @FriendlyCosmonaut
      @FriendlyCosmonaut  7 років тому

      Cheers, I'm really glad you've found them so useful! :)

  • @NightmarexismHD
    @NightmarexismHD 7 років тому

    I started to see your videos just yesterday and you're becoming one of my favorite game maker's youtuber!

  • @aurcereal9046
    @aurcereal9046 6 років тому +4

    man this is so organized

  • @ktisistoukuriou
    @ktisistoukuriou 6 років тому

    Nice tutorial! Very clear and organized.

  • @jacksontriffon5064
    @jacksontriffon5064 3 роки тому +2

    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 ❤

  • @MrKoltuk
    @MrKoltuk 3 місяці тому

    thank you for infromation Friendly Cosmonaut :)

  • @falseknight4371
    @falseknight4371 7 років тому +1

    Thank you :D, I need to sharpen up my code using your ideas.

  • @grymmjack
    @grymmjack 6 років тому

    Fantastic video! Great style, clear explanations, valuable and unique content. Subbed!

  • @Mearrin69
    @Mearrin69 4 роки тому

    The height thing. Brilliant.

  • @Schorling
    @Schorling 6 років тому

    Will this work in the original gamemaker studio since i only have that version?

  • @bacrawilder5387
    @bacrawilder5387 5 років тому

    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 .

  • @SammyWellandOff
    @SammyWellandOff 6 років тому +1

    Awesome)))You'll be credited in titles screen of my game =))) Best tutorial.

  • @tahaal-asadi7070
    @tahaal-asadi7070 7 років тому

    Wow really great menu system! Great work

  • @yokmp1
    @yokmp1 5 років тому

    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.

    • @TheXsias
      @TheXsias 5 років тому

      Can you show how you code this please ?

  • @dannyglover8217
    @dannyglover8217 3 роки тому +1

    Can you still do functions with variable amount of arguments with how scripts have changed so they have the thing(){ } added? How?

  • @jamesloymartin
    @jamesloymartin 6 років тому +2

    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!

    • @FriendlyCosmonaut
      @FriendlyCosmonaut  6 років тому +1

      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

    • @jamesloymartin
      @jamesloymartin 6 років тому

      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.

    • @jamesloymartin
      @jamesloymartin 6 років тому +3

      Ah! I'm an idiot. I just never dropped the object into the room.

    • @FriendlyCosmonaut
      @FriendlyCosmonaut  6 років тому

      Ahh! Haha, I'm glad you solved it :)

  • @umbersharkgaming
    @umbersharkgaming Рік тому +1

    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?

    • @lksxxtodin5292
      @lksxxtodin5292 Рік тому

      Try read the feather documentation, there show one way to ignore this error

  • @chaslinux
    @chaslinux 4 роки тому +2

    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?

  • @trondu4797
    @trondu4797 5 років тому

    thanks for the help. your videos give us so much help

  • @peal9256
    @peal9256 6 років тому +1

    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

    • @FriendlyCosmonaut
      @FriendlyCosmonaut  6 років тому +4

      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.

    • @peal9256
      @peal9256 6 років тому +1

      Perfect xD thanks for sorting that.

  • @BekaRuth
    @BekaRuth 3 роки тому +15

    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;
    }

    • @misticloud_real
      @misticloud_real 3 роки тому

      oh thanks god

    • @larryinc64
      @larryinc64 3 роки тому

      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]
      ];

    • @lambofdawn
      @lambofdawn 3 роки тому +1

      This fixed my problem, thank you so much

    • @hannesdorbath861
      @hannesdorbath861 2 роки тому

      OMG THANK YOU SO MUCH!!!! i was stuck like 2h! :D

    • @helix4267
      @helix4267 2 роки тому

      Your a hero, thanks man

  • @zirioosweb7732
    @zirioosweb7732 5 років тому +2

    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

  • @BlondeCanaqwert
    @BlondeCanaqwert 6 років тому +1

    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.

    • @FriendlyCosmonaut
      @FriendlyCosmonaut  6 років тому

      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?

    • @BlondeCanaqwert
      @BlondeCanaqwert 6 років тому

      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.

    • @BlondeCanaqwert
      @BlondeCanaqwert 6 років тому

      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.

    • @jkempe3093
      @jkempe3093 6 років тому

      i have the same issue

    • @jkempe3093
      @jkempe3093 6 років тому

      fixed it, its in all instances not just instances

  • @AlexanderEndless
    @AlexanderEndless 3 роки тому +1

    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?

    • @larryinc64
      @larryinc64 3 роки тому +1

      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_
      @coachcookie_ 3 роки тому

      @@larryinc64 They're actually called global, object and local variables (respective to the order you listed them in)

    • @larryinc64
      @larryinc64 3 роки тому +1

      ​@@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.

    • @coachcookie_
      @coachcookie_ 3 роки тому

      @@larryinc64 It's all good dude, understanding the logic is way more important than knowing the labels!

  • @ChrisCats
    @ChrisCats 2 роки тому

    Thank you, this is very helpful!!

  • @LifeAfterBreakfast
    @LifeAfterBreakfast 7 років тому

    Great video! Can't wait for part 2

  • @g-bigness3849
    @g-bigness3849 7 місяців тому

    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?

  • @CoolGuyAtlas
    @CoolGuyAtlas 7 років тому

    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?

    • @FriendlyCosmonaut
      @FriendlyCosmonaut  7 років тому +1

      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!

  • @eshels2288
    @eshels2288 3 роки тому

    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

  • @andrekohli3785
    @andrekohli3785 6 років тому

    Thanks, I enjoy the work. Keep it UP!

  • @gabrielcardoso785
    @gabrielcardoso785 2 роки тому

    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?

  • @dimusikus
    @dimusikus 2 роки тому

    отличное решение по структурированию.

  • @p0m_p0m61
    @p0m_p0m61 4 місяці тому

    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 :/

  • @mcKrawll
    @mcKrawll 7 років тому

    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.

    • @FriendlyCosmonaut
      @FriendlyCosmonaut  7 років тому

      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!

    • @mcKrawll
      @mcKrawll 7 років тому

      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.

    • @FriendlyCosmonaut
      @FriendlyCosmonaut  7 років тому

      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?

    • @clementduale7337
      @clementduale7337 7 років тому

      I have the same issue did you solve it ?

    • @xXH3eberXx
      @xXH3eberXx 6 років тому

      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 :)

  • @lcardi5128
    @lcardi5128 3 роки тому

    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)

    • @larryinc64
      @larryinc64 3 роки тому

      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.

  • @Atma505
    @Atma505 6 років тому

    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...

    • @Atma505
      @Atma505 6 років тому

      (I'm guessing it has something to do with the numerical values ascribed to certain keys by GM?)

  • @nikolinfield2139
    @nikolinfield2139 4 роки тому

    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.

  • @schaichhornchen6283
    @schaichhornchen6283 4 роки тому

    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.

    • @celesteorsa3918
      @celesteorsa3918 4 роки тому +1

      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
      @schaichhornchen6283 4 роки тому

      @@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!

    • @celesteorsa3918
      @celesteorsa3918 4 роки тому

      @@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!

  • @CursedUkiku
    @CursedUkiku 5 років тому

    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!

  • @DrStupid87
    @DrStupid87 Місяць тому

    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];
    }
    }
    "

  • @feldsperling6907
    @feldsperling6907 4 роки тому +1

    I tried it, but it doesn't work

    • @feldsperling6907
      @feldsperling6907 4 роки тому

      Correction: I forgot to put the obj in the room

  • @fabledbagel2392
    @fabledbagel2392 Рік тому

    Would this still work with modern Gms2? I followed a tutorial similar to this recently and it done nothing.

  • @Kyt2024
    @Kyt2024 6 років тому +1

    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?

    • @advmblake
      @advmblake 5 років тому

      #metoo

    • @advmblake
      @advmblake 5 років тому

      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!

    • @2005Pandy
      @2005Pandy 5 років тому

      same here, was looking at comments to see if there was already an answer...

  • @jonasjaggard976
    @jonasjaggard976 4 роки тому

    15:02 is my spot

  • @aorn8437
    @aorn8437 4 роки тому

    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.

  • @Will-ei2jz
    @Will-ei2jz 5 років тому

    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?

    • @yokmp1
      @yokmp1 5 років тому

      Did you tried this: 26:45 ?

  • @DarkzFlame
    @DarkzFlame 6 років тому

    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?

    • @DarkzFlame
      @DarkzFlame 6 років тому

      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/

  • @francoisrodari3795
    @francoisrodari3795 5 років тому

    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

  • @dmmr69
    @dmmr69 6 років тому

    Thanks ;) I realy enjoy your voice and video :D

  • @DarkzFlame
    @DarkzFlame 5 років тому

    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;

    • @FriendlyCosmonaut
      @FriendlyCosmonaut  5 років тому +2

      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.

    • @DarkzFlame
      @DarkzFlame 5 років тому

      @@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!

    • @BrentBruthaa
      @BrentBruthaa 5 років тому

      @@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

    • @DarkzFlame
      @DarkzFlame 5 років тому

      @@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.

    • @BrentBruthaa
      @BrentBruthaa 5 років тому +1

      @@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.

  • @lksxxtodin5292
    @lksxxtodin5292 Рік тому

    Love your vídeos!

  • @peal9256
    @peal9256 7 років тому

    can i use the ds_menu in gms 1.x ?

    • @FriendlyCosmonaut
      @FriendlyCosmonaut  7 років тому

      Yes, I'm pretty sure data structure functions are all the same in 1 and 2.

    • @peal9256
      @peal9256 7 років тому

      will give it a bash :D

  • @RKCYOUTH
    @RKCYOUTH 2 роки тому

    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?

  • @MetaHootOriginals
    @MetaHootOriginals 7 років тому

    Great one thanks i really needed this

  • @jasonmiller7223
    @jasonmiller7223 3 роки тому

    Can you please upload the project files so we can open it and pick it apart to learn from it better. Thanks

  • @supernaturalcow5604
    @supernaturalcow5604 7 років тому

    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 :)

    • @FriendlyCosmonaut
      @FriendlyCosmonaut  7 років тому +2

      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!

    • @supernaturalcow5604
      @supernaturalcow5604 7 років тому

      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 :)

  • @nabilandadamslaboratory3422
    @nabilandadamslaboratory3422 6 років тому

    What's the point of doing arg[i] = argument[i]? Why not just use argument[i]?

    • @2005Pandy
      @2005Pandy 5 років тому

      yes, I'm also curious about that

  • @rob3rtsayshi
    @rob3rtsayshi 6 років тому

    By golly this is fantastic

  • @qwerty.gamers8718
    @qwerty.gamers8718 6 років тому

    i really like your content!

  • @ismaelbriones3901
    @ismaelbriones3901 5 років тому

    Could you make a video of melé attacks please.

  • @user-zangetsu1848
    @user-zangetsu1848 6 років тому

    could you do i tutorial on how to make a visual novel type thing

  • @raildogameart
    @raildogameart 7 років тому +3

    thanks a lot, from Brazil!!

  • @alwinlangmann89
    @alwinlangmann89 6 років тому

    Could you give us the excel file please?

    • @FriendlyCosmonaut
      @FriendlyCosmonaut  6 років тому +1

      Ah sorry, I made that just for recording the video! (I deleted it afterwards)

  • @tastethefire8720
    @tastethefire8720 5 років тому

    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?

    • @tastethefire8720
      @tastethefire8720 5 років тому

      Oops it looks like a responded to the wrong video

  • @Sus-nn8sv
    @Sus-nn8sv 6 років тому

    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) )

    • @Sus-nn8sv
      @Sus-nn8sv 6 років тому

      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.

    • @FriendlyCosmonaut
      @FriendlyCosmonaut  6 років тому

      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.

    • @Sus-nn8sv
      @Sus-nn8sv 6 років тому

      Thank you so much for your help. I wanted to replicate this menu because it's so good. Keep up the good content.

  • @danielv.a.8303
    @danielv.a.8303 6 років тому +3

    Not to brag but I'm a smart man
    but this is kinda complicated XD
    I'll probably learn it over time

    • @DanJuega
      @DanJuega 5 років тому +1

      lel ok, smart man

  • @nikiffleser2599
    @nikiffleser2599 4 роки тому

    After you see the little 's'es in the menu fonts zeros you can't unsee them...

  • @TheBarak5000
    @TheBarak5000 7 років тому +1

    Thank you!!!!

  • @prostoshariy
    @prostoshariy 3 роки тому

    10:24

  • @honjiida
    @honjiida 6 років тому

    Super!!!

  • @alecroberts3023
    @alecroberts3023 6 років тому +2

    Slow down holy crap!

  • @harryisgamer
    @harryisgamer 7 років тому

    FIRST!

  • @Spontan_DJ
    @Spontan_DJ 2 роки тому

    zu alt