How to do a "look at" object command? (Solved)

I have coded in a quest for the player to find the key to be able to lock their apartment on their way out after throwing it on the couch the night before. I coded a menu that asked if the player wanted to search the couch.

Saying "Yes" would open the couch and show the key inside. However, I don't want to use the "Places and Objects" window.

I don't want to make the player look at the couch twice since that would be boring. I just want to know how to make the word "a key" into a link that would be able to have "look at" right after the couch is "searched" the first time.

Ether that or I want to know how to make the script for the "look at" in an object appear on screen without having the player write it in.

If the couch is a container, there's an option to display its contents when it's opened or looked at. That includes displaying a link.

If you're using your own script to open it, you could output a message like:

Between the cushions you find a {object:key}.

In a message like that, you use the name of the object, but Quest displays its alias if they're different.

Or you could do something like:

You see {object:key:something metal} glinting down the back of the couch.

In this case you can make it display different text, but clicking the link will allow the player to interact with they key.

Or a third option:

There's a {command:look at key:rusty key} in there.

That would display "There's a rusty key in there.", but clicking the link will enter the command "look at key" as if the player typed it. This is the only one where you use the object's alias rather than its name.

Hope that's helpful; if I misunderstood what you wanted, let me know.

Really is there any reason to make the couch a container containing the key. Just make the key invisible in the room.
Making the key visible can be triggered by ‘Do you want to search the couch’ “ yes .” The player can’t see where it is, and will assume it’s on the couch, especially if you add a message “ Oh look here’s the key ,on the couch.” Take key could have a first time message of ‘ You pick up the key off the couch’

For something like searching the couch, I would probably have made it a surface with "Hide children until object is looked at" and "List children when object is looked at or opened" checked.

Gives the results:

==> Look at couch

It's your couch. It looks about the same as it always does.
On it is a key.

(with the key being hidden until the couch is looked at)

Thank you! It is finally solved. I think what happened was that I wrote {object:key} wrong and put in {Object: key} instead. I did search a lot in the forums and the documentation in quest to find out how to solve it. I'm glad I could get some help.

Log in to post a reply.