[ 9 posts ]  Reply to topicPost new topic 
Author Message
 [us]
 Post subject: Help with separating the player from other objects
PostPosted: Sat Sep 02, 2017 6:47 pm 
User avatar
S̛̜̭͚̗͚̪͚̃ͯ̑̉̾̍̎O͙͈̻͖̣͍ͬͨͧO̯̮̯̠N̩̫̣͛̔
Member
[*]
[*]
[*]
[*]
Much like a stalker with a day job, I disappear then come back to this site.

The title for that sucks, but basically I'm taking another shot at a game.

Basically there are one way platforms for the player to jump on from under them. That works fine. The platform works by getting the player's y positioning then determining whether to turn on the mask for its collision or not based on the player's height. That also works fine.

However, it works too fine. When the player is standing under the one way platforms, enemies and other objects that collide with the one way platforms will pass through them since the collision mask is turned off.

Since I have the coding skills of a whale wearing mittens, I don't have the slightest clue on how to approach the solution. The solution being to separate the player object from other objects that the one way platforms checks for, so it can turn off collision from the bottom sides when the player is under the platform without affecting non-player objects using the platforms.

_________________
What most people consider trying, I consider overachieving.
 
Top
Offline 
 User page at mfgg.net
 
 [us]
 Post subject: Re: Help with separating the player from other objects
PostPosted: Sat Sep 02, 2017 7:54 pm 
User avatar
¿
Good At French
[*]
[*]
[*]
[*]
I'm just taking a wild guess, but would it be possible to create two identical versions on top of each other, one affecting the player only while the other one affects enemies only?

_________________
"90 percent of everything is crap" - Some guy named Theodore
 
Top
Offline 
 User page at mfgg.net
 
 [us]
 Post subject: Re: Help with separating the player from other objects
PostPosted: Sat Sep 02, 2017 8:25 pm 
User avatar
S̛̜̭͚̗͚̪͚̃ͯ̑̉̾̍̎O͙͈̻͖̣͍ͬͨͧO̯̮̯̠N̩̫̣͛̔
Member
[*]
[*]
[*]
[*]
littlelum wrote:
I'm just taking a wild guess, but would it be possible to create two identical versions on top of each other, one affecting the player only while the other one affects enemies only?

Maybe, but a brute force option like that generally doesn't work well for optimization, nor for keeping the level's tidy and easy to edit. I'd rather have a clean solution than brute forcing it.

_________________
What most people consider trying, I consider overachieving.
 
Top
Offline 
 User page at mfgg.net
 
 [us]
 Post subject: Re: Help with separating the player from other objects
PostPosted: Sat Sep 02, 2017 11:14 pm 
Always have Jason Voorhees in your sig
Member
[*]
[*]
[*]
[*]
[*]

I don't use game maker so if this solution isn't possible, sorry. But maybe:

Try turning the thing's mask on from the code in the player object before the player tests collisions, then turning it right back on?

_________________
Image

Image Image
Bibby Team | MFGG3 Github
 
Top
Offline 
 User page at mfgg.net
 
 [us]
 Post subject: Re: Help with separating the player from other objects
PostPosted: Sun Sep 03, 2017 4:35 pm 
User avatar
S̛̜̭͚̗͚̪͚̃ͯ̑̉̾̍̎O͙͈̻͖̣͍ͬͨͧO̯̮̯̠N̩̫̣͛̔
Member
[*]
[*]
[*]
[*]
HylianDev wrote:
I don't use game maker so if this solution isn't possible, sorry. But maybe:

Try turning the thing's mask on from the code in the player object before the player tests collisions, then turning it right back on?

Turning off the collision for all objects for the platform would mean, even if collision was off for just a step, the enemies and such using it would fall through it.

_________________
What most people consider trying, I consider overachieving.
 
Top
Offline 
 User page at mfgg.net
 
 [tr]
 Post subject: Re: Help with separating the player from other objects
PostPosted: Sun Sep 03, 2017 6:11 pm 
User avatar
Thanks DonnieTheGuy!
Administrator
[A]
[*]
[*]
[*]
[*]

[*]
[*]
[*]
[*]
[*]

[*]
[*]
[*]
[*]
[*]

[*]
[*]
[*]
[*]
[*]

[*]
create 2 types of solid objects
let's call them obj_solid and obj_solidtop
make it so obj_solid's parent is obj_solidtop
then make it so the wall and ceiling collision codes only apply to obj_solid while the ground collision code only applies to obj_solidtop

_________________
Image
 
Top
Offline 
 
 
 [us]
 Post subject: Re: Help with separating the player from other objects
PostPosted: Sun Sep 03, 2017 6:40 pm 
Always have Jason Voorhees in your sig
Member
[*]
[*]
[*]
[*]
[*]

moonrat wrote:
HylianDev wrote:
I don't use game maker so if this solution isn't possible, sorry. But maybe:

Try turning the thing's mask on from the code in the player object before the player tests collisions, then turning it right back on?

Turning off the collision for all objects for the platform would mean, even if collision was off for just a step, the enemies and such using it would fall through it.

It wouldn't be for a step, it would only be from the beginning of Mario's collision code to the end of it.

All of the game objects are in a linear list and their step functions run one by one. Their code will not run in the middle of Mario's code.

_________________
Image

Image Image
Bibby Team | MFGG3 Github
 
Top
Offline 
 User page at mfgg.net
 
 [ca]
 Post subject: Re: Help with separating the player from other objects
PostPosted: Sun Sep 03, 2017 9:04 pm 
User avatar
Silly guy
Member
[*]
[*]
[*]
[*]
[*]

[*]
[*]
[*]
[*]
[*]

[*]
[*]
Mors wrote:
create 2 types of solid objects
let's call them obj_solid and obj_solidtop
make it so obj_solid's parent is obj_solidtop
then make it so the wall and ceiling collision codes only apply to obj_solid while the ground collision code only applies to obj_solidtop

Listen to Mors

This seems most logical. I had the same exact problem before!! Of course I didn't know what to do either. This is perfect, as if someone didn't know this at the same time I've been trying to figure this out!!!

Thanks Mors

_________________
Image
 
Top
Offline 
 User page at mfgg.net
 
 [us]
 Post subject: Re: Help with separating the player from other objects
PostPosted: Mon Sep 04, 2017 9:07 pm 
User avatar
Kootie Patootie
Member
[*]
[*]
[*]
[*]
[*]

[*]
[*]
[*]
[*]
[*]

[*]
[*]
[*]
[*]
[*]

[*]
[*]
I always just had the player's collision check which object it's colliding with, and disregard vertical collisions with jumpthrough platforms, but that's just me.

_________________
Image
My mains
 
Top
Offline 
 User page at mfgg.net
 
« Previous topic | Next topic »
Display posts from previous:  Sort by  
 [ 9 posts ]  Reply to topicPost new topic 


Who is online

Users browsing this topic: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group