New here, trying to get started on my first IF

I have recently discovered Inform 7 and am quite enthralled at its premise, to say the least. As interested in adventure games as I am, however, I am not sure how I would go about making one.

I came up with a story for my IF (I can post a summary here if requested) and thought of all the characters and locations involved, but I’m not sure how the puzzles will be implemented, or even some of the basic functions.

For example, my story takes place in a city, and the player has to drive around by car to go from location to location, with more places being unlocked as the story progresses. However, I ran into a number of problems with this. How do I keep the player from hitting the road without his car? It would also be silly for the player to still be in his car while indoors, so how do I prevent him from going to certain places while in his car? How do I allow the player to visit all the relevant locations from his car and only from his car? How do I prevent the player from going to locations he has not unlocked and break the script?

And what’s the best way for me to handle scenes changing over the course of the story? The first puzzle in my game has the player going to the police to inform them of a crime scene he has just discovered. When he goes back to the scene later, the police will be all over the place, conducting their investigation. How am I going to make everything in the scene operate differently when the police are there?

And that’s just the problems that are readily apparent at this point. I’ll probably run into many more as I progress in this project.

I think a good first step is to try and find games that have done similar things, and see how they did it. If you find a method you like, pinch it. If you don’t like it, try and figure out why you don’t like it and that may inspire you to change that method to your liking, or come up with your own method.

Some IF games implement vehicles as containers that you can drive around between rooms as you might walk (this is probably the most liable to bugs like driving inside a house). Others implement them as objects that, when used (“drive motorbike”, “get in car”) offer you a list of places to (essentially) teleport to. In my work in progress I’m implementing a car as its own room, where, while inside, you’ll get to choose to change the external location from a set of important places.

This is pretty universal across IF languages (and even non-IF languages). It’s all a question of either only allowing the player certain options, or setting the right conditions on the options you do offer. (Although since, in IF, a player who knows where the game is going can type options not offered, you usually still need to set conditions on them.)

Figuring out how best to set conditions in different circumstances (in certain locations, in certain scenes, in the presence of certain NPCs…) will vary from language to language. (Someone more proficient in I7 than me may be able to offer some specific advice.)

This is exactly what the “scene” mechanism in Inform 7 exists to do. It allows you to define different scenes with conditions for starting and stopping, and then make some rules apply only during a given scene. So for instance you might write instructions like

[code]Police investigation is a scene. Police investigation begins when the cops are in the Crime Scene.

Instead of touching the body during Police Investigation:
say “‘Hey! No tampering with the evidence,’ says Officer Duffy sharply.”[/code]

The manual chapter on scenes should give you some more ideas.

Cyris, where are you located? I’ve been kind of wanting to break into Inform myself, but don’t really have any great story ideas (I’m starting out with short story ideas right now).

But I would have fun helping someone else solve their structural/organizational problems, since I’m more interested in the natural scripting aspect anyway. Is there some way we could collaborate? I’m thinking I can send you suggested I7 script snippets for your requests, and you can implement them and see how they work out. The catch is that you’d have to start sharing the full script with me at some point for us to continue.

Hm, GoogleDocs allows sharing of documents and this might actually work very well. It would involve Cut/Past from GoogleDocs into I7 and vice-cersa. Anyway, I won’t be upset if you say no :slight_smile:

Cheers,

– John M.

Cyris: Are you Cysma on TVTropes? :slight_smile:

Oh man, that’s the opposite problem I’m having. I’m bursting with story idea’s, and in my head, I can see how I can implement them, but I need more Inform 7 experience first.

Big J Money: I would have no problems with that. In fact, I would be quite delighted to be able to work with someone on this.

Katz: Yes, I am Cysma. Why do you ask?

For everyone, here is the synopsis of the story that I plan to make into an IF:

[i]You are a young man named Daniel “Steely Dan” Steel, who has awakened inside of a small chapel one evening with a headache and no memory of the past 24 hours. The chapel is empty except for him and the corpse of a mysterious woman. He heads out to the parking lot and enters its sole vehicle, an REO Speedwagon, to the police station where he meets Chief Sting, who begins the investigation into the murder of this woman, whose name turns out to be Eleanor Rigby, but nothing else is known about her.

Dan sets off to find out more about this incident by gathering information from around this town called Paradise City. He finds out that he is a member of a band scheduled to play a gig at Lonely Hearts, a club owned by war veteran Sgt. Pepper. Problem is, their road crew ran into Hal Ford and his motorcycle gang, the Freewheel Burners, and they vanished along with their instruments and equipment.

To make matters worse, the streets of Paradise City are unsafe to wander at night due to a group of murderers collectively known as the Manalishis terrorizing the city, and are suspected to be behind the unlawful smashing of pumpkins and the theft of a jewelry store called Neil’s Diamonds & Rust. Chief Sting has been hot on their trail and has uncovered some information about them. Each Manalishi is identified by a color and a code name: The Red Manalishi goes by the name of Chainsaw Charlie, The Blue Manalishi is called Johnny Blade, the Yellow Manalishi is named Molly Hatchet, and the Black Manalishi is none other than Maxwell “Silver Hammer” Edison. Their leader is the Green Manalishi, but nothing is known about him or her other than being said to wear a two-pronged crown.

There is quite a mystery for Dan to unravel, but he is not without help. He is told to seek the Man on the Silver Mountain, and sure enough, at a place called Silver Mountain near the city, he finds the home of an eccentric toymaker called Mr. Tinkertrain, who may be able to help…[/i]

Cyris, I think I figured out whodunnit. It was either Mac Heath or Leroy Brown – they both are pretty mean dudes. (Sorry if I’ve given it away)

Robert Rothman

That just made my day. <3
Can’t wait to see the finished product!

I love the song title/band name gag!

You might want to be aware that amnesia is stigmatized as overused in IF. It’s a convenient way to allow exposition to happen gradually, but if there’s another way to do it, you might be rewarded with a more positive reaction. Even with the amnesia, though, that sounds like a fun game and I look forward to its completion.

As far as driving around, either a menu of destinations or a “drive to/go to” command could handle movement. Occasionally I’ve seen games where driving is implemented like this, too:

…but that sounds like it would just get in the way of what you’re trying to do.

Preventing the car from going indoors is really an implementation issue, and you should feel welcome to post all your implementation questions in the Inform section.

Nope, the murderer is someone already mentioned in the synopsis.

So let me make a quick list of the places you would be able to go to from your car:

Chapel – The scene of the murder
Police Station – Where you can talk to Sting and exchange info on the Manalishis
Sgt. Pepper’s Club – Where your instrument-less bandmates are hanging out
Neil’s Diamonds & Rust – Recently-robbed jewelery store, also derusting
Silver Mountain – Site of Mr. Tinkertrain’s workshop
Highway – Where the Freewheel Burners may appear and attack you
Port Royal Docks – Sting eventually tells you that there’s something of interest here
Abandoned Warehouse – Temporary HQ of the Freewheel Burners. You’ll have to deal with them on the highway first

I suppose that the car could be treated as a room and each destination is in one of the 8 directions from it, but when the player first enters the car, the only places he should be able to go to are the chapel and police station, with the other six locations opening up as the story progresses. How do I change the room description to reflect where he can currently go and prevent him from going in directions that aren’t available yet?

Now, I also know that my story will be divided into three acts, with the situation at each destination changing in each act. In the first act, the player needs to recover his band’s missing instruments and rescue the kidnapped roadies so that Dan’s band can have their show at Pepper’s club.

In the second act, Chief Sting needs help identifying the five Manalishis:
Red Manalishi
Blue Manalishi
Yellow Manalishi
Black Manalishi
Green Manalishi

Forget about what I wrote in my synopsis, it’s most likely going to be different: Sting needs to find out which suspect is which Manalishi:
Johnny Blade
Chainsaw Charlie
Molly Hatchet
Maxwell “Silver Hammer” Edison

Obviously there’s one missing, but he’ll figure that out later. Finally, he needs to find out which Manalishi committed which crime:
Murdering Eleanor Rigby
Robbing Neil’s Diamonds & Rust
Smashing Pumpkins
Stealing Instruments
Kidnapping Roadies

If all goes well, you’ll be given just enough clues in the second act to figure out who is who and who did what. It’s one big deduction puzzle. Then, in the third and final act, you will track down these villains one at a time, bring them to justice, and uncover the identity of the fifth Manalishi.

This is all I’ve got so far: pastebin.com/Bc0XXXBS

But when I try to run the game, I get this error:

You wrote ‘The Car is south of the parking lot and north of the road’ , but in another sentence ‘The Road is south of the parking lot’ : but this looks like a contradiction, which might be because I have misunderstood what was meant to be the subject of one or both of those sentences.

I don’t get it! I clearly stated that “The Car” is supposed to be treated as a door, and did exactly what the manual said concerning doors!

I would take another approach: It’d be simpler if you made the car an enterable container and created a driving to action that checks if the player is in the car. Then you don’t need to worry about room placement. Here’s a bare-bones solution:

[code]
A road is a kind of room. A road can be accessible or inaccessible.

The car is an enterable, openable, open container. The car is in the chapel.

Driving to is an action applying to one visible thing.
Understand “drive to [any accessible road]” as driving to.

Carry out driving to:
say “You start the car and drive to [the noun].”;
now the car is in the noun;
try looking.

Check driving to when the player is not in the car:
say “You need to be in a car to drive.” instead.

[places you can drive to]
The chapel is an accessible road.
The police station is an accessible road.

[places you can’t yet drive to]
The club is an inaccessible road.
The mountain is an inaccessible road.

[places you can never drive to]
The jail is north of the police station.
The back room is east of the club.

[making a destination accessible]
Instead of climbing:
say “Why climb here when there’s a perfectly good mountain nearby?”;
now the mountain is accessible.

Test me with “drive to police station/enter car/drive to police station/drive to club/drive to mountain/drive to jail/climb car/drive to mountain”[/code]

You don’t need to declare the relation between the rooms, it’s enough to give the directions to the door from both rooms. (In Inform’s point of view the road is not directly south of the parking lot, because there’s a door in between them, just like the road is not south of the chapel because the parking lot room is between them.)

Hi and welcome to the forum! :smiley:

Don’t take this the wrong way, but we’ve now moved from a general design issue (useful regardless of which IF language you’re using) to a coding / implementation issue specific to I7. As capmikee pointed out, these should be posted as a separate thread in the Inform 6 and 7 Development section (with a title that describes your specific problem). It’s not a matter of pickiness; posting in the correct sub-forum insures that it is seen by the right people (not everyone uses I7) and makes it easier for others with the same or related questions to find the information later.

As far as your question:

Actually, you did exactly what the manual tells you not to do:

Remove the line “The Road is south of the parking lot.” and the error goes away. (Edit: Oops, I see Juhana already explained that.) Unfortunately a new error pops up, involving your after rule. I’m taking a look at it now, but I agree with Juhana – implementing the car as a door is not how I would approach this.

Also, if you could give Paradise a suitably named theater, it would make at least one Styx fan very happy. :wink:

Here’s another thread in the I7 forum about implementing a room as a vehicle:

Foxaroo project #1: TARDIS Adrift

Why not implement the car as a vehicle, as per 3.16 of the Inform docs? That seems like it would automatically do some of what you want. If you’re in a vehicle you can go along with it using compass directions, and you can use “instead” rules to keep people from going where they shouldn’t:

[code]A road is a kind of room.
The Parking Lot is a road. “A plain parking lot. The office is to the west and the highway is far off to the north.” The Highway is a road. “Ah, the endless highway. The parking lot is back to the south. There is a rest stop to the east.” The Highway is north of the Parking Lot. The Office is a room. “The office, whee. The parking lot is to the east.” The Office is west of the parking lot. The Rest Stop is a road. “Nothing of interest here but the bathroom, which you can go inside. The highway is back to the west.” The Rest Stop is east of the highway. The Bathroom is a room. The Bathroom is inside from the Rest Stop. “It’s a bathroom, but thankfully none of the details are implemented.”

The car is a vehicle in the Parking Lot. The player is in the Office.

Instead of going from a road to road when the player is not in the car: say “It’s much too far to go unless you’re driving.”

Instead of going to a room that is not a road when the player is in the car: say “You can’t drive there!”

Instead of going north in the highway when the player is in the car: say “You drive further up the highway and arrive at a spot that looks exactly the same, down to the rest stop to the east.”

Instead of going in the highway when the player is not in the car: say “No pedestrian traffic on the highway!”[/code]

This isn’t tested much, but it seems like it should work, and it can easily be combined with Juhana’s accessible/inaccessible rooms and even his “drive to” code (which is a very player-friendly feature). Note that some bits of it are crude – you really shouldn’t be able to get out of the car on the highway, and the message for going back to the highway from the rest stop on foot isn’t quite apt. But those could be got around by more specific rules.

I haven’t looked at the code you put in pastebin, but implementing the car as a door almost certainly won’t work – in the TARDIS thread capnmikee just linked, I discovered that you can’t move doors around in play.

Hey cyris I just wanted to jump in quickly to say sorry, but my PC at home conked out on me. I remembered this thread and decided to pop in to let you know! If I can get it fixed soon, I’ll try to get in touch again to see if there is anything I can help with. Cheers.