Changing the name of a direction.

Is it possible to change the name of a direction? One way I thought to do it was to put the direction north into the variable shake or struggle:
local struggle = north
;
Obviously that didn’t work or I wouldn’t be here. The purpose for me wanting to change the name of a variable is because I want the PC to go to a new room without it seeming like they’ve moved. Here is the code to use as a reference:

itisLocked: Room
roomName = ‘Changing Room’
desc = “You try to leave the room. The door is locked. Oh sh*t.”
north = itislockedYaDingus
;

itislockedYaDingus: Room
roomName = ‘Changing Room’
desc = “You try to open the door again. Still locked. You start to bang on the door. ‘Hey!’ you shout. No answer. Suddenly, you start to feel a bit woozy. Sitting down, you hold your head, lay down, and you fall uncouncious. Sleepy time.”
struggle = whereTfAmI
;
If there is any way to do the fore mentioned way to move between rooms without actually moving it would be greatly appreciated.

For the first part of question, TADS can do lot of things including customized directions, but I’m sure you don’t want this as that would change available directions in whole map. Also north is not a variable with any value so you can’t assign to any other variable. Library expects that game programmer creates north and other properties and assigns a connector object to them.

If you want the PC to go to a new room without it seeming like they’ve moved, you can just move the player with me.moveIntoForTravel(someRoom) command. But now I’m quite lost in your intention. Messages such as “You try to leave the room. The door is locked. Oh sh*t.” should be probably placed in FakeConnector or any other connector which reacts to player movement. I don’t understand why it is a description of room, which is printed in reaction to >look command.

The reason why I made it the description of the room was because I didn’t know how to make that message appear any other way.

Also I’m not sure you actually need another room. Could you explain better what effect you want? Maybe forget about code and just write a little example transcript of your ideal game, complete with room description, than what command player can type and what text game should print as a reply and so on.

Let me just describe the scene for you. You have just gotten your Vault Suit and you go into this room to change. The changing room also doubles as a shower. You finally get changed and try to leave. The door is locked. You start to pound on the door and panic. You notice that there is a faint sound. Like air escaping a valve. You get really tired and fall unconscious. You then wake up in what’ most likely a creepy lab. I haven’t decided yet.

tads.org/t3doc/doc/index.htm

You could try reading “Getting Started in TADS 3”.

You don’t have to store anything in made variables of your own. You have to create room objects. You can change where a direction leads via code.

Say you have three rooms.

vaultHallway
    name = 'vault hallway'
    desc = "dark hallway in the vault"
    west = changingRoom
;
changingRoom
   name = 'changing room'
   desc = "changing room in the vault"
   east = vaultHallway
;

lab
   name = 'lab'
   desc = "lab room somewhere else in the vault."
;

you can later go.

changingRoom.east = lab

that will work just fine, but you have to learn dobjFor(), enteringRoom, leavingRoom. These are types of functions that will give you code blocks. Definitely read the book suggested to you :slight_smile:

RealNC’s suggestion to “Read The Fine Manual” is definitely way to go, because Eric have put massive amounts of energy to ease first steps for beginners, but just as an inspiration, how things can be approached in TADS, here is a little example:

#charset "utf-8"

#include <adv3.h>
#include <en_us.h>

versionInfo: GameID;

gameMain: GameMainDef
    initialPlayerChar = me
;

/****************************************************************************/
/*
 *   Initial location
 */
room: Room 'room' 'room'
    "You are in some boring room. Changing room is to the south. "

    south = showerDoorOutside
;

+ showerDoorOutside: IndirectLockable, Door -> showerDoor 'door' 'door'
    "Door leads to the shower. "

    isPlural = true
;

+ me: Actor;

++ Wearable 'vault suit' 'vault suit'
    "It's a vault suit, looks like a new. "

    dobjFor(Wear)
    {
        verify()
        {
            if(!me.isIn(shower))
                illogicalNow('You need some private place to change clothes. ');
        }
        action()
        {
            "You've closed the door to have privacy and changed clothes. Now
                you are wearing vault suit. ";

            showerDoor.makeOpen(nil);
            showerDoor.makeLocked(true);

            inherited();
        }
    }
;

/****************************************************************************/
/*
 *   Shower
 */
shower: Room 'Changing Room'
    "You are now in changing room also doubling as a shower which is above your head. "

    north = showerDoor
;

+ showerDoor: IndirectLockable, Door 'door' 'door'
    "Door leads to the boring room. "

    isPlural = true
    initiallyLocked = nil
    failCounter = 0

    dobjFor(Open)
    {
        check()
        {
            if(isLocked)
            {
                gActor.setPronounObj(self);

                if(++failCounter == 1)
                    failCheck('You try to leave the room. The door is locked.
                        Oh sh*t. ');

                else if(failCounter == 2)
                {
                    /* We need to move player at the end of this turn. */
                    new Fuse(self, &movePlayer, 0);

                    failCheck('You try to open the door again. Still locked.
                        You start to bang on the door. \'Hey!\' you shout. No
                        answer. Suddenly, you start to feel a bit woozy.
                        Sitting down, you hold your head, lay down, and you
                        fall uncouncious. Sleepy time. ');
                }
            }
            else
                inherited();
        }
    }

    movePlayer()
    {
        me.moveInto(lab);

        "<.p>";
        me.lookAround(nil);
    }

    cannotUnlockMsg = 'You don\'t see any lock from this side. '
    cannotLockMsg = 'You don\'t see any lock from this side. '
    alreadyLockedMsg = 'You don\'t see any lock from this side. '
;

+ Fixture 'shower' 'shower'
    "It's a shower above your head. "
;

++ Noise 'faint sound' 'faint sound'
    hereWithSource = "You hear faint sound like air escaping a valve. "
    descWithSource = "The sound is coming from shower above your head. "
    sourceDesc = "Faint sound is coming from it. "
    displaySchedule = [2, 2, 3, 3, 4]

    isEmanating = showerDoor.isLocked
;

/****************************************************************************/
/*
 *   Creepy lab
 */
lab: Room 'Creepy lab'
    "<<first time>>You wakes up and look around you.<<only>> You are in some weird laboratory. "
;

You’ll see I’m using Door objects between both rooms, which are IndirectLockable, so the player cannot lock or unlock them, this is up to the programmer. I’m locking them in the moment player wears a suit. After second attempt to either open or go through door you fall asleep. As a special effect I’ve also added the shower and faint sound which can be examined.