Author Topic: Why won't this compile?  (Read 3426 times)

0 Members and 1 Guest are viewing this topic.

Offline Te Rangi

Why won't this compile?
« on: September 21, 2002, 06:57:31 PM »
 
Code: [Select]
)
   (method (init)

     (doornorth:init()
 
SCI makes faces at me.



Offline Chris Cromer

Re:Why won't this compile?
« Reply #1 on: September 21, 2002, 07:10:00 PM »
Well your going to have to show us more of the code then that... we wouldn't be able to tell if anything was wrong with that tiny bit of code.
Chris Cromer

It's all fun and games until someone get's hurt then it's just fun. ;)

Offline Te Rangi

Re:Why won't this compile?
« Reply #2 on: September 21, 2002, 07:21:43 PM »
Code: [Select]
(include "sci.sh")
(include "game.sh")
/******************************************************************************/
(script 1)
/******************************************************************************/
(use "main")
(use "controls")
(use "cycle")
(use "game")
(use "feature")
(use "obj")
(use "inv")
(use "autodoor")
(use "jump")
(use "dpath")
(use "wander")
/******************************************************************************/
(instance public rm001 of Rm
   (properties
      picture scriptNumber
      // Set up the rooms to go to/come from here
      north 2
      east 0
      south 3
      west 0
      )
   (method (init)
     )
     (doornorth:
      init()
      )
      (thecrate:
  init()
  setCycle(Fwd)
  cycleSpeed(1)

)
(cleaner:
  init()
  setCycle(Walk)
  setMotion(Wander)


)
(bgship:
  init()
  setCycle(Fwd)
  setMotion(MoveTo  320 30 RoomScript)
    ignoreActors()
  setPri(0)
)
(pump:
  init()
)

// 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)
        (var dyingScript)
        (super:handleEvent(pEvent))

        /*****************************************
         * Handle the possible said phrases here *
         *****************************************/
Code: [Select]
/******************************************************************************/
(instance doornorth of AutoDoor
  (properties
    entranceTo 2
    locked FALSE
  )
)
(instance thecrate of Prop
  (properties
    y 140
    x 110
    view 998
  )
)
(instance cleaner of Act
  (properties
    y 170
    x 190
    view 2
  )
)
(instance pump of Prop
  (properties
    y 135
    x 147
    view 997
  )
)
 (instance bgship of Act
  (properties
    y 30
    x 20
   view 3
  )
 )
)

Offline Brian Provinciano

Re:Why won't this compile?
« Reply #3 on: September 21, 2002, 07:55:56 PM »
just judging by your first shown code, it's missing a bracket.

You have
Code: [Select]
(doornorth:init()It needs
Code: [Select]
(doornorth:init())

Offline Te Rangi

Re:Why won't this compile?
« Reply #4 on: September 21, 2002, 08:18:59 PM »
It still fudges up. It gives me an "undefined symbol" error even though I have all of the other stuff sorted (I think  ::))

Offline Brian Provinciano

Re:Why won't this compile?
« Reply #5 on: September 21, 2002, 11:07:25 PM »
You have an extra "(". You have:
Code: [Select]
  (method (init)
    )
    (doornorth:
      init()
      )
      (thecrate:
  init()
  setCycle(Fwd)
  cycleSpeed(1)

)

and should have
Code: [Select]
  (method (init)
    (doornorth:
      init()
      )
      (thecrate:
  init()
  setCycle(Fwd)
  cycleSpeed(1)

)

A "(" opens a block and a ")" closes one. Your code would be viewed by the compiler as:

Code: [Select]
  (method (init)
   )

from the extra ")". By closing the init method with it, the doornorth is expected to be a method.


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

Page created in 0.039 seconds with 17 queries.