Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: on Wed 26/11/2003 20:30:08

Title: How can I use an object with another object?
Post by: on Wed 26/11/2003 20:30:08
How can I use an object with another object?
Example: a key to open a door
Title: Re:Question
Post by: Scorpiorus on Wed 26/11/2003 23:40:01
Well, your player character has to have a key item in his inventory. Then you click with that key on the door object.

So, you need to handle interaction event when you have clicked on the door.

Open object interaction editor, then choose use inventory on  object. In the list box select Conditional - if inventory item was used and set key item number. Push OK and you'll see a child action Do nothing. Here you replace it with any action you want. For example, you can animate the door object to make it open or whatever. Replace Do nothing with Object - Start object animating

How progressing?
Title: Re:Question
Post by: on Thu 27/11/2003 06:19:28
Tnx.
And how can I assaign object a view? ???
Title: Re:Question
Post by: Reno Caspain on Thu 27/11/2003 07:53:33
There might be easier way to do it, but at least this works.. Run a script under room interaction Player Enters Room. Script would be something like this:

SetObjectView(NUMBER OF OBJECT,NUMBER OF VIEW);

So, for example the code on setting view 4 to object 2 is

SetObjectView(2,4);
Title: Re:How can I use an object with another object?
Post by: Scorpiorus on Thu 27/11/2003 10:46:22
Yeah, or use the interaction editor's Object - set object view number action.

~Cheers