Disable platform behavior's 'sticking' to moving objects

Get help using Construct 2

Post » Tue Jan 12, 2016 8:11 am

Hello there! I'm working on a side project that involves a platform movement object going over an unlimited scrolling tilemap - to accomplish the unlimited scrolling, I have the tilemap and player slowly move to the left at a constant rate, and periodically shift it a tile's width to the right every time it moves a certain amount off the screen, as well as simultaneously shift all of the tiles along with it by transferring the tilemap's data to an array, deleting a column, and then transferring it back in one tick - giving the illusion of continuous movement.

Unfortunately, because the platform behavior will automatically shift position along with whatever the object is standing on automatically, this causes various problems - like the player sliding at double speed to the left while standing on solid ground, as well as jumping 16 pixels every time the tiles reset. I've tried to compensate for this behavior in my code by disabling the scrolling movement on the player while the player is standing on solid ground, but this doesn't produce satisfactory results - you can still see the offset for a frame.

I would just re-code the platform behavior from the ground up using custom movement, but I would like to avoid it if possible - is there any built-in way to remove the built-in behavior meant to emulate moving platforms?
B
9
S
2
Posts: 28
Reputation: 649

Post » Tue Jan 12, 2016 9:25 pm

Why don't you just make an invisible/immobile ground object and apply the solid behavior to that?
https://www.ravenheart.ca/home
I don't check the forums much anymore, but I will receive an email for PMs.

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
23
S
6
G
1
Posts: 1,419
Reputation: 4,857

Post » Wed Jan 20, 2016 11:57 am

I'm not just doing a flat scrolling floor - I'm doing a dynamically generated landscape of tiles. Otherwise, the invisible / immobile ground thing would work, but, alas!
B
9
S
2
Posts: 28
Reputation: 649

Post » Wed Jan 20, 2016 12:21 pm

You'd need to modify the platform behavior itself to do this. Maybe you could ask forum user ruskul about this, they made a recent post about editing it for collision filtering.

But if your landscape is completely orthogonal then you should just roll your own because you don't need to implement the two most difficult aspects of a platformer: slopes & moving platforms.
B
27
S
12
G
1
Posts: 157
Reputation: 3,359

Post » Fri Jan 22, 2016 6:06 pm

Can you simply adjust the height of the invisible floor to match the present height of the ground the character is standing over?
https://www.ravenheart.ca/home
I don't check the forums much anymore, but I will receive an email for PMs.

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
23
S
6
G
1
Posts: 1,419
Reputation: 4,857

Post » Sat Feb 13, 2016 9:02 am

I ended up coding up my own not-perfect-but-functional platform movement based on the custom movement behavior - but it would be pretty nice to be able to turn the 'sticking' aspect of the behavior on and off! The height-changing floor is a clever solution, but not really one that'd mesh well with other aspects of my game - I may end up giving it a try anyway, though!
B
9
S
2
Posts: 28
Reputation: 649

Post » Fri Apr 08, 2016 9:17 pm

Just started looking into this behavior. IMO it's an important feature that should be optional in the Platform plugin but isn't! Maybe @Ashley can add this in with future versions. For now I'll take a look at the js code, and if I can't disable it I'll just make a custom solution.
ImageImageImageImage
B
62
S
19
G
51
Posts: 633
Reputation: 30,836

Post » Wed Jun 08, 2016 4:09 am

Hey there everyone! Sorry to resurrect an old thread, but I revisited this problem on a whim and found a solution:

Image

I just made a copy of the Platform behavior called Platform (non-stick) - it's identical, except I found this block of code and commented it out. It seems to work just as intended with no problems! This would be really useful to have as a simple toggle available in the behavior properties, though!
B
9
S
2
Posts: 28
Reputation: 649

Post » Fri Jun 10, 2016 11:19 pm

That is well worth revisiting the thread for. I think you can tweak the solid behavior in an action block.
https://www.ravenheart.ca/home
I don't check the forums much anymore, but I will receive an email for PMs.

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
23
S
6
G
1
Posts: 1,419
Reputation: 4,857


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 11 guests