Author Topic: Problem with teleporter going to same point  (Read 1115 times)

the bread

  • Jr. Member
  • **
  • Posts: 67
    • View Profile
Problem with teleporter going to same point
« on: April 02, 2015, 07:06:23 pm »
Hello,
I have two maps in a dungeon. One has got a hole surrounded by some traversable ground and thin walls, as in attachment 1
The other one is over the first one and has got traversable ground with a hole around, as in attachment 2
So i want the hero to fall from the hole in the second map down to the traversable ground in the first map. To achieve that I use teleporters in the circular hole of the upper map that keep the same point. But something very strange is going on: When I fall into the hole from the left or from the right, everything works fine, which means the hero respawns at the correct x-coordinate in the lower map. But when I enter the ring-shaped hole from the north, I am stuck in a wall of the lower map, though it doesn't look like the hero is touching the wall somehow.
So far I've tried the following:
1. I've tried to move the hole in the upper map 8 pixels to the north and to the left. If I move it to the north, the hero is stuck in the wall too, but this time he also looks like he is stuck in the wall. When I move it to the south, the hero spawns not exactly at the correct place, as my check number 3 showed, but he is not stuck in the wall. Instead, I'm stuck in the wall when entering the upper hole from the south. So apparently my teletransporters in the upper map seem to be placed at the right position, still the hero can't move when he respawns in the lower map
2. I've checked for some invisible barriers that might block the hero when he's falling down, though he spawns at the right position. But I was able to walk around the hole when I respawned at a correct place.
3. I've put some sensors around the hole in the lower map to check whether the hero is landing at the correct point. Result: Neither when I fell down from the north, nor when I fell down from the south, the sensors were triggered. When I landed at the east of at the west, the sensors were triggered.
4. I've checked whether the circular hole in the upper map has the same size as the circular traversable ground in the lower map. This is the case.

So this doesn't seem to make any sense. Please anyone help!
The bread


Christopho

  • Administrator
  • Hero Member
  • *****
  • Posts: 1172
    • View Profile
Re: Problem with teleporter going to same point
« Reply #1 on: April 02, 2015, 09:11:19 pm »
It is possible to be stuck in a wall when landing, because the hole is triggered when a specific point of the hero (the 8,11 point I think, but it does not matter so much) overlaps the hole. The whole 16x16 bounding box of the hero does not have to overlap the hole. For example, a 8x8 hole is enough to fall. So what I am saying is that it is normal that the hero can land on a wall if you are not careful. The behavior is different in all 4 directions because 8,11 is not the center (actually, no point can be the exact, symmetrical center).
So this makes holes tricky indeed… Most of the time, I avoid to use the "same coordinates" setting. What you can do if you don't want to use destinations, is to calculate some correct coordinates yourself from the teletransporter:on_activated() event.

Anyway, I should check all case you are describing to see if there are bug or if the behavior is expected.

the bread

  • Jr. Member
  • **
  • Posts: 67
    • View Profile
Re: Problem with teleporter going to same point
« Reply #2 on: April 03, 2015, 07:28:25 pm »
I'm not exactly understanding everything now, though a lot of things seem to make sense now thanks to your response. But for example, if I enter a hole from the west the hero would fall as soon as 8 Pixels of him overlap the hole (assuming the origin point is 8,13). Which would mean that the 8 Pixels of the hero that didn't overlap the hole when the teleporter was triggered would be stuck in the wall in my case. But entering the hole from the west works correctly, the hero even respawns at the exactly correct position (checked with a sensor). So do I have an error in reasoning or is the <same point> value somehow calculating its own new position for the hero in order to let him respawn more correctly?