Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: HillBilly on Fri 13/06/2003 18:01:37

Title: Remove a object in another room...
Post by: HillBilly on Fri 13/06/2003 18:01:37
Does anybody know how you remove a object from another room than you are in? Like, if you are in room 13, and then you press a button or whatever, then object 0 in room 15 will be removed.


Thanks,
-Adrian
Title: Re:Remove a object in another room...
Post by: spook1 on Fri 13/06/2003 18:28:48
You could do such a thing using global integers.

Define in the global script:
SetGlobalInt(80,0); // indicator for button pressed (0: not pressed, 1 pressed)

In room 14:

if (some action, press button e.g.) SetGlobalInt(80,1);

In room 15: (where you want the action to take place)

(Before player enters room)

if (GetGlobalInt(80) == 1) ObjectOff(0);


Hope this helps,

Martijn
Title: Re:Remove a object in another room...
Post by: Timosity on Fri 13/06/2003 18:29:08
in room 13 when you press the button

SetGlobalInt(10,1);

then in room 15 before fade in

if (GetGlobalInt(10)==1) {
ObjectOff(0);
}

Edit:yep that too
Title: Re:Remove a object in another room...
Post by: HillBilly on Fri 13/06/2003 18:46:05
Thanks, i think that will do.  :)