Author Topic: Script Trouble  (Read 4241 times)

0 Members and 1 Guest are viewing this topic.

Offline TrvMcNevan

Script Trouble
« on: June 17, 2004, 07:38:07 PM »
Okay, I am totally new to this.  The only programming I have ever done is in QBasic.  I have been working on the tutorial on this site but I keep running into the same problem.  When I get to handleEvent, and I place more than one event in there the script won't work.  I'm thoroughly confused. Please help me out here...



Offline TrvMcNevan

Re:Script Trouble
« Reply #1 on: June 17, 2004, 08:50:44 PM »
Ok here is the code that is bothering me....

(instance RoomScript of Script
   (properties)
   (method (handleEvent pEvent)
        (super:handleEvent(pEvent))

        /*****************************************
         * Handle the possible said phrases here *
         *****************************************/
(if(Said('talk/man'))
  (if(< (send gEgo:distanceTo(aMan)) 40)
    Print("Hello Brian!" #title "You Say:")
    Print("Hello there! Welcome to SCI Studio!" #title "Brian Says:")
  )(else
    Print("You don't want to yell. Get closer.")
  )
)
(instance aMan of Act
  (properties
    y 170
    x 220
    view 1
  )
)

- when I go to compile it, the program says that something needs (')').  It's really confusing me.

Offline Eigen

Re:Script Trouble
« Reply #2 on: June 18, 2004, 01:23:15 AM »
...
  )(else
  Print("You don't want to yell. Get closer.")
  )
  )

) // (if(Said('talk/man')) closing bracket
) // (method (handleEvent pEvent) closing bracket

-Eigen
Artificial Intelligence Competition


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

Page created in 0.099 seconds with 22 queries.