Author Topic: AutoDoor bug  (Read 7127 times)

0 Members and 2 Guests are viewing this topic.

Offline Robert Eric

AutoDoor bug
« on: July 27, 2002, 03:56:02 PM »
I used AutoDoor today to test it out.  I used:

(instance aDoor of AutoDoor
  (properties
    y 100
    x 210
    view 2
    entranceTo 2
    locked FALSE
    doorCtrl 1
  )
)

When I wasn't on the blue control, 1, it opened.  When I was, it closed.  I changed some code in the AutoDoor script from:

(if( & (send gEgo:onControl) doorCtrl)
  (self:open())
)( else
  (self:close())
)

To:

(if( & (send gEgo:onControl) doorCtrl)
  (self:close())
)( else
  (self:open())
)

And it worked fine.  Any thoughts?  It's probably not a bug, but I figured I'd call it that until someone told me otherwise.
« Last Edit: July 27, 2002, 03:56:41 PM by Robert Eric »



Offline Brian Provinciano

Re:AutoDoor bug
« Reply #1 on: July 27, 2002, 04:43:14 PM »
Your control colours must be wrong. I tested it by taking the Tutorial Quest game, exactly as it is from doing the tutorial and changing the following in rm001.sc:

Code: [Select]
(use "door")
to:
Code: [Select]
(use "autodoor")

Code: [Select]
(instance aDoor of Door
   (properties
      y 100
      x 195
      view 2
      entranceTo 2
      locked TRUE
   )
)

to:
Code: [Select]
(instance aDoor of AutoDoor
   (properties
      y 100
      x 195
      view 2
      entranceTo 2
      locked FALSE
   )
)


It is identical to the normal door in the tutorial except for the minor changes ("use autodoor" and "of AutoDoor").

Offline Brian Provinciano

Re:AutoDoor bug
« Reply #2 on: July 27, 2002, 04:46:05 PM »
Oh, by the way, look in the help file. Colour "1" for doors and such is Black, "2" is navy, "4" is green, "8" is teal, etc. Since all normal areas on the control screen are black, it's going to open up all the time unless you're on a controlled area.

Offline Brian Provinciano

Re:AutoDoor bug
« Reply #3 on: July 27, 2002, 04:47:41 PM »
Always use the colours for controls as defined in SCI.SH:

(define ctlBLACK                  $0001)
(define ctlNAVY                      $0002)
(define ctlGREEN                  $0004)
(define ctlTEAL                      $0008)
(define ctlMAROON                   $0010)
(define ctlPURPLE                   $0020)
(define ctlBROWN                  $0040)
(define ctlSILVER                   $0080)
(define ctlGREY                      $0100)
(define ctlBLUE                      $0200)
(define ctlLIME                      $0400)
(define ctlCYAN                      $0800)
(define ctlRED                      $1000)
(define ctlFUCHSIA                   $2000)
(define ctlYELLOW                   $4000)
(define ctlWHITE                  $8000)

Offline Robert Eric

Re:AutoDoor bug
« Reply #4 on: July 27, 2002, 04:52:29 PM »
Now why would blue be 2 and black 1?  Is it just something to do with the interpreter.  That was all that through me off.  Sorry.

Offline Robert Eric

Re:AutoDoor bug
« Reply #5 on: July 27, 2002, 04:56:14 PM »
Oh, I missed that last post.  Never mind.

Offline Brian Provinciano

Re:AutoDoor bug
« Reply #6 on: July 27, 2002, 05:05:32 PM »
In the case of controls, each colour is a bit. There are 16 bits and 16 colours. This is because some control areas could have more than one colour, so instead of a number from 0 to 15, it uses bits.


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

Page created in 0.064 seconds with 20 queries.