Bobinator wrote:
Hey, I know it's been a while, I've just been busy with other things. A couple of quick questions, though:
1. How do I make it so that if the player tries to go in a direction from a specific room, they get a special message for it, instead of just "You can't go that way?"
I tried doing it like this:
Code:
Carry out going east from Main Grounds:
say "That way leads over towards the movie theatre. While you'd love to catch 'Boy Gets Hit In Face With Rather Large Pie 2' again, you're
Quote:
I've tried all of these with Instead and Before rules, too, and that didn't work, either.
a) this is one of the most common problems in the book. Going a direction
from a room happens only when the movement has already succeeded; going a direction
in a room happens before that's checked.
b) you want to use an Instead rule for this, thus:
Code:
Instead of going east in Main Grounds: say "That way leads over towards the movie theatre..."
Quote:
2. How do I have a character not follow the player into a certain room? My following code works like this:
You could just add a little bit into your condition:
Code:
Every turn when Jernon Follows is happening:
if the location of Jernon is not the location of the player and the player is not in the bathroom:
let the way be the best route from the location of Jernon to the location of the player;
silently try Jernon going the way;
say "Jernon follows after you.";
But that might get annoying if you had a lot of rooms you didn't want Jernon to enter, so you could do it with a value instead:
Code:
A room can be forbidden or permitted. A room is usually permitted. The bathroom is forbidden.
Every turn when Jernon Follows is happening:
if the location of Jernon is not the location of the player and the player is not in a forbidden room:
let the way be the best route from the location of Jernon to the location of the player;
silently try Jernon going the way;
say "Jernon follows after you.";