Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: on Tue 11/11/2003 10:52:12

Title: if object view
Post by: on Tue 11/11/2003 10:52:12
is there a 'if object view' command?? if so how do u use it??  ???  

thanx in advance
Title: Re:if object view
Post by: Ishmael on Tue 11/11/2003 11:52:11
No, AFAIK, but you can go around it by using:

struct RoomData {
int objview[15];
}

function SetObjView(int obj, int view) {
PlrRoom.objview[obj ] = view;
SetObjectView(obj, view);
}

in the beginning of the Global Script, then, in the script header:

#define MAX_ROOM_NUM = y;
import RoomData PlrRoom[MAX_ROOM_NUM];
import function SetObjView(int,int);

replaceing the y with the highest room number you have in your game, and then you just use SetObjView instead of SetObjectView when settings them views, and when you want to check which view an object is using, just use

if (PlrRoom.objview[x ] == z)

to check it.

...

Does this work in theory?
Title: Re:if object view
Post by: on Tue 11/11/2003 13:10:22
Cheers TK,

it would work (i think) but i only need it for one puzzle, so im jus guna have a lota objects one for each view and do it like that, with the isobjecton command.

l8rs