Це відео не доступне.
Перепрошуємо.

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

КОМЕНТАРІ • 83

  • @ghostoffo1369
    @ghostoffo1369 9 днів тому

    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)

  • @mrnobody7600
    @mrnobody7600 8 місяців тому +3

    Thank you so much man! Love you

  • @chrisgreig3753
    @chrisgreig3753 3 роки тому +1

    awesome video.. very very simple and straight forward.

  • @georgeuniversity
    @georgeuniversity 2 роки тому +2

    Thanks for the videos! They are still contributing to us noobs

  • @deputydaz
    @deputydaz Рік тому +1

    Very useful. Thank you

  • @valeriedance13
    @valeriedance13 5 років тому +2

    Useful thanks!

  • @djuskajeguskakojaigrakapir3911
    @djuskajeguskakojaigrakapir3911 5 років тому +1

    Very helpful thanks

  • @AllyProductions
    @AllyProductions 8 місяців тому

    Thanks for the video - This was super helpful!

    • @mrnobody7600
      @mrnobody7600 8 місяців тому

      I never thought I'd catch someone commenting just an hour ago under a video that came out 6 years ago lol.

  • @mst3ksanta
    @mst3ksanta 3 роки тому +1

    thanks great tutorial

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

    Good one

  • @HorstChristophSchreiber
    @HorstChristophSchreiber 7 місяців тому

    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

  • @MrDynamiteRocks
    @MrDynamiteRocks 7 років тому +1

    thanks

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

    thanks! one subscriber more.

  • @lorenzofrascella8709
    @lorenzofrascella8709 Місяць тому +1

    my sprite stop the animation during the path, why?

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

    what are the settings to import the tileset? i'm using gamemaker 1.4

  • @Muzick
    @Muzick 6 років тому +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.

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

      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.

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

      I appreciate it. That worked and is so simple lol.

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

      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

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

      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.

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

      Great This give me more to think about. Thank you.

  • @brianjarema264
    @brianjarema264 4 місяці тому

    how would you get them to move around other objects?

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

    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?

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

    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..

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

      That's saving and loading. Or setting a room to persistent, so that changes made in it stay while the game is running.

  • @samtorres4996
    @samtorres4996 3 роки тому

    you described precision completely backwards but good tutorial still lmao

  • @zegodor3985
    @zegodor3985 3 роки тому

    How can you code delay before starting a path? I want my object to wait a few seconds before moving

    • @LetsLearnThisTogether
      @LetsLearnThisTogether  3 роки тому +1

      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.

    • @zegodor3985
      @zegodor3985 3 роки тому +2

      @@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 !

  • @cakebomb-ny6tb
    @cakebomb-ny6tb 6 років тому

    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.

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

      Does your person stop once they get off the path or do they keep going and eventually get back on? What do they do?

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

    Anyway you can make the NPC stop at the middle of the path and then continue ?

    • @LetsLearnThisTogether
      @LetsLearnThisTogether  5 років тому +1

      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.

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

      @@LetsLearnThisTogether Thanks.Also,do you have any tutorials about vision cone ?

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

    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

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

      That’s odd. Can you paste your chunk of code here or take a snapshot?

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

      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

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

      OHHHH NOO IM SO STUPID, I found the mistake 😭😂 image_scale -> sprite_scale🤦🏽‍♀️ dammit, I wasted a whole Sunday 😂

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

      Lol. Not wasted, growing your debugging skills.

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

      You're right haha, thank you so much for responding that fast!

  • @paulmotter8531
    @paulmotter8531 7 років тому

    if (keyboard_check(vk_right)) repeat(
    i + 1 x + i;
    ) until i

    • @LetsLearnThisTogether
      @LetsLearnThisTogether  7 років тому

      +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.

    • @paulmotter8531
      @paulmotter8531 7 років тому

      Beyond Us Games i don't under stand could you show me an example?

    • @LetsLearnThisTogether
      @LetsLearnThisTogether  7 років тому

      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.

    • @paulmotter8531
      @paulmotter8531 7 років тому

      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.

    • @LetsLearnThisTogether
      @LetsLearnThisTogether  7 років тому

      +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.

  • @rjpluhar8894
    @rjpluhar8894 5 років тому +4

    Dude you sound like David Schwimmer

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

    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.

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

      +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.

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

    How do I know how the path speed translates into real world time?

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

      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.

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

      @@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..

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

      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.

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

    mine is above the path, not directly on it, so annoying

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

    How do I do this in Drag and Drop?

    • @LetsLearnThisTogether
      @LetsLearnThisTogether  5 років тому +1

      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.

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

      @@LetsLearnThisTogether unfortunately I can't do that since I can only use the trial of Game Maker Studios, but thank you a lot anyway! :)

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

      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.

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

    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

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

      Odd. Be sure to download my project and compare your code side by side.

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

      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

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

      Hmm. Feel free to export the project or zip it up and email it to me at beyondusgames@gmail.com.

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

      I have the same bug...

    • @LetsLearnThisTogether
      @LetsLearnThisTogether  5 років тому +1

      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.

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

    are you Ross from friends?

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

      Not since the last time I checked :)

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

      @@LetsLearnThisTogether xd thx for letting me know, now i can sleep again 👍 your videos have been useful, had to subscribe :)

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

    doesn't work with animations

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

      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.

    • @Malacay2k11
      @Malacay2k11 3 роки тому

      @@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?

    • @LetsLearnThisTogether
      @LetsLearnThisTogether  3 роки тому

      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.

    • @Malacay2k11
      @Malacay2k11 3 роки тому

      @@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.

    • @Malacay2k11
      @Malacay2k11 3 роки тому

      @@LetsLearnThisTogether Gz und good wishes from Germany, btw.. Stay Healthy :)

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

    Can you maybe make your intro a little less loud?

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

    Bruh

  • @WolfgangBrozart
    @WolfgangBrozart 6 років тому +15

    Gotta love unnecessary intros with ear rape