GMS 2.3+ Player states on Slope collision problem

I come with (what I assume to be) a more complex problem than I have expertise with. This is a question regarding slope collisions and animations, and before I explain please bear these two things in mind :)
1. I am a newbie working largely with tutorial materials
2. This is not for a game project, it’s so I can learn how to read/understand GML better

So the problem at hand: I have emulated Spalding’s sloped collision system (bbox detection of tile edges, etc) and in a vacuum that works great. No problems there.
However if I employ any kind of animation or non-keyboard movement (such as a Roll type action) I run into a frustrating problem. Sometimes the animation will play to completion, sometimes it will halt dead after a short way, or even a few pixels. I can only assume this is tied to the collision system detecting the edge of a tile underneath and stopping…. About half the time. I can’t understand the rhyme of when it will/won’t bug the animation.


Attached is the room I’m working with (since uploading all the slope collision code would be a lot, and people probably already know it well):


room.png


Also the very simplified rolling / dashing I added to test this problem:

action.png


Frequently the movement/animation will cease early, even on a straight line. I have double checked the tiles being used (32x32) and tried both Spalding’s and my own to make sure.

For the sake of better learning, is anyone able to point out what’s causing the issue, and some possible areas I can research to fix it? I’m happy to put in the reading/work once I know where to start.
 

TheouAegis

Member
If you are sure the collision code is right, check your sprites. Make sure your origins and bounding boxes are all correct. You can use the Draw End event to draw a rectangle over the bounding box to track it as well.

Do you have multiple collision scripts? I'm guessing you have one for right and one for left. Are you sure they are identical except for directions? Did you change all the directions? Lile, make sure you didn't put bbox_left where it should be bbox_right.

Did you add anything to his collision code? Do you have special state handling for roll or dash that would make them behave differently than other states? Also, I prefer to have my collision scripts simply tell me if a collision is detected at a particular coordinate, then let the state dictate behavior.
 
Also, when you swap sprites, you also have to reset image_index to 0, otherwise the sprite animation will play from whatever frame the previous animation was on.

(Pro tip: find a way to make it so setting image_index to 0 only happens for one frame when the animation changes, otherwise image_index will constantly get set to 0 and the animation will never play)
 
Also, when you swap sprites, you also have to reset image_index to 0, otherwise the sprite animation will play from whatever frame the previous animation was on.

(Pro tip: find a way to make it so setting image_index to 0 only happens for one frame when the animation changes, otherwise image_index will constantly get set to 0 and the animation will never play)
I. Did. Not. Know. This.

Thank you a million, turns out for all the complex bullarchy I was doing, I just hadn't been setting the image_index back to 0. Such a simple flaw.

Thanks to both for the replies, I learned a lot from this question even if it did turn out a bit of a mess!
 
Top