I have been having alot of problems

XFan2003 Heres another one of my problems...when i tried to compile after adding in all the INV_KEY stuff...i wrote in the exact stuff as in the tutorial and when i hit compile it says [error]: rm001.sc(84): Out Bracket (')') expected and i didnt even touch those lines it worked before and those lines were never changed. *if you need to know what part of the tutorial i am on it is Handling the Inventory and i am almost at the bottom where it says Using the Inventory Item. I have entered all of those codes and when i hit compile it says i need an end bracket on a line that i never changed... i think it might be a glitch.

Tom
mr-t just add a few more brackets
)
)
)
XFan2003 lol....sadly that didnt work... :'(


Tom
mr-t it will. just add more and more until it says in bracket expected then delete one at a time until it runs
XFan2003 lol....doesnt work for me.. oh well...ill have to talk to Brian. Thanx for your help though.


Tom
Brian Provinciano. Never just add brackets randomly to correct your errors. You will just mess up your script. The compiler is 100% working, and has been running so well, that it has been hardly modified for six months, and running perfectly for over a year.

I'm not trying to make any accusations, but it's not the compiler's fault, but a mistake of the user. The only solution is to just go through your script from the top matching '('s to ')'s to find out where your problem is. If you are just pasting code from the tutorial and not writing your own, it means you are pasting it in the wrong spot. There is a section in the tutorial showing exactly how to insert the code.

For more information on the brackets and how to use the message to find out where it's located more specifically, see a previous topic in the forum from about a week ago.
XFan2003 Brian,

The problem starts the second i put in

(if(not (send gEgo(INV_KEY)))
over the
(theKey:
init()
setCycle(Fwd)
)
...so when i put in the top part it says i need a bracket at random parts of the script. When i delete that part and only leave (theKey...part it works fine.. any suggestions...BTW brian i know your not making any accusations...and i wasnt trying to imply that the compiler has problems...

Tom
Eric Grygier Every opening bracket needs a closing bracket. Please post the first part of your room script.
XFan2003 I decided to post the whole script. So i added in the (if(not (send part so that you can see why it says bracket needed. If i was to leave that part out the script works fine. And i put in that part just like it is in the tutorial...if your not really sure what i mean just ask and ill give a better description.


(instance public rm001 of Rm
   (properties
      picture scriptNumber
      // Set up the rooms to go to/come from here
      north 0
      east 0
      south 0
      west 0
   )
   (method (init)
(if(not (send gEgo:has(INV_KEY)))
(theKey:
init()
setCycle(Fwd)
)
      // same in every script, starts things up
      (super:init())
      (self:setScript(RoomScript))
      
      // Check which room ego came from and position it
      (switch(gPreviousRoomNumber)
/******************************************************
* Put the cases here for the rooms ego can come from *
******************************************************/ /*
(case north
            (send gEgo:
               posn(210 110)
               loop(2)
            )
         )*/
// Set up ego's position if it hasn't come from any room
         (default
            (send gEgo:
               posn(150 130)
               loop(1)
            )
         )
      )
      
      // Set up the ego
      SetUpEgo()      
      (send gEgo:init())

/****************************************
* Set up the room's music to play here *
****************************************/ /*
      (send gTheMusic:
         prevSignal(0)
         stop()
         number(scriptNumber)
         loop(-1)
         play()
      )*/

/**************************************************
* Add the rest of your initialization stuff here *
**************************************************/
)
)
/******************************************************************************/
(instance RoomScript of Script
   (properties)
   (method (handleEvent pEvent)
(super:handleEvent(pEvent))

/*****************************************
* Handle the possible said phrases here *
*****************************************/
(if(Said('look'))
Print("You are in an empty room")
)(else
(if(Said('take/key'))
(if(send gEgo:has(INV_KEY))
Print("You already have it!")
)(else
(if(send gEgo:inRect(150 150 170 170))
Print("O.K.")
(send gEgo:get(INV_KEY))
(theKey:hide())
)(else
Print("You're not close enough!")
)
)
)

)
)
)
(instance theKey of Prop
(properties
view 400
x 160
y 160
))
/**************************************************************
Data Soong I haven
Brian Provinciano.
XFan2003 wrote:

Brian,

The problem starts the second i put in

(if(not (send gEgo(INV_KEY)))
over the
(theKey:
init()
setCycle(Fwd)
)
...so when i put in the top part it says i need a bracket at random parts of the script. When i delete that part and only leave (theKey...part it works fine.. any suggestions...BTW brian i know your not making any accusations...and i wasnt trying to imply that the compiler has problems...

Tom


You forgot the colon ":" in the send expression. You also forgot the method/prop.

You did:
'SEND' 'OBJECT' 'PARAM(s)'
You should have done
'SEND' 'OBJECT' 'METHOD or PROPERTY' 'PARAM(s)'

Each send expression must begin with a '(', follow with an object expression, then with a ":" then the params, then close with a ")".

(send gEgo:has(INV_KEY) ) is correct.
you did (send gEgo (INV_KEY) )
XFan2003 i did put the :has part i just forgot to include it here....sorry.



Tom