Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: JpSoft on Thu 02/04/2009 11:35:01

Title: object.blockingheight & object.blockingwidt
Post by: JpSoft on Thu 02/04/2009 11:35:01
Well, im trying to adjust this functions, but i dont understand exactly what im doing bad.


object[1].blockingheight(50);
object[1].blockingwidth(38);


What i get with this is a 100 pixels height rectangle, with the center in the low line of the object, but i want that the blocked area  exactly the same as the object image (100x76 pixels)

so i do this

object[1].baseline = object[1].y-50;
object[1].blockingheight(50);
object[1].blockingwidth(38);


but the blocked area is exactly the same as before.

I dont have the source code here, so maybe i wrote some words wrong, but i believe the idea is clear. The manual says that the blocked area starts from the baseline in both directions (up and down)

All the objects are randomly positioned when the players enters the room.

Jp
Title: Re: object.blockingheight & object.blockingwidt
Post by: Khris on Thu 02/04/2009 12:17:51
Did you set object[1].Solid to true? Did you check the actual blocked area using Ctrl-A?
Title: Re: object.blockingheight & object.blockingwidt
Post by: JpSoft on Thu 02/04/2009 12:22:03
Yes, the object is solid (characters move around it) and clickable (you can select it)

Yes, i check the walkable area continuosly. I even created a shortcut to change the blocking area at run-time pressing one key, but the walkable area dont change

Jp
Title: Re: object.blockingheight & object.blockingwidt
Post by: GarageGothic on Thu 02/04/2009 12:48:25
I take it you're using lo-res coordinates in a hi-res game? If so, shouldn't "object[1].baseline = object[1].y-50;" be "object[1].baseline = object[1].y-25;" since the blocking area extends on both sides of the baseline? Though of course this doesn't solve your problem of the area remaining the same.
Title: Re: object.blockingheight & object.blockingwidt
Post by: JpSoft on Thu 02/04/2009 12:57:45
Im using AGS 3.1.2 SP1, the game is 640x400 andI'm using hi res coordinates always and until now they work properly in everything. The blocked rectangle is actually 100x76 pixels.

JP
Title: Re: object.blockingheight & object.blockingwidt
Post by: GarageGothic on Thu 02/04/2009 13:03:05
I'm sorry, then I don't understand the values you use. Shouldn't blockingheight and blockingwidth be respectively 100 and 76 then?
Title: Re: object.blockingheight & object.blockingwidt
Post by: JpSoft on Thu 02/04/2009 21:19:14
Yes, my fault. I were confused since in the dinamic help specifies that if you pass any number, the blocked area will be the middle in each direction. Anyway, i tried today with every value between 0 and 200, and the blocking area is always centered in the bottom pixel of the image.

Jp
Title: Re: object.blockingheight & object.blockingwidt
Post by: Khris on Thu 02/04/2009 21:58:42
Indeed. It's either explained wrong in the manual or, more probably, a bug.
As a workaround, you could use a character instead of the object and change its .z coord.