Starting in a room in TADS 3

Hi, I recently installed TADS 3 and want to know how to start the player in a certain room.

This my code:

bedroom: Room 'Bedroom'
"A disorganized room that's boiling hot. You should really clean this up. "
south = landing
cannotGoThatWayMsg = '''As you can't walk through walls, you can't go that way. '''
;

landing: Room 'Landing'
"Where all the rooms upstairs connect."
north = bedroom
;

I want the player to start in the bedroom but they start in the landing.

Have you defined a starting position? Glancing through the manual, this seems like the done thing:

me: Actor
    location = bedroom
;

Thanks, that worked perfectly!

There are (at least) three ways to determine where an actor starts, including the player character…
In addition to defining the location property (as advised above) you can also use a template:

igor: Person ‘igor’ ‘Igor’ @igorsRoom

or you can define the actor underneath the Room, using the + notation (all of this is discussed in the many helpful docs and manuals that are available for TADS 3). The + plus notation can be really helpful for locating objects within objects (you will almost certainly want to use this feature in your code) but there are a few subtleties to understand, which you should read up on if you want to do any kind of work with TADS3…

bedroom: Room ‘Bedroom’
"A disorganized room that’s boiling hot. You should really clean this up. "
south = landing
cannotGoThatWayMsg = ‘’‘As you can’t walk through walls, you can’t go that way. ‘’’
;

+ me: Person
;

(note that you may want to change the class of your PC to ‘Person’)

Please, sorry a thousand times, I feel incredibly stupid for not figuring this out, but:

How can I move the player onto the bed? I think it should be easy and obvious, but I haven’t found the answer anywhere.

“me.moveInto(bed)” or “me.travelTo(bed)” puts the player into the bedroom, but not into the bed! Setting his posture to “lying” doesn’t do anything, apparently. I want the location to appear as “Bedroom (lying on the bed)”, but how?

Also, in keeping with “don’t give him the fish, teach him how to fish”, how could I have found this out by myself?

Do you have a bed object in your code that is of class Bed? Everything should be taken care of if you enter ‘get on bed’. You can set the defaultPosture to sitting or lying, as you prefer… if you haven’t read Learning TADS3, you should…

If you want to move the player onto the bed in a special action you can:
Call bedObj.performEntry(lying), which will print the default report that you get on the bed, or
Call gActor.moveIntoForTravel(bedObj), followed by gActor.posture = lying;
in which case you can print your own msgs about what happened, or call gActor.lookAround(true) to get a fresh room desc

In my major TADS3 WIP (using adv3) I have, inside the player char object:

.....
  location = sofa
  posture = lying
.....

whose works as expected.

Best regards from Italy,
dott. Piergiorgio.

Many thanks for your help! “moveIntoForTravel” and “posture” was what I was looking for.
My mistake was that I’ve put that into a TravelMessage, which also had the bedroom as a “destination”, and that overrode the moveIntoForTravel (or whatever solution I tried).

Thanks again for your help, and your patience!

1 Like