Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: suicidal pencil on Wed 06/01/2010 21:34:11

Title: object manipulation outside room
Post by: suicidal pencil on Wed 06/01/2010 21:34:11
Is there a way to mess around with objects outside their room? Some of the games I currently have on the burner have an extreme amount of use and abuse of objects, and I'd like to make a module for the plethora of functions that have been made for these games, but I'm not completely sure this is possible.
Title: Re: object manipulation outside room
Post by: discordance on Wed 06/01/2010 21:56:38
I believe you can access the object array globally, but of course by array index, not by actual name. It's a little more awkward.
Title: Re: object manipulation outside room
Post by: monkey0506 on Wed 06/01/2010 22:09:42
I'm not exactly what you meant, but you can only ever work with the objects in the room you're currently in (even when using the object array) because objects are stored as part of each room and the room's memory gets loaded/unloaded with the room itself.

If you need to access an object from another room, look for Steve's OtherRoom module. Otherwise you can use the object array. But note that you can only use the object script o-names (such as oDoor, etc.) in their owning room's script file.
Title: Re: object manipulation outside room
Post by: suicidal pencil on Wed 06/01/2010 22:45:17
I wasn't aware that the object array was global. That actually makes everything much easier now. Thanks!

Title: Re: object manipulation outside room
Post by: Dualnames on Fri 08/01/2010 13:02:13
Quote from: suicidal pencil on Wed 06/01/2010 22:45:17
I wasn't aware that the object array was global. That actually makes everything much easier now. Thanks!



There's also the other room plugin which might end up handy..
Title: Re: object manipulation outside room
Post by: Gilbert on Fri 08/01/2010 13:15:06
Quote from: Dualnames on Fri 08/01/2010 13:02:13
There's also the other room plugin which might end up handy..
... like Monkey had mentioned already? :P
Title: Re: object manipulation outside room
Post by: Dualnames on Fri 08/01/2010 13:28:34
Quote from: Gilbet V7000a on Fri 08/01/2010 13:15:06
Quote from: Dualnames on Fri 08/01/2010 13:02:13
There's also the other room plugin which might end up handy..
... like Monkey had mentioned already? :P

Damn, I ead his post, 3 times and didn't notice it... ;)
Title: Re: object manipulation outside room
Post by: monkey0506 on Fri 08/01/2010 15:39:53
Yeah except the OtherRoom plugin was a plugin which made it Windows only whereas the OtherRoom module is a script module which makes it portable. :P

So technically Dual didn't mention the same thing as me...just what I mentioned was better. :D
Title: Re: object manipulation outside room
Post by: Dualnames on Fri 08/01/2010 15:44:46
Quote from: monkey_05_06 on Fri 08/01/2010 15:39:53
Yeah except the OtherRoom plugin was a plugin which made it Windows only whereas the OtherRoom module is a script module which makes it portable. :P

So technically Dual didn't mention the same thing as me...just what I mentioned was better. :D

But you're both unaware that I mustyped plugin adn I was referring to the module. 8)
Title: Re: object manipulation outside room
Post by: Pumaman on Sat 09/01/2010 17:30:17
Quote from: suicidal pencil on Wed 06/01/2010 22:45:17
I wasn't aware that the object array was global. That actually makes everything much easier now. Thanks!

Well, it only allows access to objects in the current room. What it does allow is for non-room scripts to access those objects.