I just love the way you explain things in such a way that it makes potentially difficult things easy to understand. Also, kudos for the amount of effort that you must put in each episode having to film it twice and then edit it all together for GML and DnD at the same time. Much, much respect.
@@sveninspace Haven't done any public things regarding it yet. I wanna keep it under wraps until I'm content with how it looks. But it's a different take on the "mascot horror" trend that has become so stale as of late. (Minus Shipwrecked 64, that game slapped)
For those of you wondering how Slyddar put down multiple enemies holding 'Alt', it's actually 'Right Alt', not 'Left Alt'. Just found out about it today
@@Slyddar I'm not sure if that is true back then or that they've updated using Alt's, but currently using Windows and making something right now, you can only use 'Right Alt' to put down multiple objects. 'Left Alt' now acts like a dragging of the camera/room around
I'm using the latest stable version, 2022.3.0.625. That's normally what middle mouse does. In my Preferences, Redefine Keys, 'Paint with Resource' is set to Alt. No left or right alt, so maybe your one is different.
@@Slyddar Yeah honestly quite interesting and weird, my middle mouse also does same thing, but so does my alt when I have that button and left mouse clicked for the object I want to place both at same time.
Hey, that's nice to know, I appreciate the comment. I'm editing part 5 now, so shouldn't be too much longer. Hopefully you are subscribed so you can see when it drops.
Wow, thank you!. You're my first donation through UA-cam, so it really warms my heart you've done something like that. I very much appreciate your generosity, and really hope the content helps you make a cool game! ❤
Just in case anyone runs into the same problem I did. If you have a create event in the child enemy it will override the one in the parent enemy. This caused an error telling me I had not defined the variable "path". I ran into this problem around the 23:30 minute mark of this tutorial. The solution was simple, delete the create event in the child enemy.
This video was really really useful, thanks!! Do you have any advice on how I would basically take this movement/collision and put it on a grid? So a character moves say 50 flat pixels every second, instead of continously moving?
These tutorials are great! I'm having an error pop up in my Room Start event. My variables "_w" and "_h" are not defining, and so lower under "create motion planning grid" , the program is saying "Assignment operator expected". I've skipped back and can't seem to find the issue. Please help!
Hey im working on a game and your tutorials are helping me alot. could you please make a tutorial about how to make an inventory and how characters can equip items?
Is there a way you can make the enemies avoid a tile set (tile collision) instead of solid objects? I have both a solid tiles and objects that have a variable making them “solid”
Yes. Use a height and a width for loop at a game room_start event and loop through each tile, checking for a collision_rectangle the size of the tile. When you find a collision, add that tile to the planning grid with mp_grid_add_cell().
At 17:52 my grid is drawing, but it is drawing to the right and to the bottom of the walls instead of on top of them. I am not sure what is going on, I couldn't find anything different in my code. Edit: In mp_grid_add_instances, I changed false to true. Now it correctly highlights the walls, I'm not sure why this is. For some reason it seems like it was rounding causing the grid to be drawn offset to the walls.
have a question about the motion planning set up when i set up the code following the video using DND and tested it, the red boxes that the function draws ends up being way bigger than the actual size of my wall tiles. how do i fix this?
It works really good, I just have to figure out a small bug, very rarely I am crashing getting an error saying "Trying to assign to a non-existing path." When setting the player_found boolean. I can't quite figure it out yet, but I do know that the player is still alive when it happens.
hello so im working on a game with similar enemy ai however im having trouble with the path finding collisions, basically when the enemy walks next to walls or near walls parts of the sprite is just in the wall it can also walk thro spaces much smaller than its sprite size
I Don't know if this is just me but it seems like this does not work as of right now where game maker is at, this is because i keep running into issue after issue even after rewatching the video a total of 4 times it just wont work even when I copy the code to a T.
Sorry to hear, but alas, it still works perfectly, with many others implementing the code and having it work for them. This may not help you, but the source code is available to Patreon members. If that doesn't help you, I hope you found a solution anyway. Good luck, don't give up!
hi, the enemies are shaking when in idle position. When my character moves closer to the enemy, the problem is fixed, but when the character moves away, they flicker when they go into idle position. How can i solve this problem.
im trying to create a hotline miami alike game, so the enemy shall look at the character whilst moving to the character. but while it is doing that, it goes straight into solid objects. how may i fix that?
@@Slyddar i have the same error heres what its says ___________________________________________ ############################################################################################ ERROR in action number 1 of Create Event for object : Unable to find instance for object index 6 at gml_GlobalScript_Check_for_player (line 24) - move_towards_point(Obj_Player.x, Obj_Player.y, 2); ############################################################################################ gml_GlobalScript_Check_for_player (line 24)
I have an issues with the ai, for some reason when im stopped the enemies will be put a ways away like the code says it should, but then for some unknown reason will inch forward toward me.
none of my variable are set before reading in the check_for_player script even tho i have them in the "create" on enemy_par, any ideas why this is or how to fix it?
idk why but my enemies will just stop moving altogether if I stick close to my obj_wall. they will refuse to pathfind to walls that make a thin corridor-like space for my character to move to but the enemies wont enter it. idk what to dooo ;(
first issue is i cant get them to move towards the x position of the player if i start on their left side unless ive jumped over them. i also want them to be able to jump after the player but only if they detect the player and the player is above them (i learned about the choose event because of this tutorial so i know how to set it to be random now, thanks) second i have multiple player characters in the game how can i set it so they properly chase the closest player to them or the one who hit them last and finally im having trouble setting the speed to something that works i can send code if needed thank you to anyone who can help Edit* ive kinda figured it out, the problem was i needed to place the script in my horizontal Collison code, idk why that worked but now im having an issue where if they walk off a ledge they stay in mid air until they meet my x position while im not moving only then does gravity work. fixed trhe speed with what i did above. the only thing i need now is for them to jump over my solid_obj to get to me if necessary, to detect the all players available and to pick which one to follow.
It's a tough problem to solve. You can run a collision event with the enemies, and compare their id's, so you can decrease the path speed of the lowest id. You also set an alarm to irandom_random(30, 60), which has code to increase it again if not in a collision with another enemy.
im confused, when did the global.mp_grid receive a value? line 27 on the check for player script seems too request the value of it and now it won't launch? im lost
Am I supposed to watch this in a series or something because i dont have check for player script. ik its 4# of a series but i thought it'd work on its own.
You probably worked this out already but they all build on from the previous episode i.e. it's a series. You can't just pick and choose which ones to follow, you have to do them all in sequence.
@@Slyddar oh so thats why my build is not starting! 😅I am just trying to have an enemy that chases you from left to right (it's not a top down) and I did everything you did in this video, but when I try to start it just says this (MainGuy is Player): ERROR in action number 1 of Create Event for object : Unable to find instance for object index 1 at gml_GlobalScript_CheckForPlayer (line 26) - move_towards_point(O_MainGuy.x, O_MainGuy.y, 1); ############################################################################################ gml_GlobalScript_CheckForPlayer (line 26)
hey anyone see at 17;42 when he puts in the game object how the grid convert to like 64 or something or 32. that jumping back and forth has caught my eye but seems not to matter so far.
Each layer has it's own grid size, which you can set up the top right. We were on the Collisions layer, which is 32x32 and then I click on the Instances layer which has a 64x64 size.
Glad you like the video, but sorry about the Ads. I have no control over them. Even if I choose to put no ads and not monetize the video, UA-cam will put them on there anyway.
Hi, I followed everything you said but when checking for player in the enemy check for player part it keep saying that my "path" variable is not defined. Can anyone help me with why this is?
@@Lemonade-ip1jf that was going to be my next suggestion. You can add event_inherited() to the top of the enemy create event to ensure it gets any parent code.
I got a problem with the room start event , at line 9 it says : GM1020 - the function mp_grid_create takes no less than 6 argument but 5 are provided. if someone can help me ! thanks
hello slyddar you ever want to get a lot of views just show how to replace art at the end of an already made series. it will go crazy and just add it to your old videos.
Can anyone help me? I’m having a problem when I get to the Clean Up event but I think my comment keeps getting hidden or something because I commented 2 times and it’s not showing up.
Don't wanna be the negative nelly but there is almost no difference in regular code and D&D. Without knowing what to pull over, func var or whatever, its pretty much its just copying what someone is doing who is know what he is doing.
That's easy to say if you use GML only, but for people who like using DnD, your opinion is to just leave them be and give them no resources to learn from? Being considerate to all is in my nature, and while I prefer to develop on GML, it doesn't mean I should ignore a whole bunch of people who choose to learn the same language a different way. Under the hood DnD is still GML, it just has a layer above allowing others to appreciate it in a different way. Just like life, be tolerable of other points of view, as it can be different to how you see things, but their learning goal may still be the same.
Да вот единственное что хорошо в Game marker это свет, а остальное все говно. Там ни текстур нормальных не вставить ни менюшки сделать нормальной нельзя 😁
I just love the way you explain things in such a way that it makes potentially difficult things easy to understand. Also, kudos for the amount of effort that you must put in each episode having to film it twice and then edit it all together for GML and DnD at the same time. Much, much respect.
You, Sir, are more than just a hero.
Without that i would struggle with hsp and vsp and collisions for ages!
Respect! Great tutorial, and unbelievably cool that you include both the DnD and GML. Great job :)
Phenomenal, top-tier quality work as always. I appreciate everything you put out. You deserve WAY more attention than you get.
Although I didn't use this tutorial for a dungeon crawler, I did use it for a horror game monster. Great tutorial either way!
what's your game?
@@sveninspace Haven't done any public things regarding it yet. I wanna keep it under wraps until I'm content with how it looks. But it's a different take on the "mascot horror" trend that has become so stale as of late. (Minus Shipwrecked 64, that game slapped)
Thank you very much for this video. Just starting out in Gamemaker and this video helped teach me a lot of the simpler concepts of making a game.
For those of you wondering how Slyddar put down multiple enemies holding 'Alt', it's actually 'Right Alt', not 'Left Alt'. Just found out about it today
Actually I was using left Alt, but both left and right work the same.
@@Slyddar I'm not sure if that is true back then or that they've updated using Alt's, but currently using Windows and making something right now, you can only use 'Right Alt' to put down multiple objects. 'Left Alt' now acts like a dragging of the camera/room around
I'm using the latest stable version, 2022.3.0.625. That's normally what middle mouse does. In my Preferences, Redefine Keys, 'Paint with Resource' is set to Alt. No left or right alt, so maybe your one is different.
@@Slyddar Yeah honestly quite interesting and weird, my middle mouse also does same thing, but so does my alt when I have that button and left mouse clicked for the object I want to place both at same time.
@@machan6635 you most likely have the laptop mode turned on at the top of the panel, next to the zoom buttons.
Hey great to see you making another tutorial.
Just want to say im loving the series! And that im patiently waiting for part 5 🙂
Hey, that's nice to know, I appreciate the comment. I'm editing part 5 now, so shouldn't be too much longer. Hopefully you are subscribed so you can see when it drops.
bro you do GML and DND! thats a good tutorial!
Thanks!❤
Wow, thank you!. You're my first donation through UA-cam, so it really warms my heart you've done something like that. I very much appreciate your generosity, and really hope the content helps you make a cool game! ❤
Just in case anyone runs into the same problem I did. If you have a create event in the child enemy it will override the one in the parent enemy. This caused an error telling me I had not defined the variable "path". I ran into this problem around the 23:30 minute mark of this tutorial. The solution was simple, delete the create event in the child enemy.
This is a cool series
This is fantastic, thank you so much.
This video was really really useful, thanks!! Do you have any advice on how I would basically take this movement/collision and put it on a grid? So a character moves say 50 flat pixels every second, instead of continously moving?
There are answers for this on yoyo's gamemaker forum. Look for grid movement examples.
amazing video! how did move you move everything in the brackets along at 30:42, been looking for the shortcut everywhere but can't find it!
In GML when you select multiple lines you can just press Tab to move text right or Shift Tab to move it left.
@@Slyddar that's gonna save me an accumulation of at least...15 minutes over the span of a year! thanks buddy 😸
so amazing! i wait so long but its always a good tutorial! I rather 1 GREAT tutorial a month then 1 bad tutorial a week
These tutorials are great! I'm having an error pop up in my Room Start event. My variables "_w" and "_h" are not defining, and so lower under "create motion planning grid" , the program is saying "Assignment operator expected". I've skipped back and can't seem to find the issue. Please help!
Another tutorial would be awesome your content is the best your sooooo underrated your the best
By another tutorial I mean part 5
what an amazing tutorial - thanks so much mate. Learned so much.
high quality as always thanks.
Hey im working on a game and your tutorials are helping me alot. could you please make a tutorial about how to make an inventory and how characters can equip items?
Can't promise anything, but thanks for the suggestions.
Thanks for your tutorial, so cool !!!
In this tutorial seiries, can we get a video on an inventory and different weapons?
cant wait for the next one
Thanks for tutorials 🙏
hello, this is a very good tutorial, I'm waiting for the next one please
Awesome tutorial!! I was wondering if you can provide a method for preventing enemy overlapping?
Please make this a big and extensive series
Is there a way you can make the enemies avoid a tile set (tile collision) instead of solid objects? I have both a solid tiles and objects that have a variable making them “solid”
Yes. Use a height and a width for loop at a game room_start event and loop through each tile, checking for a collision_rectangle the size of the tile. When you find a collision, add that tile to the planning grid with mp_grid_add_cell().
Thanks for tutorial man, it really helped me with my game
Great to know, maybe you can sub to show your appreciation :D
At 17:52 my grid is drawing, but it is drawing to the right and to the bottom of the walls instead of on top of them. I am not sure what is going on, I couldn't find anything different in my code.
Edit: In mp_grid_add_instances, I changed false to true. Now it correctly highlights the walls, I'm not sure why this is. For some reason it seems like it was rounding causing the grid to be drawn offset to the walls.
I had the same problem and your fix helped me, thank you.
Thank you!
have a question about the motion planning set up
when i set up the code following the video using DND and tested it, the red boxes that the function draws ends up being way bigger than the actual size of my wall tiles. how do i fix this?
having the same issue:(
Yeah, same here.
i solved it by changing the TS macro to 1
@@stickbug-grenade When i did that the enemies were able to walk through the top of the Solid
same issue here... if I set precision to true, it works. Not sure why this is necessary for me.
"im not gonna be dumb this time" proceedes to make it be the price of 1 blood instead of 0
i love ur lesson, plz more
great tutorial!
It works really good, I just have to figure out a small bug, very rarely I am crashing getting an error saying "Trying to assign to a non-existing path." When setting the player_found boolean. I can't quite figure it out yet, but I do know that the player is still alive when it happens.
Great tutoril, it was very useful
When is the next one though?😅
hello so im working on a game with similar enemy ai however im having trouble with the path finding collisions, basically when the enemy walks next to walls or near walls parts of the sprite is just in the wall it can also walk thro spaces much smaller than its sprite size
I Don't know if this is just me but it seems like this does not work as of right now where game maker is at, this is because i keep running into issue after issue even after rewatching the video a total of 4 times it just wont work even when I copy the code to a T.
Sorry to hear, but alas, it still works perfectly, with many others implementing the code and having it work for them. This may not help you, but the source code is available to Patreon members. If that doesn't help you, I hope you found a solution anyway. Good luck, don't give up!
hi, the enemies are shaking when in idle position. When my character moves closer to the enemy, the problem is fixed, but when the character moves away, they flicker when they go into idle position. How can i solve this problem.
no idea whats going on but it works so you dont hear me complain
im trying to create a hotline miami alike game, so the enemy shall look at the character whilst moving to the character. but while it is doing that, it goes straight into solid objects. how may i fix that?
I have figured it out until then XD
Amazing video, but can you make an tutorial entirely for dnd? I've seen you started that series, but I cannot find any episode from 2. Thanks!
Episode 2, 3 and 4 are dual DnD and GML videos.
how did you set up a collision layer ?
Hey I’m trying to do the move toward poin function and when I put the 1 for the speed it won’t work can you plz help me
how to avoid stacking enemies in each other?
I got “runtime error variable not set” after adding “execute script check_for_player” everything works if I remove that piece of code
Hard to tell, as you haven't provided the whole error. Can you copy and paste the whole error, and maybe I can help then.
@@Slyddar i have the same error heres what its says ___________________________________________
############################################################################################
ERROR in
action number 1
of Create Event
for object :
Unable to find instance for object index 6
at gml_GlobalScript_Check_for_player (line 24) - move_towards_point(Obj_Player.x, Obj_Player.y, 2);
############################################################################################
gml_GlobalScript_Check_for_player (line 24)
Oh my goodness I need help I want to do this but I can’t read what you write I can’t tell what you put in it’s too blurry please help
I have an issues with the ai, for some reason when im stopped the enemies will be put a ways away like the code says it should, but then for some unknown reason will inch forward toward me.
none of my variable are set before reading in the check_for_player script even tho i have them in the "create" on enemy_par, any ideas why this is or how to fix it?
Hi, my enemy is not moving. I dod everything right. But it is still not moving
Nevermind. I set the enemy as the parent instead of a child
idk why but my enemies will just stop moving altogether if I stick close to my obj_wall. they will refuse to pathfind to walls that make a thin corridor-like space for my character to move to but the enemies wont enter it. idk what to dooo ;(
hey this is working very well so far but im trying to get it to work for a platformer and having a few issues
first issue is i cant get them to move towards the x position of the player if i start on their left side unless ive jumped over them. i also want them to be able to jump after the player but only if they detect the player and the player is above them (i learned about the choose event because of this tutorial so i know how to set it to be random now, thanks) second i have multiple player characters in the game how can i set it so they properly chase the closest player to them or the one who hit them last and finally im having trouble setting the speed to something that works i can send code if needed thank you to anyone who can help
Edit*
ive kinda figured it out, the problem was i needed to place the script in my horizontal Collison code, idk why that worked but now im having an issue where if they walk off a ledge they stay in mid air until they meet my x position while im not moving only then does gravity work. fixed trhe speed with what i did above. the only thing i need now is for them to jump over my solid_obj to get to me if necessary, to detect the all players available and to pick which one to follow.
Is there a way to implement a minimum and maximum distance that enemies have between each other? I don’t want enemies to be too crowded up
It's a tough problem to solve. You can run a collision event with the enemies, and compare their id's, so you can decrease the path speed of the lowest id. You also set an alarm to irandom_random(30, 60), which has code to increase it again if not in a collision with another enemy.
im confused, when did the global.mp_grid receive a value? line 27 on the check for player script seems too request the value of it and now it won't launch? im lost
I'm not sure what time stamp you are referring to. Come to the Discord if you need help, as it's easy to post code/screenshots there and get help.
still here from the first video.
Am I supposed to watch this in a series or something because i dont have check for player script. ik its 4# of a series but i thought it'd work on its own.
You probably worked this out already but they all build on from the previous episode i.e. it's a series. You can't just pick and choose which ones to follow, you have to do them all in sequence.
@@Slyddar oh so thats why my build is not starting! 😅I am just trying to have an enemy that chases you from left to right (it's not a top down) and I did everything you did in this video, but when I try to start it just says this (MainGuy is Player):
ERROR in
action number 1
of Create Event
for object :
Unable to find instance for object index 1
at gml_GlobalScript_CheckForPlayer (line 26) - move_towards_point(O_MainGuy.x, O_MainGuy.y, 1);
############################################################################################
gml_GlobalScript_CheckForPlayer (line 26)
hey anyone see at 17;42 when he puts in the game object how the grid convert to like 64 or something or 32. that jumping back and forth has caught my eye but seems not to matter so far.
Each layer has it's own grid size, which you can set up the top right. We were on the Collisions layer, which is 32x32 and then I click on the Instances layer which has a 64x64 size.
Where did you get the enemy sprites from?
The link to the sprites is in the description
Very good video, good details and information. But gott damn you put more ads in this video than a TV channel ad break 😭
Glad you like the video, but sorry about the Ads. I have no control over them. Even if I choose to put no ads and not monetize the video, UA-cam will put them on there anyway.
If I wanted to add more than 1 type of enemy, how would I go about this
❤❤
Teacher, can I repeat these codes in my commercial project?
Hi, I followed everything you said but when checking for player in the enemy check for player part it keep saying that my "path" variable is not defined. Can anyone help me with why this is?
At 19:08 we add the path variable to the parent object. Make sure you have done that.
@@Slyddar Thanks, I checked, turns out I accidentally overwritten the create event in the parent object by adding a create event in o_enemy as well.
@@Lemonade-ip1jf that was going to be my next suggestion. You can add event_inherited() to the top of the enemy create event to ensure it gets any parent code.
I got a problem with the room start event , at line 9 it says : GM1020 - the function mp_grid_create takes no less than 6 argument but 5 are provided.
if someone can help me ! thanks
hello slyddar you ever want to get a lot of views just show how to replace art at the end of an already made series. it will go crazy and just add it to your old videos.
Can anyone help me? I’m having a problem when I get to the Clean Up event but I think my comment keeps getting hidden or something because I commented 2 times and it’s not showing up.
i love you
i cant download the sprites bc of the stupid winzip thing that i have to buy to open it
Windows 10 comes with 7zip, so just right click and extract it. If that fails, go get 7zip.
@@Slyddar thank you it really helped
use winrar
We are you
make a lot of GML :)
Where is GML ?
My enemies are not even appereaing on the game
Mine too
i got
3 errors
If you're boasting, congrats, that's impressive! If you're after help, you'll need to post what the errors actually are.
@@Slyddar thy dk what obj_player x and obj_player y is
If you have an error, post the actual error so we can help you.
lmao bro, be specific. show some love lmao
Don't wanna be the negative nelly but there is almost no difference in regular code and D&D. Without knowing what to pull over, func var or whatever, its pretty much its just copying what someone is doing who is know what he is doing.
you should focus on GML - its easier to understand
That's easy to say if you use GML only, but for people who like using DnD, your opinion is to just leave them be and give them no resources to learn from? Being considerate to all is in my nature, and while I prefer to develop on GML, it doesn't mean I should ignore a whole bunch of people who choose to learn the same language a different way. Under the hood DnD is still GML, it just has a layer above allowing others to appreciate it in a different way. Just like life, be tolerable of other points of view, as it can be different to how you see things, but their learning goal may still be the same.
You should create 2 different video - one with only gml and other with drag&drop, because in this approwach no one will be happy (or very happy).
It didn't work
Да вот единственное что хорошо в Game marker это свет, а остальное все говно. Там ни текстур нормальных не вставить ни менюшки сделать нормальной нельзя 😁