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
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.
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.
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
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
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 :).
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!
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!
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.
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?
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!
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?
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!
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?
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)
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!
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.
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!
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!
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?
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!
@@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?
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!
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 :)
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.
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!
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.
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!
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
This will also come in handy for Achievments and Milestones. Nice tutorial!
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.
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.
I haven't watched all of this yet, but I'm *_smashing that like button right now_*
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
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
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 :).
Loved this! It is very useful!
Thank you so much.
Have a great day.
Very very good, please never stop
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!
Wow, thank you! Glad to hear you have enjoyed the content - best of luck on your own projects :)
I’m sad that you stopped youtube :,(
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!
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
@@FriendlyCosmonaut Please come back. You are probably one of the best there is.
@@meganoob9281 She's done a great tutorial for YoYo games.
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.
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?
Did you ever figure this out? I'm in the same boat. Not sure how to make an inactive quest go active.
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!
Is this code compatible with Game Maker Studio v1.4?
It will not. You can't set up the arrays the same way.
Need to define arrays:
/// scr_array(data...);
var _arr = -1;
for (var i=0; i
@Oatkans scr_array() is a script. The arguments become values passed to an array. The returned value from the script is the array.
@Oatkans use it like this: myArray = scr_array(val1,val2,val3,etc);
I didnt realized you were back! Yay! Gonna watch right now!
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?
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?
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!
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?
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)
I fixed it! Head scratching, brain hurting, and coffee. Thanks for your initial reply!
@@jondeale9604 What was the fix though? LOL
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)
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!
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.
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!
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!
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?
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!
@@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?
ds_quests = create_ds_grid_from_array(quest_array); CODE NOT WORKING! There is missing information in the video.
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!
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 :)
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.
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
@@FriendlyCosmonaut Thank you, I'll probably do that and then move to JSON further in development.
Can these tutorials be applied to GMS 1?
your channel is awesome
is this tutorial doable in gm1.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!
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?
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.
You actually are the best!
Where did u go
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!
Come baaaaaack! I neeeeeed you!
Thank you!
Have you made a schedule ps awsome video
Hi...would you like to make a video how to create more levels in one game. Thank you, lovin your vids