• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

GameMaker Mouse 8 directional point and click movement? [GML]

Soooooo after a binge of founding out I absolutely ADORE arpg's (diablolike arpgs to be clear) I have a determination to make as close to one as possible in 2D, but im like really really noob, and only picked this up yesterday, with zero coding experience. Possibly a fools errand but im trying to learn what I can.

With that said... is it possible to set up script for a point and click movement with 8 directional sprite support? So when moving up the sprite faces up ect. Being so new there isn't a chance of me learning how to do it on my own without seeing an example and google didn't help, so I hope someone here can help me as my hearts so deadset on this haha.
 
You might not want to hear it, but you'll get there much faster if you go through the tutorials and build a few small games first. Everyone starts off trying to make their dream game and 99.999% (I would hazard a full 100% here) do not complete it until after they stopped, made a bunch of smaller projects first and then restarted their original idea (with both better coding skills and better design skills). Point and click movement isn't as simple as it seems because it requires pathfinding, which is generally going to be incredibly confusing for someone who is just starting out. Most people wouldn't do what you are asking for with a single script (or function, as they are now called), but a bunch of different functions working cohesively to produce the desired result.

Also, this forum generally isn't here to spit out code for you to copy =P We're here to help guide you on your own self-motivated journey of learning code. Apart from going through the standard Gamemaker Tutorials (which are good, but some rely on older version of GMS so will require some finangling to get working properly), I would recommend going through @samspade's tutorial series Introduction to Coding Fundamentals in GML to help you get your footing in terms of code. If you are interested in drag and drop (which is good for beginners, but you should try to progress out of it as quickly as possible) then @Slyddar has quite a few drag and drop tutorials (as well as some coding ones), with Top Down DnD Movement and Collisions possibly being something you might find interesting for a top-down arpg (even if you don't want to use DnD, slyddars tutorial should be helpful at understanding some concepts you will definitely need). Once you've gone through these (and hopefully retained some of the knowledge), you should start experimenting and trying to make some very simple games from scratch without the help of a tutorial. Something like Pong or Space Invaders is usually a good first game to try to make, as they aren't too advanced to recreate, but making them will teach you a lot about how to make games. At that point, maybe you'll be ready to try to tackle your dream project. But remember, making games is a lifelong journey that requires patience and a willingness to learn. Trying to leap frogger-style over the basics will almost always lead you directly into a frogger-style car crash, so take it slow, have fun and before you know it you'll be tackling the projects you've always wanted to make.
 
I've been trying to find videos on the basics and such but it can be really hard, since coding isn't linear so people code all types of differently so I think the biggest challenge will be finding a good "teacher" since im deff not smart enough to learn coding on my own like some people, but nor do I have money.

Not even sure if theres places out there that really teach gml for money since its tied strictly to this program. (far as I know)
 
since coding isn't linear so people code all types of differently
I mean, this is true, but it's trivially true. Authors all have their own distinctive writing style, but that doesn't mean they didn't learn their ABC's just like everyone else. Developing your own coding style is something that comes with time and experience. To begin with, everyone is just piecing things together from whoever they are learning from. As you grow as a coder you'll start finding that your prefer X over Y when implementing a thing, but again, that's not something new coders should be worried about. Immerse yourself in code and learn from whoever you can. That's the quickest way to grow as a programmer. Even if one of the people you're learning from is a "bad" coder, the problems you learn from them will get corrected over time from other learning sources. Also, yes, there are plenty of people willing to tutor GML for cash, but doing it that way isn't necessarily going to be any easier than doing it any other way. As I said, there are no shortcuts.

Also, did you look at the links I posted? They are all teaching "the basics". Especially samspade's stuff will guide you through the very beginning of learning how to code, explaining the earliest concepts you'll need to begin branching out on your own and building a solid foundation of knowledge that will be helpful (or necessary, rather) in literally any coding scenario.
 
I'm looking through them now. And when I say liear I meant how confusing it makes learning since one video will structure say how to walk one way, then another will do theirs completely different. And both work but it makes it confusing on which is better, or if it matters.

Since I've heard of terms before like clean code and such, making sure its easy to read so after the built in GMS tutorials and other videos, idk where I'd go from there, since I really cant understate how impossible learning anything on my own would be.

I should mention I have autism so it hinders me in the learning department. All and all I'm just really confused on where is the best place to learn after all the other tutorials/videos since learning on my own is out of the question sadly. I need a teacher in any form I can get it, as much as I wish it were not. I'd also love to be a one man army but I cant do art or music to save my life haha.
 
Don't worry about clean code or anything until you're well into your coding journey. If it works, it works. That's the main thing you should be focusing on while you're learning. Also, the fact that two different code structures can lead to (roughly) the same outcome is a good thing, hahaha. It means you've got twice the chances to get it right! For instance, one of the most common ways of capturing input for movement is some variation on this little snippet popularised by shaunspalding:
Code:
left = keyboard_check(vk_left);
right = keyboard_check(vk_right);
hsp = right-left;
x += hsp*move_speed;
Is that the only way to capture input for movement? No way! Is it the best way to do it? Probably not. But it works and a lot of people learn it and then use it for a loooong time. That's totally fine. Just because there are different ways of doing it doesn't mean that everyone has to learn all the ways. So when you're learning, find a method that makes sense to you (whether this is through a particularly good explanation by someone, or it just feels better) and use that method. As you learn more, you might tweak it over time and eventually you'll get to the point where you're completely inventing your own methods. But that isn't something you need to really think about too much as a beginner.

Go through tutorials and try to understand as much as you can. The GMS Manual is a great resource for this. You can actually middle-click functions in GMS and it will open the manual page for that function. Whenever someone has you type some code you don't understand in a tutorial, try middle-clicking different parts of it after you've typed it and reading through the manual entry for it. To begin with, it might seem like you're reading nonsense (it feels that way to everyone when they are learning), but over time it will start to make more sense as you use the same code in different places and your brain starts to make connections with why that code gets used when you want a certain something to happen.

I know a few autistic coders and they are great at what they do =D So don't feel like it's impossible, it's just going to be hard (learning to code is hard for everyone, hahaha).
 
I guess to start I'll do the asteroids tutorial first and after that is done make a new project that will use some of what was learned there, in trying to make idk maybe a very simple 2d scroller, with combat, but only set up the basics like sprites and such, then move onto the little town one to learn more about text boxes and such and try to combine knowledge of both into a very simple project to see how much I learned.

Not a game to really release but more so a testing grounds. Unless it turns into something more who knows, nothing is set in stone.
 

WilloX

Member
I remember starting out wirh gamemaker. I was line for line copying a tutorial for a top down shooter.

The real learning started with changing that code and making it your own. I was sooo happy after implementing my own dash move (it was really bad and clipped into walls bit it was the first thing i did on my own and it ran).

So good luck on you journey - its a good one to take
 
I will say I got really frustrated at something... idk if it goes on to explain it later and they just overlooked it but in the asteroids clone video one of the lines of code uses a comma, (there it is :O) and I got really annoyed that the person doesn't go over WHY and or WHEN to use them in code. I tried to google it but found nothing relating to using comma's in coding so idk if its specific to gml or not.

Really frustrated me cause it feels like im not learning more so just copying whats being done. Another hard thing is math... im so bad at math I cant even do simple subtraction if the numbers too big in my head. Lotta issues to overcome that comes naturally to others :c
 
Last edited:

Nidoking

Member
Commas are how almost every programming language I know of separates the arguments to functions. It's the first thing you learn after "Hello World", and in C-style languages, you need commas to write a main function so you can do "Hello World". It sounds like you need to do some supplemental research, like maybe read the Manual sections about basic programming structure, because if you can't grasp functions, you are not going to get very far in programming.
 
Aside from what was said, one really important thing while doing tutorials is to be "on the hunt" for what you know you'll need later.
Because when all is said and done, spawning a Skeleton Capitain is exactly the same thing as spawning an asteroid, right?
But aside from the basic point-and click, chest-opening and random items, shops and inventories, etc. which are all "relatively" easy, there's also a HUGE element in Diablo that's going to be out of your league for a little while, and it's the whole randomly-generated dungeons thing and the multiplayer (if you thought about having it in).
Also, I suggest you do just a week or so of basic online CS class (like Harvard's CS50 on Youtube) to get some basic principles down, and then work on what you know will be useful for your big projects, but in piece-meal sizes, like mini-games or tutorials, or stuff like that. This stuff is useful all across the board and can really slow you down if you miss on them.
 
Top