Walking on non-walkable

Started by AndersM, Thu 11/03/2004 08:23:09

Previous topic - Next topic

AndersM

My character walks wherever he wants. I have a at least 4-5
pixel whide area that is not-walkable,(Not filled with any
walkable-area-colour) but the character just walks across it.
It looks strange since there is a table in that area, and he just
walks right trough it.

Hov do I stop him from doing this? I can't make the
not-walkable-area whider, 'cos the room is not that whide...

Gilbert

That's strange, are you sure the character walk through the non-walkable areas (classic notation: walls) directly or he just move afound it?

Judging from your description we cant draw much conclusion on the problem, since we don't know by "moving" the character what you're using.

So, check also that the moves weren't done by using "MoveCharacterDirect()" which will ignore the "walls" and make him walks through them.

AndersM

Update with explanations: There are a table in a room that stands like a counter out from the wall (there are walkable areas on tree sides of it) The player character starts behind the table, and when you click with the walk-to cursor on the area infront of the table, sometimes he walks around the table, and sometimes he walks right trough the table. I've checked the walkable areas 3 times and made the 'non-walkable-area' between the one behind the table and the one infront of the table whider each time, but 50% of the times I click he still walks trough the table... *confused*

Gilbert

In that case, check your character's walking speed, it actually (sorta) determines the pixel increment he'll walk each game loop, if it's set too high, chances are, you need thicker "walls" to prevent him from squeezing through it.

Also, check that if there are "diagonal gaps" in the "walls", like:

OX
XO

In above X is "wall" O is walkable, the character may be able to squeeze thru from the top-left O to the bottom right O and vice versa.

Robert Eric

What is your character's X and Y walking speeds?
Ã, Ã, 

AndersM

Here is the room and the walkable area. If the player character stands in the position behind the table, and you click with the 'walk-to cursor on the walkable area infront of the table, he just walks right trough the table



Movement speed is  3
Animation speed is 5


Pumaman

I think the real problem isn't the size of the gap, but rather the height of the actual walkable areas. Try making them at least 3-4 pixels high each, with at least a 4 pixel non-walkable area in between.

AndersM

The room does not have room for that...

Darth Mandarb

Just a suggestion:

I would make the tables as objects.

Then make the (left-to-right) walkable areas 1 pixel wider each.
(Add one row to the top and one row to the bottom)

I found that sometimes not changing the space between walkable areas, but just increasing their over-all size, does the trick.

I don't know why, but it worked for me.

Or maybe just removing the inner row of pixels from the bottom walkable area and adding another row to the bottom of it might work too.

Man I hope this makes sense ...

Good luck!

~ d


SMF spam blocked by CleanTalk