Crossing pathways

Started by Kinoko, Sun 08/05/2005 14:09:08

Previous topic - Next topic

Kinoko

I'm sure this is obvious to everyone but me, but id it possible to have an area with multiple walkways on different levels, ie, The character can walk on the same x/y coords but be on a different pathway depending on where he comes from. Really, I've no doubt it IS possible but I'm not sure how to do it since I've never needed this feature before.

Snarky

I think you have to make separate walkable areas for the overlapping sections, then write code that keeps track of which level the character is on and enables and disables the surrounding walkable areas accordingly (as well as setting the character scaling and walkbehinds).

TerranRich

The thing is, I believe you can't have overlapping walkable areas. Drawing WA #2 over WA #1 will cut through WA #1's area at the place they cross, if i'm not mistaken.
Status: Trying to come up with some ideas...

Gilbert

#3
You can't, but you can do it as Snarky mentioned.
There's one screen in WMHM doing similar thing (when the snail has to find the paper pieces in the tree), that worked quite well but there're some small problem with clicking to reach the destination (you need 2 clicks there), which can be improved. However, since you had mentioned (I think) that your game needs keyboard control only, I think it will work without any problem.

Say for example, if you want to have a horizontal bridge above a vertical road, you can draw the walkable areas like this.


Ã, Ã,  Ã,  111
 Ã,  Ã,  111
 Ã,  Ã,  111
2222233322222
2222233322222
Ã, Ã,  Ã,  111
 Ã,  Ã,  111
 Ã,  Ã,  111

Where area 1 is that vertical road on the lower level, area 2 is the bridge, and area 3 is the overlapping area.
You can use whatever method you want to keep track on which level the character's on (like using a variable, say for example), if the character's on the upper level (bridge), disable area 1 to prevent her from walking into it, when she's on the lower level (road), disable area 2.
That's pretty much like it, but if you use character scaling you may also need to script in the change in area scaling of area 3 according to where the character's at (note, may need more work if you use continuous scaling).

EDIT: I forgot, to make the character covered by area 3 when she's under the bridge but visible when she's on the bridge, you may need to mess with the baselines to do that. OR: if the game's designed if she's on the bridge, no other part of bg will be over her, just use
character[EGO].IgnoreWalkbehinds = 1;

strazer

#4
Additional problems arise if you also want it to work with NPCs, not just the player character.
This tracker entry might come in handy in the future.

Edit:

Btw, here's a template by Scorpiorus demonstrating the technique:
http://www.geocities.com/scorpiorus82/stairs10.zip (right click/save as)

Kinoko

Gosh, this is more complicated than I had originally though @_@ But thanks for all the info guys! I think I can do it for the PC anyway and I might just have to make sure there aren't any NPCs nearby.

SMF spam blocked by CleanTalk