What’s wrong with this picture? I’m starting to put together my TADS3 game and I’m getting a compile error that I can’t understand. Heres the code:
#charset “us-ascii”
/*******************************************************************************
- Copyright © 1999, 2002 by Michael J. Roberts. Permission is granted
- to anyone to copy and use this file for any purpose.
*******************************************************************************/
/* Includes ** Adds source files and sets language. **************************/
#include <adv3.h>
#include <en_us.h>
/*******************************************************************************
- User-Defined Classes.
*******************************************************************************/
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
rinkAction
verbPhrase=‘drink/drinking(what)’
;
replace VerbRule(AttachTo)
(‘attach’|‘connect’|‘hook’|‘fasten’)dobjList’to’singleIobj
:AttachToAction
askIobjResponseProd=toSingleNoun
verbPhrase=‘attach/attaching(what)(to what)’
;
modify grammar predicate(Take):
(‘take’|‘pick’ ‘up’|‘get’|‘grab’|‘handle’|‘lift’)
dobjList
|‘pick’dobjList’up’:
verbPhrase=‘take/taking(what)’
;
modify Room
desc()
{
/Has the room been seen before?/
if (!seen)
return(roomFirstDesc);
else
return(shortDesc);
}
;
The error is on the return(shortDesc); line and is stated as the “shortDesc” is undefined. I am only providing the code down to the error. Could I be missing something further on that is the cause of this error?
RonG