intfiction.org

The Interactive Fiction Community Forum
It is currently Sat Feb 23, 2019 4:54 am

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Sun Feb 10, 2019 1:24 pm 
Offline

Joined: Fri Oct 06, 2017 8:19 am
Posts: 35
I have a clown car in my game.

Inside the car is a honk-honk horn.

I want to prevent the player from being able to honk it when they are not inside the car. - I think I need 'scope' for this but struggling to get it to work.

I'd also like to be able to control what contents of the car can be seen from the outside.

Thank you!


Top
 Profile Send private message  
Reply with quote  
PostPosted: Sun Feb 10, 2019 4:01 pm 
Offline

Joined: Tue Mar 09, 2010 2:34 pm
Posts: 5568
Location: Burlington, VT
For the first part, you can use a rule for reaching inside:

Code:
Circus is a room.

A clown car is a vehicle in Circus.

A honk-honk horn is in the clown car.

Before taking the horn: say "You can't remove that from the vehicle." instead.

Instead of squeezing the horn: say "HONK[paragraph break]".

Rule for reaching inside the clown car:
   say "You'll have to get into the clown car.";
   deny access.


(I'd say you might want to have the horn be part of the car, but then the Rule for Reaching Inside wouldn't work.)

For the second one, you can begin by looking at "omit contents in listing from §18.10 of writing with inform:

Code:
Circus is a room.

A clown car is a vehicle in Circus.

A honk-honk horn is inside the clown car.

A matchbook is inside the clown car.

Before taking the horn: say "You can't remove that from the vehicle." instead.

Instead of squeezing the horn: say "HONK[paragraph break]".

Rule for reaching inside the clown car:
   say "You'll have to get into the clown car.";
   deny access.
         
After printing the name of the clown car while looking when the clown car does not enclose the player:
   say " (in which you can see a honk-honk horn, though anything else that may be inside is concealed from view)";
   omit contents in listing.


(There are other cases to take care of here but I have to go now!)


Top
 Profile Send private message  
Reply with quote  
PostPosted: Sun Feb 10, 2019 4:41 pm 
Offline

Joined: Fri Oct 06, 2017 8:19 am
Posts: 35
Perfect. Thank you.


Top
 Profile Send private message  
Reply with quote  
PostPosted: Wed Feb 13, 2019 8:36 am 
Offline

Joined: Tue Mar 09, 2010 2:34 pm
Posts: 5568
Location: Burlington, VT
I should mention that the code doesn't prevent you from examining the matchbook from outside the clown car. Maybe using a rule for deciding the concealed possessions of the car (§18.9) is what's called for there.


Top
 Profile Send private message  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: Baidu [Spider] and 17 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group