A man, a dog and a table...need help

Started by Panzatouch, Mon 09/03/2009 11:54:54

Previous topic - Next topic

Panzatouch

Hello everybody,   :)

I'm creating my first game and I have a question. I will illustrate it by this example:

Two characters are in a room: a man and a dog. There is also a table. The table is part of the background. The dog can walk under the table, the table become a "walkbehind" area for this dog. The man is not able to walk in the area under the table and mustn't be hidden by the table.

The problem is that I don't know haw to do this. If someone could help me...  thanks'

Panza

PS: excuse me for my rough english, I'm french   :-\

SSH

Can the user directly control them both? If they just control the man, it will be easy enough to get the dog to ignore walkable areas in the script commands you use to move it about.
12

Panzatouch

in fact, they control the dog. So the man won't walk over the table "area" if it is not typed in the script.

But the matter is that if the man stand  in front of the table, he will be hidden by the "walkbehind" area defined for the dog.

It's quite difficult to explain...
                                                                ______
                           The table----------->     |__o___|
                                                                |   L     |
                            The  man---------------->   ^

On this "clear" picture ( ;D ) the man is lower than the baseline defined for the "walkbehind: table" which was create for the dog. There is no problem. In my case, the table is slanting (does this word exist?  ??? )  :
                            ___   
                           /    /|
                          /    o
                         /__/L
                         |   |^______________(baseline)

In this case, the man is higher than the baseline defined for the table, so his head is hidden by it. This is my problem.


Pumaman

The easiest solution would be to reduce the walkable area so that the man can't walk close enough to the table to overlap it.

The other option is to split the table up into a few different walk-behinds with different baselines to get around this problem.

Khris

If there's nothing else using baselines near the table, you could also use a region: in its walk onto event, set the man's baseline manually to a value greater than the table's, then reset it to their feet if the man walks off the region.

Panzatouch

Quote from: Pumaman on Tue 10/03/2009 00:18:03

The other option is to split the table up into a few different walk-behinds with different baselines to get around this problem.


Quote from: KhrisMUC on Tue 10/03/2009 02:28:13
If there's nothing else using baselines near the table, you could also use a region: in its walk onto event, set the man's baseline manually to a value greater than the table's, then reset it to their feet if the man walks off the region.

I think some "mix" between those two solutions will solve my problem. Thanks a lot !!!  ;D


One last question, is there any function in AGS for creating a walkable area on which only one or two character can walk?

Khris

No.

The only workaround that comes to mind is pretty weird: duplicate the walkable areas (using new IDs), moving them like 100px further up the screen (or even further, so that the two sets don't overlap), then set the second character's z - coord to 100.
You'll have to set that character's baseline manually to player.y + player.z every game loop to keep up proper walkbehind behavior.

Now you can turn walkable areas on and off for each character.

Panzatouch

YEAH !!! this will solve the problem of the walkable area !  :D

Thank's a lot !!!

SMF spam blocked by CleanTalk