Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: j-Hed on Thu 04/03/2004 22:16:44

Title: turn off an obj. in another room
Post by: j-Hed on Thu 04/03/2004 22:16:44
HI!

Is it possible that when I do a certain thing in room1, object A will be removed (objectoff) in room 2?
Title: Re:turn off an obj. in another room
Post by: Darth Mandarb on Thu 04/03/2004 23:45:11
What I would do is this:

Make the action (in the room that shuts the object off in the other room) set a Global Variable to a certain value (whatever value you want)

Then, on entering the room with the effected object (before fade-in) check the value of the variable.  If it equals 1 (or whatever) shut off the object [ ObjectOff(OBJ) ].

That should do it!

~ d
Title: Re:turn off an obj. in another room
Post by: j-Hed on Fri 05/03/2004 12:00:18
Thank you Darth! i put: if (GetGlobalInt(1) == 1) {objectoff(1);}
under repeatedly excecute because room1 is a small room inside room2 so you actually starts in room2.

This works perfectly, thanks!
Title: Re:turn off an obj. in another room
Post by: computerbynar on Tue 23/03/2004 13:55:40
You can also go to the object you want to disappear, and go to interactions. Then put Conditional, if player has been to room ___. Add a child action that says, remove object ___ from  the room.
Title: Re:turn off an obj. in another room
Post by: TerranRich on Tue 23/03/2004 16:17:55
You don't have to constantly set an object off (as in repeatedly_execute), because once it's off, it's off. You don't need to put it in the repeatedly_execute; it'll only waste memory. Just put it under the interaction when the player enters the room.