20 rooms question

New to Inform 7 and am porting a game over I wrote in Basic. I was unable to see a starting point after checking documents, rooms, descriptions, lists, tables, etc that helps. Rather than define 20 separate room names, with 20 separate short descriptions and 20 separate long descriptions; I prior Dimensioned 3 arrays and if given the value of “x”, I could easily find and print all 3 parts.

Help is appreciated to point me to a source example that does similar. tnx

That would be WI 16.16: Defining things with tables. It says “things” but it’s really applicable to objects in general, and thus also rooms.

Rooms have a built-in description property, which is what the looking action prints (and an implicit looking action happens on entering a new room). There’s not a built-in concept of a short description, and I don’t know where you want to use it… you’ll have to write your own rules regarding it. But I don’t need to know what you’ll do with it to help you define it…

A room has a text called the short description.

Some rooms are defined by the Table of Predefined Rooms.

Table of Predefined Rooms
room    short description   description
Lab "mad scientist-y"   "really, really mad scientist-y"
Parlor  "posh"  "but sort of a shabby posh"

Notice Predefined Rooms: you can’t have a table whose name is simply a kind name or the plural of a kind name. In the related defining enumerated kinds of value by table option, if you use a table, then all of the values must be defined by table. That doesn’t apply to the objects case: you can go ahead and add further assertions like The Conservatory is a room. just fine.

3 Likes

Thanks, it is “frustrating” to learn something new but I feel if any, Inform 7 is worth it !!
While this will be used differently in my game, here is a start …

Table of Stations
Station
“City Hall Station Loop”
“City Hall Station”
“Brooklyn Bridge Station”
“Canal St n Lafayette Ave”
“Spring St n Lafayette Ave”
“Bleeker St n Lafayette Av”
“Astor Place and 4 th Ave”
“14 th Street and 4th Ave”
“23rd St and Lexington Ave”
“28th St and Lexington Ave”
“33rd St and Lexington Ave”
“42nd St and Lexington Ave”
“51st St and Lexington Ave”
“59th St and Lexington Ave”
“68th St and Lexington Ave”
“77th St and Lexington Ave”
“86th St and Lexington Ave”
“96th St and Lexington Ave”
“103rd St and Lexington Av”
“110th St and Lexington Av”
“116th St and Lexington Av”
“125th St and Lexington Av”
“135th St and Lexington Av”
“Lexington Ave Loop”

Table of Info
Info
“The IRT # 6 at it’s most southern point, the ‘six’ loops North from here.”
“You are below the NYC Museum at City Hall Station, it’s almost well lit.”
“The Brooklyn Bridge, connecting Manhattan and Brooklyn is to the East.”
“Home of Chinatown and Soho, the renowned youth Gang ‘Dragons’ are here.”
“SoHo (South of Houston St) is well known for it’s spacious ‘artist’ lofts.”
“Land donated by the Bleeker family (1808) - Greenwich Village, The Bowery.”
“New York University established 1831, the legendary Gang ‘Sharks’ turf.”
“Center, in the Union Square Park is a statue of George Washington (1856).”
“Baruch College #2 worldwide for 100 Most Influential People in Accounting.”
“Just east of Herald Square, ending of the Macy’s Thanksgiving Day Parade.”
“Just south of of the 9 acre, Bryant Park, home to the NYC/NGO Public Library.”
“Grand Central (Terminal) Station, is the largest train station in the world.”
“Formerly, the United Stations, renamed to NGO World Headquarters in 2067.”
“The Edward Koch Bridge is to the east, the legendary Gang ‘Jets’ turf.”
“Hunter College was established here in 1870 and is part of the CUNY system.”
“Lenox Hill Hospital (1857), medical support for WTC attacks, Sept 11, 2001.”
“Mid Central Park to the west, East River and Astoria Queens to the east.”
“Carnegie Hill, the most prestigious residential area of the Upper East Side.”
“Spanish Harlem, many of Puerto Rican descent, the Spanish-Harlem Hawks turf.”
“Central Park North to the west and La Guardia Airport in Queens to the east.”
“North Spanish Harlem, almost 5,000,000 subway riders in 2011.”
“The 42nd President of the USA, Bill Clinton had an office in Harlem, 125th St.”
“You are at the Lexington Loop station, just prior to the Harlem River.”
“The IRT # 6 at it’s most northern point, the ‘six’ loops South from here.”

X is a number variable.
X is 13.

Train Stop is a room. “you are at Station [X] - [Station in row X of Table of Stations], [line break][Info in row X of Table of Info]”.


The above is what I called short descriptions and long descriptions. this yields:

l
Train Stop
you are at Station 13 - 51st St and Lexington Ave,
Home of the former United Nations, renamed to NGO World Headquarters in 2067.

2 Likes