Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: GarageGothic on Wed 04/05/2005 15:25:50

Title: referring to objects by name in global script
Post by: GarageGothic on Wed 04/05/2005 15:25:50
I was wondering if there's any way of calling a room object by it's o-name in the global script? I have some code that I'd like to use for several rooms but only call for the ones where it's necessary. But of course AGS doesn't know where it will be used, so it fails to compile due to an unknown o-name referred.

I can use object
Title: Re: referring to objects by name in global script
Post by: Pumaman on Wed 04/05/2005 18:33:33
This is not easily possible to do. The easiest workaround is probably to put something in on_event(EnterRoom) to loop through all the objects in the room and do the GetName check.
Title: Re: referring to objects by name in global script
Post by: GarageGothic on Wed 04/05/2005 19:49:20
Good idea. Thanks!