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)
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 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.
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.
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 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 !
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?
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
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
@@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.
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.
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.
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.
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
@@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 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.