Sitemap
Uto

Uto

Developing indie interactive fiction and IF engines since 1984

DAAD Containers

3 min readMay 9, 2025

--

Containers in DAAD tend to be tricky for new authors. Here are the fundamentals of DAAD’s container system, aimed at beginners.

Preface

Containers in a text adventure built with DAAD are a source of issues:

  • For the player, who often struggles to find the correct command to put something into or take something out of a container.
  • For the developer, since neither DAAD nor its predecessor PAW offer a basic implementation for containers, leaving the burden on the author.

Thus, my recommendation is: avoid containers unless absolutely necessary.

…Ah, but you’re still reading? Well, I suppose that container is necessary after all. Let’s see how to implement it.

First Rule of Containers

DAAD needs a place to store objects inside a container, and that place is — whether we like it or not — the location whose number matches the container’s object number.

For example, in the /OBJ section:

/OBJ  
(...)
/5 CARRIED 1 Y_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ BAG _

Here, all objects placed inside the bag will end up in location 5.

This makes it critical not to use location 5 in your map of locations. Leave it empty (just assign an empty string to its description and avoid connecting it in the /CON section):

/LTX  
(...)
/5 ""

If you fail to do this, you’ll eventually find all contained objects scattered on the floor of location 5 when visiting it.

Note that the Y in the object’s description marks it as a container. To pre-populate the container with objects at game start, simply set their initial location to 5.

Inserting Objects

The command to insert objects into containers in DAAD is PUTIN, or its automated variant AUTOP. For PUTIN to succeed, the object must be carried by the player (held, but not worn).

Syntax:

PUTIN objno locno

Where objno is the object to insert and locno is the target location (container).

Get Uto’s stories in your inbox

Join Medium for free to get updates from this writer.

If the target isn’t a container or the object isn’t being carried, PUTIN will fail.

AUTOP locno works similarly but doesn’t require specifying the object—it attempts to use the object referenced by the current player order (and fails if none exists).

Neither AUTOP nor PUTIN verify the container’s presence, so you must handle that check.

Basic insertion code (to place in process 5):

> PUT _  
PRESENT 5 ; Is the bag here?
AUTOP 5
DONE

This checks if object 5 (the bag) is present (in the current location, carried, or worn), attempts AUTOP to location 5, and ends the command.

For stricter input (e.g., requiring “IN BAG”):

> PUT _  
PREP IN
NOUN2 BAG
PRESENT 5
AUTOP 5
DONE

However, omitting this check often improves usability — players can just type PUT KEY instead of PUT KEY IN BAG, reducing frustration for beginners.

Removing Objects

The process mirrors insertion but uses AUTOT (or its manual version TAKEOUT). The parameters match PUTIN/AUTOP, so the code is straightforward:

> TAKE _  
PRESENT 5 ; Is the bag here?
AUTOT 5
DONE

To enforce syntax like TAKE KEY FROM BAG:

> TAKE _  
PREP FROM
NOUN2 BAG
PRESENT 5
AUTOT 5
DONE

Other Considerations

By default, DAAD imposes no limits on:

  • The number of objects in a container.
  • Object size/weight.

For example, a coin purse might logically hold a coin or hairpin — but not a violin. Or a trash bag could hold papers but tear if you insert a knife.

DAAD doesn’t handle these cases; the author must implement such logic (though that’s beyond this guide’s scope).

I hope this helps you grasp the basics of containers in DAAD!

--

--

Written by Uto

Developing indie interactive fiction and IF engines since 1984