Це відео не доступне.
Перепрошуємо.
The Basics of Paths in GameMaker Studio 2 - Tutorial
Вставка
- Опубліковано 3 сер 2024
- Paths are a great way to moving objects around, and they can be morphed into some powerful AI tools to avoid collisions, find specific path lengths, and more. This is the basics of paths, to get you started with it all.
Social:
- Connect with me on Twitter @Aaron_LLTT: / aaron_lltt
- Become a valued Patron and receive more exclusive content @: / letslearnthistogether
- Wanna hear from other developers in the industry? Head on over to my podcast, DevTalk, to listen to engaging conversations I have with various successful developers: devtalk.buzzsprout.com/
My Exclusive Courses💻🎮:
Bundle Course Package & More Here! www.letslearnthistogether.com...
Finished & Ready to Start Projects here ---- github.com/AaronLLTT/Paths-Ba...
Intro Music: Intro For A Nonexisting Video Game by Captive Portal
this is so so useful thankyou! your diagram was very helpful in understanding and navigating how to aproach directions, again thanks! (imma go draw that this was great)
Thank you so much man! Love you
awesome video.. very very simple and straight forward.
Thanks for the videos! They are still contributing to us noobs
Very useful. Thank you
Useful thanks!
Very helpful thanks
Thanks for the video - This was super helpful!
I never thought I'd catch someone commenting just an hour ago under a video that came out 6 years ago lol.
thanks great tutorial
Good one
12:26 Because of better performance, you should use *else*. In your case, the code will always check all 4 conditions, also when the first condition is true
thanks
thanks! one subscriber more.
my sprite stop the animation during the path, why?
what are the settings to import the tileset? i'm using gamemaker 1.4
Thanks for the video! How would I make the image_speed only animate the image when the path starts? I'm using your 360 degree positioning to rotate my sprite image, but he starts running right away even with the path has not started yet.
You could add in a condition on the object that checks if a current path is running, and if it's not, then image_speed is 0.
I appreciate it. That worked and is so simple lol.
I'm using the condition if (path_position >0), which starts animation . But I'm having trouble thinking about if (path_position) is not running then set image speed to 0
If it's not running are they on a path? If not, you can check their assigned path and do things based on that. If their not on a path set it to undefined, then you can check that value.
Great This give me more to think about. Thank you.
how would you get them to move around other objects?
question, wouldn't it be possible to make your player warp into another room with the path? for example, if the player is touching the end of the path you set up, could you make the player go to another room?
+Ezra Holladay Sure, no reason you can't.
cool
Can you make tutorial " if you buy road and put it.. how to save that road?? Becouse when you out from gamemaker and rEnter its back normal..
That's saving and loading. Or setting a room to persistent, so that changes made in it stay while the game is running.
you described precision completely backwards but good tutorial still lmao
You win some you lose some, lol.
How can you code delay before starting a path? I want my object to wait a few seconds before moving
The simplest way would be to just delay assigning that path by a few seconds. Use an alarm and start the path after that time.
@@LetsLearnThisTogether Oh I see, didn't know what an alarm was until now (new to GM2) !
This video is so old and you're still answering comments-
Thank u so much !
Why does my object just get off the path even tho I did everything you said, I only made the path a closed circle instead of a straight path.
Does your person stop once they get off the path or do they keep going and eventually get back on? What do they do?
Anyway you can make the NPC stop at the middle of the path and then continue ?
For sure. You can use path functions to determine where along the path you are, such as how far, and then use that data to stop halfway, or anywhere else.
@@LetsLearnThisTogether Thanks.Also,do you have any tutorials about vision cone ?
Hm, my object isn't changing his sprite even though I did everything as shown.. Its only changing his animation. i don't know how to explain this. the animation is fixed and when the object changes the direction, the next animation mask is shown, but not the other sprite
That’s odd. Can you paste your chunk of code here or take a snapshot?
create:
path_position = 0-1;
path_start (path_icegolem_01, 2, path_action_reverse, true);
step :
if(direction >= 306 or direction = 46 and direction = 136 and direction = 226 and direction
OHHHH NOO IM SO STUPID, I found the mistake 😭😂 image_scale -> sprite_scale🤦🏽♀️ dammit, I wasted a whole Sunday 😂
Lol. Not wasted, growing your debugging skills.
You're right haha, thank you so much for responding that fast!
if (keyboard_check(vk_right)) repeat(
i + 1 x + i;
) until i
+Waffles And butter You're not assigning your math to anything. You're simply adding numbers together. Need to take the answer it put it back into i.
Beyond Us Games i don't under stand could you show me an example?
You're currently adding numbers and variables together:
i + 1 x + i;
But, you're not saving that result anywhere. So it's basically completely useless. You need something like this:
i = i + 1 x + i;
The = assigns the resulting math to the variable i.
Beyond Us Games I'm sorry I forgot to add them when I was copying it to the comments eaven when I add the = it doesn't work? I'm completely stumped on this.
+Waffles And butter So I'm not really sure what it is you're trying to accomplish with that line of code, or what's wrong. Is it an error? Does the game run and the freeze?
You are also adding i with other numbers, but you're checking for when it's less than or equal to 7. Unless the numbers you're adding together are negative, i will never go down.
Dude you sound like David Schwimmer
Wouldn't it be cleaner to just make a copy of sprGuardWalkLeft and rename it sprGuardWalkRight, then you don't have to mess with xscaling it to -1, it's only one sprite, in this case anyhow.
+Len Harms It would be simpler, yes. However, many sprite sheets only contain walk left or walk right, and this is a simple trick to manipulate the sprite without a lot of extra work.
Lots of ways to do things, no one right way most of the time. That's what I love about programming.
How do I know how the path speed translates into real world time?
What are you trying to do? There is a built in variable that counts real world time vs game time, and you’ll need to use that.
@@LetsLearnThisTogether I need an event to happen at the exact moment the object reaches the end of a path, therefore I need to know exactly how long to set the timer..
Ah, I know I talk about it in my videos somewhere. It’s been a bit, but if you download my full paths example, I’ve got some code in there that may work for what you want to do. I know you can do this, so keep looking.
mine is above the path, not directly on it, so annoying
How do I do this in Drag and Drop?
Hmmm. I’d suggest taking my project and converting it to drag and drop, and see how they think it would work.
I don’t use DND so I don’t have much experience doing complex things with it.
@@LetsLearnThisTogether unfortunately I can't do that since I can only use the trial of Game Maker Studios, but thank you a lot anyway! :)
10 months late, but... I don't think you can. To my understanding, there are a lot of GML things that simply can't be done with Drag and Drop alone. Luckily, you are able convert things to and from Drag and Drop. Basically, you can whip something up with D&D, convert it to code, write more code, then add more D&D to the end of that code. I use Drag and Drop when I can because I'm lazy, but you're going to have to start using GML sooner or later for anything more complicated than the most simple of games.
I did the exact same thing but my object starts to go ape shit as soon as it finishes reverse. Instead of repeating the loop over and over, the object starts to warp back and forth between the 2 points
Odd. Be sure to download my project and compare your code side by side.
I did and it's the exact same thing, just the "path_start(p_back_and_forth, 2, path_action_reverse, true);" at the Create Event
Hmm. Feel free to export the project or zip it up and email it to me at beyondusgames@gmail.com.
I have the same bug...
I don’t remember what I found in the other project, if I ever did. Email it to me and I’ll look at it.
are you Ross from friends?
Not since the last time I checked :)
@@LetsLearnThisTogether xd thx for letting me know, now i can sleep again 👍 your videos have been useful, had to subscribe :)
doesn't work with animations
I've definitely had issues with animations in the past, you just have to track their x and y movement, and if they're moving, change their animations.
@@LetsLearnThisTogether Does this work with checking hspeed/vspeed while a path is running? Oder does the path movement have no effect on the h/vspeed var?
I’m pretty sure it uses the built in h and v speed properties to move them, but it could also use just speed and direction.
@@LetsLearnThisTogether would be good to know. cuz request for H/V Speed is more much clear as other ways, just to chance the Sprite, while follwing the path.
@@LetsLearnThisTogether Gz und good wishes from Germany, btw.. Stay Healthy :)
Can you maybe make your intro a little less loud?
Bruh
Thanks
Dude
You’re welcome :)
Gotta love unnecessary intros with ear rape