Inventory Listers - TADS#

I get frustrated too easily, so I’m back. My character will be holding, wearing and carrying a number of objects. This fact got me interested in Inventory Listers. I’d like to use this lister code. The Library Reference Manual shows a number of examples (whch occupy many pages) on how to use these listers. There’s so much information about this that, once again, I’m not sure what to use and where and how to use it.

RTDD has a whole section of code for its use of Inventory Listers for the main character. I’ve had many problems trying to implement that section of code. However, should I even worry about these listers? If so, I’m once again looking for some sage advice on how to go about :question: :question:

RonG

Listers are one of the more complex areas of adv3. There’s a lot of machinery to help you get the output you want, but you have to study the code in some depth to know which knobs to tweak.

I’d recommend leaving this until later, as it’s high effort and essentially decoupled from the rest of your code.

If you’d like help, you can post the desired output of your >inventory command, and I’ll see what I can do.

Thanks for the advice. I will leave the listers until later and, instead, start adding objects that the actor will be carrying, wearing and so forth. It’s certainly not that I have anything else to do.

RonG

bcressey:

I guess I’ve been married too long (53 years) because, like my wife, I’ve changed my mind about waiting on the inventory lister. The reference manual shows a lister logic that shows my objects in scripted form that allows me to list my items in up to up to seven items of text rather than on individual lines. That’s what I’d like to use.

If you’d like to give it a shot at getting me started on this, I certainly won’t refuse. Just let know what section of code and any other information you’ll need.

Many thanks,

RonG

Can you post the example listing from the manual you’re citing?

I thought I posted a reply to this topic but it got lost somehow! I found two listers, one works great for the actor and the other works great for rooms.

I have two other minor problems that I can’t find answers for in the manual.

I want to print two long paragraphs when I start the game. How do I place a ‘wait for carriage return’ return between them?

The parser sometimes lists singular objects as plural and vice-versa. Is there a way to prevent this?

Would surely like some help on these two things.

RonG

(1) Read Eric’s article “Some Common Input/Output Issues” in the Technical manual.

(2) Set isPlural = true for things that are plural.

In your GameMainDef object, implement the showIntro() method. For a manual “more” prompt, you can call “inputManager.pauseForMore(true)”. The argument of pauseForMore() specifies whether the real-time clock should be stopped while the prompt is displayed. An example:

gameMain: GameMainDef {
    // ...
    showIntro()
    {
        "Blah blah blah. ";
        inputManager.pauseForMore(true);
    }
    // ...
}

When the parser gets it wrong, set “isPlural = nil” for singular objects and “isPlural = true” to the parser treat them as plural.

Once again, thanks to all for the usual great help :smiley:

RonG

I used the ‘pause for more option’ to split up my introduction but the status screen still shows the information for the first room of the game, which I don’t want to happen until I’ve shown both parts of the introduction. Can I do this using the ‘pre-init’ or ‘init’ features? The messages should be shown before the game actually goes to the first room.

I hope I’ve stated this clearly. Other than that the pause works.

RonG (The Pest)

There’s a quick way to do this. Override newGame(). newGame() runs earlier than showIntro(). In fact, showIntro() is called from the default implementation of newGame() right after it shows the statusline (which results in a visible statusline when showIntro() is called.) Example:

[code]
gameMain: GameMainDef {
// …
newGame()
{
"Blah blah blah. ";
inputManager.pauseForMore(true);

    // Don't forget to call the default implementation.
    // It's responsible for starting the game.
    inherited();
}
// ...

}[/code]