I6: Object / Noun Question?

Slowly but surely, I’m making progress!

Where I’m currently hung up is, I’m trying to allow the player to write a note. In my code I have created a notepad and a pen. I also have a note (has concealed) that I will move to the player’s inventory once it has been written.

Here’s where I get lost. The way I read the documentation, when looking for nouns I am looking for the object’s name. If I write if noun == “note”, nothing triggers. And I can’t write if noun == note because the player doesn’t have the note yet. I can get around this by adding ‘note’ as a name to the pad of paper, but I don’t think that’s right because the player can now type WRITE PAPER and it will write the note for them (which I really don’t want).

I hope I have given enough information for this to make sense.

Pertinent code:

Verb ‘write’ ‘create’
* -> Write
* noun -> Write
* ‘on’ noun -> Write;

[ WriteSub;
if (noun == nothing) “You don’t feel all that inspired.”;
if (noun == couch) “Don’t write on the couch, please.”;

Object -> -> Notepad “notepad”
name ‘pad’ ‘notepad’ ‘paper’,
description “It’s a small notepad, with about half the pages left. You used to write your grocery lists down on the pad back when you had money for groceries. You know, maybe with a little mustard … nah.”,
Before [;
Write: if (pen in player && notepad in player) {
print_ret “Using the pen and pad of paper, you scribble out a coupon.”;
} else {
print_ret “You’re going to need both something to write with, and on.”;

Object note “note”
name ‘note’,
description “This will be the note.”,

… something like that, anyway.

I figured it out – or, rather, I figured out a way around it.

I changed the pad of paper to a single piece of paper (a napkin, actually). That fixed the part about trying to replace one object (the pad of paper) with another (a coupon). Once I made that change, I simple used the object.description = “…” to update the description and reflect the modified piece of paper. Baby steps …

[i]Dining Room
The word “room” is a bit of a misnomer; it’s more of a nook really, and a sparse one at that. In the middle of the room sits a table and two chairs (wishful thinking on your part). Your kitchen is to the south, and the living room is to the west.

You can see a table (on which are a napkin and a pen) here.

examine napkin
It’s just an unused Taco Flaco napkin.

get napkin

get pen

write coupon
Using the pen, you write “COUPON” across the top of the napkin in bold letters. Below that in smaller letters, you write “10 TACOS FOR A DOLLAR”.

[Your score has just gone up by one point.]

examine napkin
It used to be a Taco Flaco napkin; now, it’s a coupon. The craftsmanship is so shoddy it wouldn’t fool most illiterate children … and yet, Taco Flaco continues to accept them for some reason. Perhaps, because of your penmanship, they think you’re mentally handicapped.


I want to play this game!