Lots of Inform 7 questions

Hi.

I’ve been writing an IF using Inform 7 for a class. It’s due tonight and I’ve been having a lot of problems tying everything together.

I’m trying to use [If unvisited][otherwise] to say things only if the player has never been in that room before, but it still displays the first thing every time I visit a room. Here’s an example of how I’m using it:

The Mansion is a region. James’s Room is a room. James’s Room is in the Mansion. James is a man in James’s Room. Instead of examining James: say “You know your friend James, a millionaire’s heir, to be quite the ladies man, despite his appearance. The first woman he ever loved just happened to be the mother of his son, Ashlie, who, though the two broke up, has been living with him to provide a better home for their son. Lately, James has been caught up with Rene, an ex-prostitute he found on a night of loneliness.”. “[If unvisited]You enter James’s room. You see your friend sitting on his bed, obviously upset about something. Maybe you should ASK HIM ABOUT SOMETHING.[otherwise]James is gone. You probably shouldn’t be in here if he’s not”. Understand “him” as James. After asking James about “something”, say “James looks up at you and says, ‘Oh. Hey. It’s Rene… She’s pregnant, but the baby might not be mine. She started working for her pimp again.’ Uh, maybe you should LEAVE James alone right now. The door is that black oak panel that is closed to the west.”

The prompt to ask James something displays every time I enter James’s Room, even though there are no compiler errors.

Twice in my game, I want to move a character from one room to another, but after the action that’s supposed to lead to a character being moved, the character remains in the same room and the player can still interact with him there. Example:

The black oak panel is west of James’s Room and east of the Grand Hallway. The black oak panel is a door. The black oak panel is closed and unlocked. The Grand Hallway is in the Mansion. Ashlie is a woman in the Grand Hallway. Instead of examining Ashlie: say “Ashlie lives with James, the father of her son Harley. She’s very unhappy about the addition of Rene under their roof.”. After going to Grand Hallway: say “[If unvisited]As you leave, James rushes out, darting down the hall. A few moments later you hear the front door slam. Ashlie asks what’s wrong. You jump; you didn’t know she was there. Should you TELL HER ABOUT RENE? Would James mind? Maybe you should TELL HER ABOUT NOTHING.[otherwise]Ah, yes. How very grand is this hallway.”. After going to Grand Hallway: move James to Cafe. Understand “her” as Ashlie. After telling Ashlie about “Rene”, say “Ashlie is shocked. And calls up Erin. Maybe telling Ashlie wasn’t the best idea.”. After telling Ashlie about “nothing”, say “Ashlie shrugs. ‘OK, don’t tell me. Just make sure he doesn’t do anything crazy.’”

James stays in his room, again though there are no compiler errors.

In a part of my fiction, I’ve set up rules for saying yes and no:

“[If unvisited]You stop in the local cafe. As you approach the counter, you see Rose, of all people, has noticed you and is coming your way with a smile. ‘Hey,’ she says, ‘Have you seen Alan? He’s not at work and you always seem to know what he’s up to.’ YES or NO?[otherwise] You approach the cute cashier and order a latte and a scone.”. After saying no, say “She sighs. ‘Fine.’ Maybe he’s not telling anyone anything these days, not just me. I can’t believe I have to ask this when he’s my husband, but do you know what’s been up with him?’ Should you TELL HER ABOUT ALAN?”. After saying yes, say “She almost seems surprised. ‘You do? Home? Oh. That’s odd. But, then again, so many things have been odd lately. Do you know what’s been up with him?’ Should you TELL HER ABOUT ALAN?”. Understand “her” as Rose. After telling Rose about “Alan”, say “‘What?’ Rose is taken aback. ‘I’ve…I’ve got to get out of here.’”. After saying no, say “‘OK. Maybe I just need to ask him directly. I’ll see you later.’”. After going from the Cafe: move Rose to the Chimney House.

This compiles fine, but when I type yes or answer yes, it says “There is no reply” or “That was a rhetorical question.” Why isn’t it adhering to the rule?

I’ve been trying to work out the endings of my game, but I can’t figure out the syntax to do it. Throughout the game, the player has been learning secrets from characters and been given opportunities to share those secrets. I want to base my possible endings on whether or not the player shared secrets. The ends I want are:

If the player told Rose about “Alan”: end the game by saying “Rose ended up leaving Alan after you told her about his dealings with the mob. Word got around and Erin pursued full custody of the twins. With nothing good to live for, Alan’s life became completely absorbed by the mob. I bet you’re feeling pretty good right now, huh?”

If the player told Jane about “Marie”: end the game by saying “You get a text from a friend telling you to go to the nearest TV and turn on the local news. Marie is getting arrested! Man… What a shame!”

If the player told Rose about “Alan” and told Jane about “Marie”: end the game by saying “In the next few weeks, you see how you changed a few lives dramatically. You get a text from a friend telling you to go to the nearest TV and turn on the local news. Marie is getting arrested! Man… What a shame! Rose ended up leaving Alan after you told her about his dealings with the mob. Word got around and Erin pursued full custody of the twins. With nothing good to live for, Alan’s life became completely absorbed by the mob. I bet you’re feeling pretty good right now, huh?”

Otherwise: end the game by saying “Well! What a day! You dodged some bullets and any slip ups didn’t lead to anything that wouldn’t have happened otherwise. Phew… Tomorrow, you’re staying in.”

Also, I want don’t want the endings to occur until the player has reached Your House, a room in the game. So, do I say something like: If the player is in Your House and

Thanks for any help.

That’s a lot of questions!

For the first one, you’re using ‘[if visited]’ after you define james, which means that it’s checking james and not his room. This works (don’t forget to set ‘verbose’ when trying it out):

[code]Drawing Room is a room. Drawing Room is east of Sitting Room.

Sitting Room has description “[if visited]You’ve seen this place before[otherwise]This looks very similar to the drawing room (to the east).”

Drawing Room has description “Go west young man.”[/code]

Hi doozer,

Mark’s right: the reason that the description of James’ Room doesn’t change is that the description is attached to James, not the room. The other problem you have is that James is not moved when you go into the Grand Hallway, meaning that when you return to James’ Room, James is still there and you get his description again.

If you put “The description of James’s Room is” before the "[if unvisited…] description, it should work as you’d intended the first time, however, because you’ve used [if unvisited], if you any time after the first move - even if you don’t go anywhere - you will get the second description “James is not here” which is NOT what you want (because he still is!).

So, two problems:

  1. why didn’t James move?
    This is because you have two identical After rules and only the first one is being checked. If you roll the two together, you can get James to move as well as printing the description of James running down the hallway.
  2. why does the description change even though James hasn’t moved?
    This is because the “visited” flag is set for the room after the first turn. After the first turn it will be visited. There are a couple of ways of fixing this, but the simplest would be to change the [if visited] to [if James is in James’s’ Room].

The way in which you are constructing the descriptions is going to cause you problems, because if, having made the above changes, you go into the hallway and then back into James’ room, you get the “he’s not here” description (which is fine) but if you then go back into the hallway for a second time, you are told that James has just rushed past you again. Here, again, you need to attach the description of the hallway to the hallway directly using “The description of the Grand Hallway is …”.

Your yes/no problems are due to the fact that “yes” and “no” are not verbs, so you can’t use “After saying yes” because the after rules will never get executed. You need to use “instead of saying yes in the presence of …” in these instances, BUT looking at what you are trying to achieve I think you need to completely re-think how you’re going to do this, because you wil only be able to have two responses to ALL conversations with the same character. You ought to perhaps look into using some tables with topics and responses to drive your plot forward.

This would also allow you to keep track of what you’ve told to whom (by updating the table) and thus driving your end-game text.

You could stop the player from going to the ending location until a certain number of things has been said to a certain number of people, and one this has been done you could use an After rule for Your House, which runs through the various possibilities, printing out some text for each one (again, another good use of a table or two here).

Sorry that this wasn’t in time for your course, but I hope it’s useful to you.

Regards,
Paul.