Author Topic: Newbie chapter 15  (Read 1657 times)

0 Members and 1 Guest are viewing this topic.

Piet

  • Guest
Newbie chapter 15
« on: October 10, 2002, 07:34:24 AM »
I'm a newbie in SCI Studio. At the moment I am following chapter 15 of the tutorial. Some way or another I can't get the DOIT example to work. No matter where I put it, I always get the error "out bracket expected"

Where exactly do I have to put it in the Roomscript Instance?

Thanks in advance



Offline Brian Provinciano

Re:Newbie chapter 15
« Reply #1 on: October 10, 2002, 10:35:40 PM »
You need to review brackets. Every ( needs a ). Go through your code from the top to bottom and match all the brackets. The latest compiler has better detection, so if you have two methods, and it says that there's an ) expected at the beginning of the second method, it means that the previous one was missing it.

Offline fck

Re:Newbie chapter 15
« Reply #2 on: October 14, 2002, 03:16:05 AM »
The best advice is to highly structure and comment your code, otherwise you will be for ever plagued by bracket errors - something like this:

(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")
    )//if look
  )//method handle event
 
  (method(doit)
    (super:doit())
    (if(==(send gEgo:onControl()) ctlYELLOW)
       (send gEgo:view(300))      //Wade scene
    )(else
       (if(==(send gEgo:onControl()) ctlFUCHSIA)
          (send gEgo:view(30))       //Swim scene
       )(else
           (if(==(send gEgo:onControl()) ctlRED)
             (send gRoom:setScript(egoDrowning)) //Drowning scene
           )(else
              (if(==(send gEgo:onControl()) ctlBLACK) //Normal walking
                 (send gEgo:view(0))       //Walk
              )//if Black
           )//if Red
        )//if Fuchsia
     )//if Yellow
  )//method doit
)//end instance Script


Offline Ryku

Re:Newbie chapter 15
« Reply #3 on: October 19, 2002, 09:23:20 AM »
Im a newbie! and I dont understand *starts crying*  :'( Waaaaah
~~~~~~
evil | live
~~~~~~


SMF 2.0.19 | SMF © 2021, Simple Machines
Simple Audio Video Embedder

Page created in 0.031 seconds with 17 queries.