Quest System Backbone | Quest System: GMS2 [2]

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

КОМЕНТАРІ • 62

  • @SGTIvan921
    @SGTIvan921 Рік тому +2

    Timestamps for reference:
    0:06 Create an object for the quests
    0:36 Create a ds_grid called ds_quests
    1:14 How to access ds_grids
    1:31 The Setup on a spreadsheet (Matt Parker would be proud!) [Note to self: -1 refers to the "Quest Stage"]
    Note to self 2: Column 1: Quest Column, Column 2: Quest Stage, Column 3: ...I presume this refers to which specific stage we are going to refer to later on as part of that singular quest which is to "Paint Things". The rows track which quest it is.
    2:11 A quicker way of adding quests: using a var quest_array, where in this array are more arrays to insert into a new ds_grid which we can create by calling a custom script called create_ds_grid_from_array. (ds_quests = create_ds_grid_from_array(quests_array)) [Note to self: Can add more columns if I want, like if I want to show a quest has failed or succeeded or cancelled. But do that later. ]
    3:31 Making the script
    4:24 Making of script: deciding width and height of this ds_grid
    5:12 Making of script: get length of array (in this case, it will soon be quests_array) to get number of quests
    5:43 Making of script: Looping through the quests_array using repeat()
    6:34 Making of script: A good on-screen explanation/reminder
    6:40 Making of script: Using the repeat() loop
    7:12 Making of script: if your quest has more columns in some of the quests, you'll want to get the length of that specific quest array every time you run through the loop (after the first repeat, you'd put repeat(array_length_1d(array[yy])) afterwards. For this tutorial, we assume the quests all have the same 3 columns.)
    7:54 Making of script: xx refers to the column, yy refers to the row.
    8:41 A demonstration, in debug mode
    9:42 Coding the quests
    10:37 Get the height of our ds_quests grid for use in a repeat loop
    11:50 Using a switch statement inside a repeat loop - this switch statement will contain the quest logic
    12:21 Create an enum for quests
    14:13 Using the #region code, because the quest count is gonna get *REAL* long [This is super duper handy!]
    15:17 Another switch inside that quest to find out what *stage* of the quest
    15:46 Creating a local variable grid to point to the ds_quests
    16:15 Accessing the ds_grid data [Note to self: [# 1, i] means the 2nd column [1 + 1] being accessed for that specific [i] quest, which refers to the quest stage]
    16:45 Making the cases
    17:17 Getting the ID of the instance tree collided, storing it in a local variable inst
    18:13 Incrementing the quest stage
    18:41 Demonstration of the information
    19:59 Quests text will be drawn if they are active
    20:17 Check the quest stage. If != -1, then add the text
    22:00 Note to self: I could have the quest description at a separate location instead of shoving it all in one string with the title. Useful idea if I want to have like a menu to view all the quests, and the quest titles are separated from the quest descriptions.
    22:20 Clean-Up of data structures
    23:17 Demonstration of the text display
    23:51 Bonus: disabling the ability to paint the same tree
    24:08 Save the ID of that instance (myRedTree = inst;), then add the if != myRedTree at the bottom
    24:32 Painting an NPC (lol)
    24:54 Quest complete stage
    25:52 Making of quest types removes the need to hard code the quests

  • @ThiagoJaqueta
    @ThiagoJaqueta 6 років тому +11

    This will also come in handy for Achievments and Milestones. Nice tutorial!

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

    This is one of the best Gamemaker Tutorials I have ever seen! You explain such a complex thing super easy to understand. I am looking forward to more of this awesome work! Thank you very much.

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

    Hey! First attempt coding anything (really) and I just got this system to work in my top down shooter. Figured out how to assign the quest to the player from an NPC, progress through the quest line and all that. Thanks for the tutorial, it helped alot.

  • @TerrorGeneric
    @TerrorGeneric 6 років тому +11

    I haven't watched all of this yet, but I'm *_smashing that like button right now_*

  • @meatbleed
    @meatbleed 2 роки тому +1

    I knew ds grids were "like spreadsheets" but seeing one compared and labeled helped it make sense. Seeing what I visualized sort of connected it. Good tutorial, ty

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

    started watching your first tutorial series and must say you are doing a very fine job! your pedagogy is really good, and it's easy to follow along in your videos. keep up the good work

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

    Thank you for making these videos. Have helped me understand a lot of different things I want to do in my games. Stuck between a platformer and a rpg. So many kind of games that can be made :).

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

    Loved this! It is very useful!
    Thank you so much.
    Have a great day.

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

    Very very good, please never stop

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

    I absolutely love your content! i have binged every single video right now, i cant wait for more quality content to come! You are doing an amazing job!

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

      Wow, thank you! Glad to hear you have enjoyed the content - best of luck on your own projects :)

  • @millo5014
    @millo5014 6 років тому +21

    I’m sad that you stopped youtube :,(

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

      Yeah haha I'm sorry. I'm still around, just on hiatus from UA-cam for a bit while I work on personal projects. I still have ideas for videos and will be back one day. In the meantime I'm planning on doing some devlogs and being around on Twitter, if you're interested in that!

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

      I'm able to code pretty well if I say so myself, I just really like this youtube channel. I wouldn't need to have tutorials.. I just..... want to

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

      @@FriendlyCosmonaut Please come back. You are probably one of the best there is.

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

      @@meganoob9281 She's done a great tutorial for YoYo games.

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

    Very good tutorial! Also, another way to do ds_quests_number would be to use an enum. Since you're already naming the quests in an enum, you could just have the last index be something like "size". That way, if you ever want the amount of quests, you could just do quest.size; This works since enums start at 0.

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

    I'm beating myself up trying to figure this out. I have a working quest system however i can't figure out how to activate the quest within the game.
    How do I change the quest status from -1 to 0 from another object?
    I' created a collision with another NPC, but can't figure out how to update the ds_grid from the NPC. Any thoughts?

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

      Did you ever figure this out? I'm in the same boat. Not sure how to make an inactive quest go active.

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

    Great tutorial! Well explained and very versatile system. Thank you so much for your tutorials! You're helping a lot of people with them!
    Stay awesome!

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

    Is this code compatible with Game Maker Studio v1.4?

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

      It will not. You can't set up the arrays the same way.

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

      Need to define arrays:
      /// scr_array(data...);
      var _arr = -1;
      for (var i=0; i

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

      @Oatkans scr_array() is a script. The arguments become values passed to an array. The returned value from the script is the array.

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

      @Oatkans use it like this: myArray = scr_array(val1,val2,val3,etc);

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

    I didnt realized you were back! Yay! Gonna watch right now!

  • @adamjscarborough5600
    @adamjscarborough5600 2 роки тому +1

    Thanks for this video, loved it, a lot to take in as it’s quite rapid fire but all very clear.
    Any plans to continue this series?

  • @EfeKavurucu
    @EfeKavurucu 2 місяці тому

    Thanks for detailed tutorial!
    I want to ask all of you guys a thing about my grid problem. Actually i was expecting to reach my grid values like "_grid[# 0, 2]" this but i can reach my grid values (i.e. quest name which at 0) "_grid[# 0, 2][0]" like this and the first pointer is like not working. i mean if i use "_grid[# 4, 2][0]", this returns the same value with "_grid[# 0, 2][0]". Do you guys know why is this happening?

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

    Hello! Your videos have been amazing! I'm very new to programming and have been ingesting everything I can. I'm building all my own assets so my plate is full. I've started to grasp how this system works and have been playing with it in game. The problem (and I'm sure it's a total noob issue) is that my array table for displaying the current state of the actual quest is writing on top of itself. For example if stage one is "Get the key." and stage 2 is "Turn in the key", I can get case to increase to the next level but it's drawing both stages. Thanks! Great videos, I"m aiming to become a patreon member on payday!

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

      Hey - thank you! I'm glad you're enjoying the tutorials :). Hmm I think I'd have to see your code - could you post a picture or the code for your Draw GUI event?

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

      var _string = "";
      var _i = 0; repeat(ds_quests_number_) {
      var _stage = ds_quests_[# 1, _i]
      if(_stage != -1){
      var _array = ds_quests_[# 2, _i];
      _string += "
      " + ds_quests_[# 0, _i] + ": " + _array[_stage];
      }
      _i++;
      }
      draw_text_transformed(15, +125, _string, .5, .5, 0);
      draw_set_color(c_white)

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

      I fixed it! Head scratching, brain hurting, and coffee. Thanks for your initial reply!

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

      @@jondeale9604 What was the fix though? LOL

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

    I can't understand why my quests don't work:( .The problem is this - for some reason ds_quests does not occur in the debugger until I ran into an instance activating the next stage of the quest, after which ds_quests appears in the debugger and a Push error occurs :: Execution Error - Variable Index [51] out of range [4] - -7.array(100141,51)

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

    How would you save the quest stages? I know I am late... Has anyone used Shaun's saving system and mixed it with this? If so I am very interesting in hearing how!

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

    for your farming rpg inventory, how would I remove a certain item/amount, check for an item/amount and add an item/amount, i could use this for mining resources, crafting system, rewards.

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

    Hi there, I've received the following errors:
    "Object: obj_quests Event: Create at line 13 : unknown function or script create_ds_grid_from_array"
    My Code: ds_quests = create_ds_grid_from_array(quest_array);
    "Object: obj_quests Event: Step at line 6 : Case argument should be a constant"
    My Code: var i = 0; repeat(ds_quests_number){
    switch(i){
    #region PAINT HOUSES
    case quest.paint_houses:
    I don't seem to see anything out of place here, thanks for the help!

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

      The first one is saying that the script "create_ds_grid_from_array" doesn't exist, which might just be that you've called the script something else.
      The second one - that looks okay to me... the only thing I can think of is that you might have declared the enum as something else or there is a misspelling etc!

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

    Hey, I really want to use your quest system, but I'm worried about how it will interact with my save system.
    The save system uses a lot of data lists and maps inside of one another, which gets turned into a json string. From what I understand, DS grids don't work with Json, so then I'd run into a lot of problems, such as saving what position of the quest the player was in, what quests had already been finished, and so on.
    Any recommendations?

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

      You could convert your grids to rows of lists by looping through the grid row by row, and then save all of those within a "mega list" or map and save that with json. If you prefer, it might be better to tweak the tutorial and just use lists/list+map instead of the ds_grid if having a system to convert it when saving seems like too much work. Hope that makes sense!

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

      ​@@FriendlyCosmonaut I did end up converting this guide into system where a quest is a map with different lists inside it. Still working on it, a bit of a headache. I know that generally, it's best to optimize only when code starts being problematic, but I was curious about the loop that runs the quests. You're using a repeat loop, which I think are a bit faster than for loops, while I'm using a for. In theory, wouldn't the loop cause performance issues if the data structure had a lot of quests to run through?

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

    ds_quests = create_ds_grid_from_array(quest_array); CODE NOT WORKING! There is missing information in the video.

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

    HI friendlycosmonaut ! I really like your videos, it helps me a lot since i started to create my own video game. SO i'm wondering that if i can pay you for some little code for my project ? Like controller inputs, Npc dialogs(custom) etc,.. it'll really help me, thanks a lot for your answer!

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

      Hey, thank you! Sure thing, shoot me an e-mail at friendlycosmonaut@gmail.com. Those don't sound too tricky, so I may also be able to just direct you to some free resources depending on how complex a system you want :)

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

    This is probably one of the most informative and helpful Game Maker Studio 2 tutorials that I've ever seen. Would it be possible to load quest data into an array from a spreadsheet, so that they wouldn't have to be hard coded into the game? I am working on planning my first large project and I would like to get the framework complete first so that I can just focus on the creative aspect of building a game without having to jump into code every time I want to tweak something, say a reward for a quest or whether or not a quest should be grouped as a Main Quest or a Side Quest.

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

      Yes, very possible! An easy way to do this is to load spreadsheets as .csv files as there are some simple functions that convert the data to a ds_grid

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

      @@FriendlyCosmonaut Thank you, I'll probably do that and then move to JSON further in development.

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

    Can these tutorials be applied to GMS 1?

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

    your channel is awesome

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

    is this tutorial doable in gm1.4?

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

    I know you don't do this videos as often anymore but, figured I would try. 1) How would we deactivate and remove a completed quest instead of always having the message display? 2) How can we turn an inactive quest that's a -1, to a 0 in the game world? Thank you!

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

    This is really turning out super cool! Are you planning on continuing the quest system further, or moving onto something else for your next tutorial?

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

      I'll probably move on to the idea of making specific quest "types" or breaking a complex quest down to specific "elements" (gather, kill, move, collide, cutscene, etc). I'll probably start simple as I anticipate such a topic could easily span multiple videos :)
      Admittedly I am actually going to go back to working on my personal projects again so it may be a while for the next one of these to come out - nevertheless I'd like to release at least a couple on this topic in the coming months.

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

    You actually are the best!

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

    Where did u go

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

      I'm on hiatus for a bit as I'm working on my own game projects :). I'm still quite active on Twitter though and am going to release devlogs if you're interested in that side of things!

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

    Come baaaaaack! I neeeeeed you!

  • @fierorecensione5828
    @fierorecensione5828 11 місяців тому

    Thank you!

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

    Have you made a schedule ps awsome video

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

    Hi...would you like to make a video how to create more levels in one game. Thank you, lovin your vids