Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: Rocco on Fri 23/11/2007 23:23:55

Title: Bird eye view - dont walk through objects
Post by: Rocco on Fri 23/11/2007 23:23:55
I'll use partially bird eye view in my next games, so i have one question.
How can i avoid chars from walking cross by objects or other chars?
The baseline is not enough to achive this.
Title: Re: Bird eye view - dont walk through objects
Post by: Radiant on Fri 23/11/2007 23:35:42
Have a different walkable area on the spot where an object might appear, and disable this walkable area when the object is there.
Title: Re: Bird eye view - dont walk through objects
Post by: Rocco on Fri 23/11/2007 23:39:07
im aware of that, but this is no option for me.

some objects are moving, and i also need a solution for overlapping chars.
Title: Re: Bird eye view - dont walk through objects
Post by: Ashen on Fri 23/11/2007 23:53:36
There's the Character and Object BlockingHeight/Width properties (e.g Character.BlockingHeight (http://www.adventuregamestudio.co.uk/manual/Character.BlockingHeight.htm)).
It'll form a rectangular area around the Character/Object the player can't enter (wich is already there if they're set to 'Sollid', but this'll expand it to cover the whole thing). It's not pixel-perfect unfortunetely, but it might do. Since BlockingHeight is centered on the Baseline (it'll be above and below it), you'll probably need to dynamically alter the baseline of moving Objects in the Room script - but that shouldn't be too hard.
Title: Re: Bird eye view - dont walk through objects
Post by: Rocco on Sat 24/11/2007 10:24:02
big thx, this is what im searching for.  :)
i'll check this out.
Title: Re: Bird eye view - dont walk through objects
Post by: Rocco on Thu 20/12/2007 22:09:29
unfortunatly it wont work and i dont know why.

i have this code in before fade in:

oTro.Solid = 1;
oTro.BlockingHeight = 200;
oTro.BlockingWidth = 200;

oEdsel.Solid = 1;
oEdsel.BlockingHeight = 200;
oEdsel.BlockingWidth = 200;

but i can walk across the objects without problems, there is no block around the object (with 200 the 3/4 screen should be blocked)
any suggestion whats the reason?
Title: Re: Bird eye view - dont walk through objects
Post by: Khris on Thu 20/12/2007 22:22:22
Is the player character set to solid, too?

Btw, you can do something like this in rep_ex:

  int i, h;
  Object o;
  while(i<Room.ObjectCount) {
    o=object[i];
    h=Game.SpriteHeight[o.Graphic];
    o.Baseline=o.X-h/2;
    o.BlockingHeight=h;
    i++;
  }
Title: Re: Bird eye view - dont walk through objects
Post by: Rocco on Thu 20/12/2007 23:02:18
yes, the playercharacter is solid.

thanks for the snippet, this might come in handy later on.

edit: gamesources sent

Title: Re: Bird eye view - dont walk through objects
Post by: Shane 'ProgZmax' Stevens on Fri 21/12/2007 00:34:20
You could consider using this if you can't script a working method yourself:
http://www.adventuregamestudio.co.uk/yabb/index.php?topic=26307.0