[Tilemap condition] Object collided with tile of specific ID

For my game I want to check if player has collided with tile of specific ID. I’ve developed solution that kinda works (kinda as in you have to collide with tile in very specific manner), but it doesn’t work 100% of the cases and it doesn’t account for collision masks. I’d gladly appreciate an “official” way of doing it.

Another thing is to be able to get x/y of tile player just collided with (e.g. after using above condition) for example if you want to do something to that tile like changing it.

You can give your tiles unique ID’s like this:

At the beginning of the scene

For each object tile

Do = Variable(IDCounter) to Variable ID of tile.
Do +1 to Variable(IDCounter)

And of course do this anytime you make a new tile.

If you want to do something with the tile a player collided with, there are options that are better than using its x/y position to reference it. For instance, you could store its ID in a variable, use linked objects or just execute the actions in a sub event to the player collision.

Funnily enough, I’m making a game right now that is using all this kind of stuff I just mentioned doing above, so it definitely works!

You’re talking about tiles as separate objects, I’m talking about tilemap extension and tiles in tileset!

Why not just split them up if you want to reference them individually?

You still don’t get it.

I want to, get ID of a tile player collided with. As in its tile id in tileset. Let’s say in upper-left corner of tileset there are some spikes (tileID:0). Now you have many spikes in a level and you want player to die when he touch spikes. So you need to get tileID of tile player just collided with and compare it to tileID of spikes (in this case, 0).

As I said, I’ve hacked solution which kinda works, but it doesn’t account for collision masks and only works when you collide with that tile in a very specific way. So I need to have proper solution.

Also I’m tired of people who try to tell me what I want, need or what’s good for me. Do you know who knows what’s good for you or what you know/need. YOU. YOU are the only person who has this knowledge. Only YOU know what YOU need. Only YOU know what YOU want and YOU are the only person who knows what’s best for YOU. Sooner you’ll understand it, sooner you’ll get to live a good life.

However there’s one thing: YOU don’t know what is good FOR OTHER PEOPLE. YOU don’t know what OTHER PEOPLE want or need. All those people who claim they doing something “for your own good” are just masters of bullshittery. They don’t do it for your own good, because they don’t know what’s best for YOU. They are doing it for THEIR own good, most likely for selfish reasons.

Then ask for help to YOUrself :neutral_face:
Also I’m tired of people who doesn’t respect others. Come on, you could explain him that you want to use the TileMap object instead individuals objects because performance, easy edition, (insert subject reason), etc… :slight_smile:

Please, don’t be so hard. And sorry, I can’t help because I don’t use the TileMap object yet (really, I never used it) :wink:

Darkhog, I strongly disagree with how you reacted to Mats post. :angry:

He suggested to you a solution and made an effort to explain it. He didn’t say at any point that your feature request was bullshit or nonsensical. He was very polite and kindly enough to try to help you.

You are very hard in lots of posts when you answer to people. The forum is here to get help, not to make such rude answer to people trying to help you.
I appreciate a lot your involvement in the community, your suggestion or feature request, but I definitely don’t like at all the way you answered here (and again, it’s not the first time I noticed that you were rude in your answer). Come on, I cannot make you a moderator of (a part of) the forum if you keep being so hard with others members!

Again, Mats didn’t say at any point that your request was useless, he was just here to try to solve your problem with you.
If his answer didn’t satisfy your need, maybe that because you didn’t explained it well enough: if a feature is really missing in GD, other members should be able to say “I agree, this is something missing” after reading your post. That wasn’t the case: maybe Mats didn’t understand your point of view or/and maybe you weren’t clear enough.

I don’t want to get people saying that GD community is unfriendly because that you made such answers in the forum.
So please stop being so hard with people.

We’re on a forum to create games, come on! Take it easy! It’s so simple to be polite and keep calm.
Thanks! :slight_smile: