AGT Programming (5) - Entering the container (velvet bag) by Bev Truter So, you've created a spiffy container that is both a NOUN and a ROOM in the .DAT file, and you want the player to be able to get into it as well as shove all his/her belongings into it. Still assuming the container is a velvet bag (NOUN 201), and that ROOM 18 is the inside of the velvet bag, make some Commands in the .CMD file like so: COMMAND ENTER BAG FlagOFF 20 ;no entry from current room to bag InRoom 201 ;bag is in the current location, not ;carried IsOpen 201 ;bag is open ChangePassageway 11 18 ;so you can exit from room 18 to current ;room GoToRoom 18 ;go to the interior of the bag PrintMessage 38 ;You cautiously climb into the velvet bag TurnFlagON 20 ;passageway opened between bag and room DoneWithTurn END_COMMAND To close that passageway from the bag (room 18) to the room where you dropped the bag (noun) after you have exited the bag, something like this will be needed in the ANY Commands, probably near the top of your Data file. COMMAND ANY FlagON 20 ;typing "enter" will send you to Room 18 NOT AtLocation 18 ;player is not inside the bag InRoom 201 ;after leaving Room 18 the bag will be ;here ChangePassageway 11 0 ;close passageway from current room to ;bag TurnFlagOFF 20 ;No "DoneWithTurn" after this line END_COMMAND It might also be a good idea not to have any other ENTER directions in locations where it is possible to take and drop the bag - you might end up inadvertently closing off other valid `enter' directions to locations other than the bag. An alternative way of making a command to enter the bag is by using the AGT token MakeVarRoomNum in the following Command: COMMAND ENTER BAG InRoom 201 IsOpen 201 MakeVarRoomNum 3 ;sets variable #3 to current room number GoToRoom 18 ;send player to interior of bag PrintMessage 38 ;you cautiously climb into the velvet bag DoneWithTurn END_COMMAND Then you will have to create a command to deal with leaving the bag when the player is in Room 18 (inside bag). Using the token GoToVariableRoom will send the player to whichever room he/she dropped the velvet bag (item 201), without opening and closing passageways to create the necessary enter and exit directions. Of course you will also have to make a command to deal with the player attempting to exit the bag when he/she isn't in Room 18, or when the player is in Room 18, but the bag (item 201) is closed. COMMAND EXIT BAG AtLocation 18 ;player inside bag IsOpen 201 ;the bag is open PrintMessage 41 ;you climb out of the velvet bag GoToVariableRoom 3 ;send player to room number in variable #3 DoneWithTurn END_COMMAND You might be puzzled by the Token "IsOpen 201" in the above command; but you can do yet MORE amazing things with the velvet bag if you are able to close it while sitting inside it - eg, it can then be a shelter from rain, snow, storms or flood. So, to close the bag while sitting inside it, something like the following is necessary: COMMAND CLOSE BAG AtLocation 18 ;you are inside the bag IsOpen 201 ;you haven't already closed the bag while in ;Room 18 CloseIt 201 ;the bag (NOUN 201) is now closed PrintMessage 42 ;You reach up and carefully pull the ;drawstring..etc DoneWithTurn END_COMMAND Of course you will have to make commands to deal with trying to leave the bag when it's closed, and trying to close the bag when it's already closed. There should also be a command to open the bag while sitting in it (Room 18) when it is closed, eg: COMMAND OPEN BAG AtLocation18 ;player is inside the bag IsClosed 201 ;you've closed the bag while inside Room 18 OpenIt 201 ;the bag (NOUN 201) is now open PrintMessage 43 ;You reach up and loosen the drawstring...etc. DoneWithTurn END_COMMAND You will also need commands to cope with the player attempting to enter the bag if the bag is being carried, or if the bag is not in the current room, or if the bag is in the current room but is closed. - o -