inventory list

I was just wondering if there’s a way to make it easier for the player to view the inventory. For instance, if the player is carrying 100 items (a bit of an exaggeration here), is there a way to display it when they type “INVENTORY” so that it’s easier to view (as opposed to a long, single column list)?

Infocom developed a way of listing inventory for the game “Trinity”, and it was good enough to have an extension that emulates it.

This may not be the best way but may give you ideas. … index.html

I think the extension is out of date. It gave me some errors when I tried to run the example code. :confused:

Sorry about that!

In TRINITY, the inventory was written as a prose paragraph instead of a list, grouping things in sentences. “You are wearing a tweed coat and a rain hat. In the tweed coat is a brochure and some loose change. You’re carrying a purse, in which are your cell phone, wallet, and keys.”

That’s not an actual example, but similar. There’s another extension, “Written Inventory” by Jon Ingold. I can’t guarantee it isn’t out of date, but even the source text of the extension may provide ideas. … index.html

Ah okay, yeah I remember reading in “Trinity Inventory” something about it working off of Ingold’s “Written Inventory”. Prose isn’t exactly what I’m looking for; I was hoping there was maybe some way to display the inventory list in multiple columns or something, so that instead of the results looking like:

You are carrying:
(press SPACE to continue)

it would look more like:

You are carrying:
A                         F                       K                     P
B                         G                       L                     Q 
C                         G                       M                     R
D                         I                       N                     S
E                         J                       O                     T

Curses was an excellent example of the former. It’s such a vast world, and there are so many items to carry in the bag, that sometimes I found myself looking at my inventory for two or three “pages”, and then not remembering what items were on the first page.

Yeah…Inform isn’t good with columns under the hood. You’d probably need to do some trickery that would depend on the player’s interpreter, and then at that point it’s a crapshoot since everyone plays games in different ways. You might be able to do it with Vorple, but that has its own constraints - there’s no standalone intepreter and the game needs to be hosted.

If you are intending a game with that much inventory, perhaps you could separate your game world items into categories, and write different inventory commands for them. Basically I’m thinking you give treasures an adjective, armor an adjective, spell reagents an adjective… Then you’d supress their listing in the main inventory - this would work well if your sub categories weren’t physical objects but collectibles kept track of by variables.

I’m thinking this:

Interesting method. Unfortunately, all the items are all physical objects, but I might be able to try doing something like that. Thanks!

If you haven’t already, check out 6:7 in the Recipe Book for some help.

I did it!! Or at least, I think I did it. I actually had the following code worked up before I saw your last message, but after reading the Recipe Book, it seems similar to the Persephone example.

A thing can be clothes.
A thing can be essential, tools, or misc.  A thing is usually misc.

The player is wearing a single sock, a raggedy shirt, and some ripped-up pants.
The rubber glove, the sock, the shirt, the pants, the blanket, and the silver ring are clothes.
The computer chip, the couple of transmitters, the needle, the receivers, and the silver ring are essential things.
The hatchet, the hunting rifle, the tiny key, the rumpled burlap sack, and the brass ugly stick are tools.

First carry out taking inventory:
       say "ITEMS BEING WORN: [a list of clothes worn by the player][line break]";
       if the player is carrying a tools:
               say "DEVICES/TOOLS: [a list of tools carried by the player][line break]";
       if the player is carrying a misc thing:
               say "MISCELLANEOUS: [a list of misc things carried by the player][line break]";
       if the player is carrying an essential thing:
               say "ESSENTIAL ITEMS: [a list of essential things carried by the player][line break]";
       stop the action.

I didn’t do “if the player is wearing something” because I wrote it so that the shirt can’t be removed, so the player will always be wearing at least that. Anyway, these are the results (after purloining literally EVERYTHING in the game):

Of course some of these items would never end up in the inventory during actual gameplay; they’re either scenery or fixed in place. I was just trying to hold as much stuff as possible.

So it does what I want it to do, but as you are a professional, do you think that this is a format that would be more aesthetically pleasing for the player?

The advantage of this is you’re not going to run a long list off the page “press SPACE to continue”… But to be honest, with that much inventory, a vertical list makes it a little easier to find what you’re looking for. Keep refining it though and look at the commands to change how items are listed in those examples and experiment to see what works better.

If you’re going to make [list of things that are frob] type inventory paragraphs, I’d suggest perhaps trying the idea of multiple inventory “type” commands. Or…you could do it like you’ve done it, and before stopping the action give the player prompts “To see just your essentials, type ESSENTIALS…” and make actions so the player can filter it down.

FWIW an updated version of Trinity Inventory is at … egercrantz. (Guess this isn’t what you’re looking for, but I thought I’d leave it there.) It was updated for 6L02 so I’m not sure if it still works.

thanks, matt!

Actually, i’m working on a D&D style IF Rpg and since there are many objects and copy of them (weapons, potions, armours and other stuffs) i created this kind of Inventory:

INVENTORY [x/x kg]

WEAPONS - Some long sword (x3), an axe, etc…
CLOTHING - a leather armour
POTIONS - Some light potions (x3), a medium potion, etc
OTHER - 35 mo, a strange amulet, etc

You’re grasping the axe.
You’re wearing the leather armour.

In this case, you need to make kinds of, for example:

[code]A potion is a kind of thing.

An axe is a kind of weapon.[/code]

So then you can make the code for Inventory.

Hey! That’s almost exactly what I did! :slight_smile: