Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: guv on Thu 16/10/2008 23:58:56

Title: scripting for locked doors
Post by: guv on Thu 16/10/2008 23:58:56
i dont think that this is posted before but i have checked the scripting tutoriol, video tutoriol and the getting started tutoriol...
so can anybody help me with using item from the inv to activate commands with another object
e.g using a key to open a door
Title: Re: scripting for locked doors
Post by: Daniel_1988 on Fri 17/10/2008 00:14:20
Read the topic that I have posted about gate's.
Title: Re: scripting for locked doors
Post by: TwinMoon on Fri 17/10/2008 00:21:16
Basically, go to that objects events tab, then look for "Use inv on object". Double click that.

Then, put:

if (player.ActiveInventory == iKey) {
  oDoor.Visible = false;
}


(this will assume you used an inventory item called iKey and remove an object called oDoor from the room.)
Title: Re: scripting for locked doors
Post by: Khris on Fri 17/10/2008 00:22:31
This is one of the most posted question of all times...

You can use "player.ActiveInventory" to check for the right inv item.

Unfortunately you're right about this not being explained in the manual's tutorial.
Title: Re: scripting for locked doors
Post by: guv on Fri 17/10/2008 07:41:32
thanks everyone my doors finished now:)