object.blockingheight & object.blockingwidt

Started by JpSoft, Thu 02/04/2009 11:35:01

Previous topic - Next topic

JpSoft

Well, im trying to adjust this functions, but i dont understand exactly what im doing bad.

Code: ags

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
Code: ags

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

Khris

Did you set object[1].Solid to true? Did you check the actual blocked area using Ctrl-A?

JpSoft

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

GarageGothic

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.

JpSoft

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

GarageGothic

I'm sorry, then I don't understand the values you use. Shouldn't blockingheight and blockingwidth be respectively 100 and 76 then?

JpSoft

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

Khris

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.

SMF spam blocked by CleanTalk