Getting stack overflow - TADS3.1

Boy, am I in deep trouble again. I was about 1900 lines into my project when everything went down the well! After going crazy for hours, I couldn’t find the problem so I started all over again. I’m very determined. Things were going well until I inserted the code for modify room. Now, the project compiled with no errors but I get a stack overflow. I’ve attached all the code I have and desperately need someone to take a look at it. :unamused:

RonG


#charset "us-ascii"

/*******************************************************************************
*  Copyright (c) 1999, 2002 by Michael J. Roberts.  Permission is              *
*  granted to anyone to copy and use this file for any purpose.                *
*******************************************************************************/   
 
/* Includes *******************************************************************/  

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

/* User-defined classes. ******************************************************/

/* This class returns a travelDesc depending on whether or not its destination *
*  has been seen before. ******************************************************/
  
   class DynamicTravelMessage: TravelMessage 
     travelDesc()
     { 
     if(!destination.seen) //Our destination isn't seen.
       return firstTravelDesc;
     else  //It is seen. 
       return secondTravelDesc;
     }
; 

/* Templates  *****************************************************************/
 
   DynamicTravelMessage template
     ->destination
     "firstTravelDesc"
     "secondTravelDesc"
;

/* Modifications  *************************************************************/

   modify Lockable
     replace examineStatus
     {
     /* Inherit the default handling.  */
     inherited();

     /* If our lock status is visually apparent, and we want to mention the 
     *  lock status in our current state, show the lock status. ***************/     

     if (lockStatusObvious && lockStatusReportable)
        say(isLocked ? currentlyLockedMsg : currentlyUnlockedMsg); 
     }

     currentlyLockedMsg = (gLibMessages.currentlyLocked)
     currentlyUnlockedMsg = (gLibMessages.currentlyUnlocked)
;     
   
   replace VerbRule(Drink)
     ('drink' | 'quaff' | 'imbibe' | 'sip' | 'gulp' | 'swallow') dobjList
       : DrinkAction
         verbPhrase = 'drink/drinking (what)'

; 

   replace VerbRule(AttachTo)
     ('attach' | 'connect' | 'hook' | 'fasten') dobjList 'to' singleIobj
       : AttachToAction
         askIobjResponseProd = toSingleNoun
         verbPhrase = 'attach/attaching (what) (to what)'  
;

   modify Room
     desc()
       {
       /* Has the room been seen before? */ 
       if (!seen)
       /* If !seen, show the roomFirstDesc property. */
       return(roomFirstDesc);
       else
       /* If seen, show the shortDesc property. */
       return(shortDesc);
       } 
; 
  

/* Our game credits and version information.  *********************************/  

   versionInfo: GameID
     IFID = 'dbc1508e-895b-4c0a-aa68-4e2ff1a06be2'
     name = 'The Magic Forest'
     byline = 'by Ron Gaudet'
     htmlByline = 'by <a href="mailto:rgaudet1938@buckeye-access.com">
                   Ron Gaudet</a>'
     version = '1'
     authorEmail = 'Ron Gaudet <rgaudet1938@buckeye-access.com>'
     desc = 'An extended IF adventure story.'
     htmlDesc = 'An extended IF adventure story.'

/* Show our credits.  *********************************************************/

 showCredit()
   {
     "Put credits for the game here. ";
     "\b";
   }

/* Show ABOUT text.  **********************************************************/ 
 
   showAbout()
     {
        "Put information for players here.  Many authors like to mention
        any unusual commands here, along with background information on
        the game (for example, the author might mention that the game
        was created as an entry for a particular competition). ";
     }
;

/* (Room0001) - starting room.  ***********************************************/
    
   beach : OutdoorRoom 'On the Beach' 'On the Beach' 
     roomFirstdesc()
       {
         "This is the first message. "; 
       }
     shortDesc = "You are on the sandy beach. "
;

/* Define the player charactor.  **********************************************/
 
   me: Actor
     location = beach
;

/* Show the "gameMain" object. ************************************************/ 

   gameMain: GameMainDef
     initialPlayerChar = me

     
/* Show our introductory message.  ********************************************/
      
   showIntro()
     {
       "Welcome to The Magic Forest!\b";
     }

 /* Show the "goodbye" message.  **********************************************/  
    
    showGoodbye()
    {
       "<.p>Thanks for playing!\b";
    }
;

Your modify Room block is causing the stack overflow and you should get rid of it completely.

beach : OutdoorRoom 'On the Beach' 'On the Beach' 
    "You are on the sandy beach. "

    roomFirstDesc = "This is the first message. "
;

That will show one message the first time a player looks in the room, and another message every other time.

You are a life saver! I will follow your advice. I could swear I used that block of code before but who knows. Now, I can work back up to me 1900 lines of code.

RonG