How do you read a notebook pages?

I have a notebook say on a desk.
The notebook has several pages with info on.
I want to take the notebook, read the pages and put it back on the desk.
After I put it on the desk I should not be able to read it unless I take it again.

How do you code player dropping notebook on desk after reading the last page?

1 Like

No doubt there are problems with this, but it might help a bit:

"Notebook" by Jonathan

The Study is a room.

A desk is in the Study. 

A notebook is on the desk. 
Understand "page/pages/book" as the notebook. 
The description is "[if the player holds the notebook]You read the book's pages then set it down again.[otherwise]You need to take the book to read it."

After examining the notebook:
	if the player is in the Study:
		now the notebook is on the desk;
	otherwise:
		now the notebook is in the location of the player;
		
The Landing is south of the Study.

Here’s how it goes:

Study
You can see a desk (on which is a notebook) here.

read notebook
You need to take the book to read it.

get notebook
Taken.

read it
You read the book’s pages then set it down again.

l
Study
You can see a desk (on which is a notebook) here.

read notebook
You need to take the book to read it.

get it
Taken.

s

Landing

read it
You read the book’s pages then set it down again.

l
Landing
You can see a notebook here.

2 Likes

Thanks, Will have look.

Where do you put the content of the pages?

1 Like

You could just put the words into the description quotation. The following code might look neater. Though it makes the examine/read command fail if the book isn’t held, which might be a bad thing. And it wouldn’t quite work if the player had put the book in a holdall (I think you could test that by checking whether the player encloses the notebook). No doubt there are other problems!

"Notebook" by Jonathan

The Study is a room.

A desk is in the Study. 

A notebook is on the desk. 
Understand "page/pages/book" as the notebook. 

Check examining the notebook:
	if the player does not hold the notebook:
		say "It looks interesting, but you would need to take the book to read it." instead.

Carry out examining the notebook:
	say "You read the book's pages:

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."

After examining the notebook:
	if the player is in the Study:
		now the notebook is on the desk;
	otherwise:
		now the notebook is in the location of the player.
		
The Landing is south of the Study.
2 Likes

If you want to have pages:

"Notebook" by Jonathan

The Study is a room.

A desk is in the Study. 

A notebook is on the desk. 
Understand "page/pages/book" as the notebook. 
the notebook has a number called the current page. The current page of the notebook is 1.

Check examining the notebook:
	if the player does not hold the notebook:
		say "It looks interesting, but you would need to take the book to read it." instead.

Instead of examining the notebook when the current page of the notebook is 1:
	say "You read page 1:

	Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

	Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.";
	increment current page of the notebook.
 
Instead of examining the notebook when the current page of the notebook is 2:
	say "You read page 2:

	Owner: We're closin' for lunch.

Mr. Praline: Never mind that, my lad. I wish to complain about this parrot what I purchased not half an hour ago from this very boutique.";
	now current page of the notebook is 1;
	if the player is in the study:
		try putting the notebook on the desk;
	otherwise:
		try dropping the notebook;

I would also advise using “try” instead of just moving the notebook, both to get the message that you’ve lost the book, and so that dropping it will obey the rules of the game (what if the room you’re in makes all dropped items disappear, for instance?)

4 Likes

That’s cool. But as written it lets you read the notebook without holding the book. Changing the instead ofs to carry outs, and adding some stop the actions seems to fix that.

"Notebook" by Jonathan

The Study is a room.

A desk is in the Study. 

A notebook is on the desk. 
Understand "page/pages/book" as the notebook. 
the notebook has a number called the current page. The current page of the notebook is 1.

Check examining the notebook:
	if the player does not hold the notebook:
		say "It looks interesting, but you would need to take the book to read it." instead.

Carry out examining the notebook when the current page of the notebook is 1:
	say "You read page 1:

	Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

	Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.";
	increment current page of the notebook;
	stop the action;
 
Carry out examining the notebook when the current page of the notebook is 2:
	say "You read page 2:

	Owner: We're closin' for lunch.

Mr. Praline: Never mind that, my lad. I wish to complain about this parrot what I purchased not half an hour ago from this very boutique.";
	now current page of the notebook is 1;
	if the player is in the study:
		try putting the notebook on the desk;
	otherwise:
		try dropping the notebook;
	stop the action;
		
The Landing is south of the Study.
2 Likes