Accessing Objects from a different room

Started by KingMick, Tue 04/01/2005 18:01:53

Previous topic - Next topic

KingMick

I am wondering if there is a way in AGS to access an object in one room from a script in another room--i.e. a way to retrieve the values of the object's custom properties.  I see many uses for this ability but looking through the Help files cannot find a way to do it.  Can anyone tell me if this is possible?

Pumaman

No, you can only access objects in the current room.

Trying to access them would be very slow, since AGS would have to load the other room file, extract the relevant data, and then close it again, which would be noticably time-consuming.

Goot

You can still do it though. Set a global variable for the object and then in player enters room before fade in, for that room, put:
if(GetGlobalInt(x)==1){
ObjectOn(x);
}
else{
ObjectOff(x);
}

I think there's also a plugin for it somewhere.

SMF spam blocked by CleanTalk