Many Compile Errors - TADS3.1

Here is a batch of code that keeps giving me various compile errors no matter how I try to correct or arrange it. Certainly could use some help. It’s driving me crazy!








/* Room0001: The Actor Starts Game Here. **************************************/

  Beach : OutdoorRoom 'At The Beach' 'At The Beach'
  roomFirstDesc()
  { "This is first description.";
  }
  shortDesc = "You are at the sandy beach.";
 
/* Add HELP sign to beach. ****************************************************/

class Sign : Readable
;
+sign: Sign, Fixture 'large metal sign' 'metal sign'
  "The sizeable metal sign is firmly attached to a tree near the start of the
   eastern path. It is quite rusty and worn but the printing on it can still be
   read. It just might provide some information about The Magic Forest."
 initSpecialDesc = "Attached to a tree at the beginning of the eastern path is
   is a large metal sign."
 cannotTakeMSG = 'Sorry, but it is very rigidly attached to the tree. Besides,
   there is no reason to take it with you.'
 readDesc = "The sign is written in both English and Spanish and  it reads:
   'DANGER! Restricted property beyond this point. Enter at your own risk.'\b
   Property Manager,\b
   Melenkurian\b"
 dobjFor(Read)
 {
  action()
  {
   readsignAchievement.awardPointsOnce();
   inherited;
  }
 } 
 readsignAchievement : Achievement { +5 "reading the sign at the beach" }
; 

/* Add wooden box to beach. ***************************************************/

+box: ComplexContainer, Fixture 'large slatted wooden (wood) box*boxes' 'large
 slatted-wood box'
 "The large wooden box, left here from a precious helicopter flight, lies on
  some small rocks. At its top, there is a metal hasp that can be turned to
  unlock or lock the box."
cannotTakeMsg = (backpack.seen ? 'The backpack would be a more convenient
 container. You would be better off using that instead.' : 'The box is much too
 heavy to lift or carry around.')
initSpecialMsg = "A large slatted-wood box is lying nearby on some small
 rocks."
subContainer: ComplexComponent, LockableContainer
{
currentlyLockedMsg = 'The hasp is currently at the locked position. '
currentlyUnlockedMsg = 'The hasp is currently at the unlocked position. '
  dobjFor(Lock)
  {
   action()
    {
     "You twist the hasp and lock the box shut.";
     inherited;
    }
  }
  dobjFor(Unlock)
  {
   action()
   {
    "You turn the hasp, allowing the box to be opened.";
    inherited;
   }
  }
; 
   
Component = 'hasp' 'hasp'
 "A simple hasp that does the job of unlocking and locking the box."
 location = box.subContainer  
 dobjFor(Turn) { remap = [box.subcontainer.isLocked ? UnlockAction :
  LockAction, box.subContainer]}
; 

The sign part seems to work o.k.

RonG

Can you post the compile errors too?

Will post the errors shortly.

Here are the errors:

Tip: you can go to the source location of a compile error
by double-clicking on the error message in this window

----- begin build: Tue Jan 17 15:01:28 2012 -----

t3make -Fy “C:\Documents and Settings\Frenchy\Desktop\The Magic Forest\obj” -Fo “C:\Documents and Settings\Frenchy\Desktop\The Magic Forest\obj” -o “debug\The Magic Forest.t3” -a -D “LANGUAGE=en_us” -D “MESSAGESTYLE=neu” -v -d -statprefix <@> -statpct “system.tl” “adv3\adv3.tl” “The Magic Forest.t” -res “GameInfo.txt”
TADS Compiler 3.1.0 Copyright 1999, 2010 Michael J. Roberts
The Magic Forest.t(682): error:
A property name was expected in the object definition, but the compiler found
“hasp” instead. Check for a missing semicolon at the end of the object
definition, and check for unbalanced braces prior to this line.

The Magic Forest.t(683): error:
A property name was expected in the object definition, but the compiler found
“A simple hasp that does the job of unlocking and locking the…” instead.
Check for a missing semicolon at the end of the object definition, and check
for unbalanced braces prior to this line.

The Magic Forest.t(702): error:
A property name was expected in the object definition, but the compiler found
“” instead. Check for a missing semicolon at the end of the object definition,
and check for unbalanced braces prior to this line.

Errors: 3
Warnings: 0

t3make: error code 1

Build failed.
----- end build: Tue Jan 17 15:01:32 2012 –

Let me know if this is enough to help. Would using a simple lockable box help straighten up this mess?

RonG

This is not a properly formatted object definition:

Component = 'hasp' 'hasp'

What you need is this:

hasp: Component 'hasp' 'hasp'

An additional problem is that you’ve put the hasp inside the box, so it won’t be visible to the player. I believe you need to give the ComplexContainer a subSurface and put the hasp in it as a component. Try it, anyway.

Section 5.5 in “Learning T3” should provide some guidance. ComplexContainers are fairly tricky to implement.