Get Custom Tile Data when tile is walked on (platformer)
by Greg C · in Torque Game Builder · 10/06/2013 (5:17 pm) · 4 replies
Is there a way to hook into a player walking on each tile and then evaluating the custom data of the tile they are on. I plan to have tiles do certain things like make the player take damage, slow the player down, etc.
oncollision didn't seem to help for this because it would only invoke the oncollision callback when a tile was jumped on, not just walked over. How do we utilize custom data from all tiles in the event we just walk over them?
oncollision didn't seem to help for this because it would only invoke the oncollision callback when a tile was jumped on, not just walked over. How do we utilize custom data from all tiles in the event we just walk over them?
#2
I noticed if I made the trigger really large that it made my character move funny in that whole area, I would suddenly jump higher and sorta sink into the trigger and then even into the floor a tiny bit as I mentioned earlier.
This effect was even more drastic when I was using castCollision to detect walls, as in my other thread. So I am lead to believe that it has something to do with collisions/physics with my player, but I turned off send/receive physics and collision, but the problem still remains.
Any ideas?
10/08/2013 (5:17 pm)
I had attempted triggers, but when I stretched one horizontally over the tiles where I wanted to perform a specific action, I would fall a little into the floor instead of on it.I noticed if I made the trigger really large that it made my character move funny in that whole area, I would suddenly jump higher and sorta sink into the trigger and then even into the floor a tiny bit as I mentioned earlier.
This effect was even more drastic when I was using castCollision to detect walls, as in my other thread. So I am lead to believe that it has something to do with collisions/physics with my player, but I turned off send/receive physics and collision, but the problem still remains.
Any ideas?
#3
10/08/2013 (5:21 pm)
I also just found that it makes it so the tiles that the trigger covers no longer have collision, I can go right through them. Which is probably why I fall into the floor a little while I'm in the trigger. Is this a known behavior? If so, how do I turn it off?
#4
Another option is to place your custom data on the "empty" tile that the player is walking through instead of the one that the player is standing on - wait, we are talking about a side-scrolling platformer, right?
I might have to start playing with TGB more - it's been a while....
10/08/2013 (5:29 pm)
That's really weird. Just on a lark check the physics section of the trigger to ensure that it doesn't have one, or if it does to ensure that everything in it is disabled.Another option is to place your custom data on the "empty" tile that the player is walking through instead of the one that the player is standing on - wait, we are talking about a side-scrolling platformer, right?
I might have to start playing with TGB more - it's been a while....
Torque Owner Richard Ranft
Roostertail Games