About the material function, the DizzyAGE Book saids:
int MaterialRead( x, y, w, h )
IN int x horizontal coordinate in room [0..GameGet(G_ROOMW)-1]
IN int y vertical coordinate in room [0..GameGet(G_ROOMH)-1]
IN int w width
IN int h height
OUT int found materials, on bits
So, as macon said, you have to give the coordinates relative to the room, because they are tested in the material map, and that has the room's size (in fact it's a little bigger, but that's handled internally, so you can test a small outer border too - like when Dizzy stays half outside the room).
Converting the coordinates is easy: just use object_x %room_width (the rest of the division of the world coordinate by the room's size)
The output info is set on bits.
So if material 11 is found inside the specified box, the bit 11 of the returned value will be set. If only that material is inside the returned value is ( 1 < < 11 ) that is 2048. If air is also in the box (air=0) bit 0 will also be set. So for both materials we'll have ( 1 < < 11 ) | ( 1 < < 0 ) that is 2048 + 1. Check the GS9 book for bit operations.
To test if the bit for a certain material was set, do like this:
mask = (1<<11);
if( (ret_value & mask) != 0 ) .... material found.
// or for more materials (11 and 4)
mask = (1<<11) | (1<<4)
mask = (1<<11); if( (ret_value & mask) != 0 ) .... material found. // or for more materials (11 and 4)
mask = (1<<11) | (1<<4)
Don't test with >=2048 because it will be true for material 12, even if 11 is not present.
Now, about these material testing functions, they are tricky to use. You must test specific bounds, not necessarily the whole bound of the brush. The movement code, for example, tests a small area below the player to see if solid is there. Also water material is tested only on the pixel that corresponds to the player's mouth. The MaterialGetFreeDist can tell you the distance until a solid material is reached. You must check the movement script to better understand them.
------
There's no B_CLASS defined because usually static brushes don't need to act like dynamic objects. But if you want, you can declare it (with the same value as O_CLASS) and use it in your code. Though you have to check if this property is saved in the map by the editor (for static brushes) - In the first DizzyAGE I had some map size optimization, but I think all properties are saved now.
Alex