TADS3 project---how many sourcefiles should I create?

Newbie here, with my absolute first post to this forum.

I have installed the TADS3 workbench on Windows 7 (TADS 3.1.2, Build Win119) and am reading the Learning TADS3 manual. Exercise 11 (page 58 of the pdf) describes a scenario defining 16 or so rooms connected with a variety of doors and passages.

I thought it would be convenient to define each room in its own source file, which seems to have worked fine as long as the rooms are connected only by compass points:

hall : Room ‘hall’ ‘hall’ “The hall”

north = drive
south = kitchen
east = lounge
west = cellar
;

With drive.t, kitchen.t, lounge.t and cellar.t files defining their respective rooms, I am able to move from one room to the other.

But when I change to this…

hall : Room ‘hall’ ‘hall’ “The hall”

north = frontDoor
;

  • frontDoor: Door ‘front door*doors’ ‘Front Door’
    north = drive
    ;

…it no longer works. When I run the game, the description of the hall says that there is an exit to the north and when I open the door, it opens. But when I try to go north, I see the message “you can’t do that from here.”

If I move the definition of drive from drive.t to the same file that defines the hall, then it works, I can open the door and go north onto the drive.

It appears that doors and passages only work if the rooms on both sides of the passage are defined in the same source file. Is that correct?

Is this a limitation that I have to live with, or am I doing something wrong?

Thanks.

Jerry

That’s a little puzzling. Could you maybe attach a few rooms as a zip so we can see the complete source?

Doors are meant to be defined in pairs. So each room’s direction points to its own door object and then one door object in one room links to the other door object in other room (other side of the same door). See chapter 4.1 in Learning TADS 3 or Door example in Tour Guide. In short, Door object doesn’t have a north property (nor any other directional properties).

Creating one source file for every room is appropriate, I’m doing the same. Of course it depends on one’s customs.

To be a little more specific, you can give a Door object a north property if you like; the compiler won’t complain. But the library will not make any use of your newly defined property. As Tomas said, Chapter 4 of Learning TADS 3 is the place to learn about implementing doors.