(if(== goSouth 0)
(southBlock:addToPic())
Graph(grDRAW_LINE 137 138 137 177 -1 -1 clWHITE) // y1 x1 y2 x2
)
//******************************************************************************
(include "sci.sh")(include "game.sh") (script 200)
//******************************************************************************
(use "Controls")(use "Cycle")(use "Feature")(use "Game")(use "Main")(use "Obj")
//******************************************************************************
(instance public rm200 of Rm
(properties picture 800)
(method (init)
(super:init())
(self:setScript(RoomScript))
)// end method
)// end instance
//******************************************************************************
(instance RoomScript of Script
(properties)
(method (doit)
(super:doit())
UnLoad(rsPIC 800)
UnLoad(rsSCRIPT scriptNumber)
(switch(caveRoom) // list any special rooms as well as cave exits
(case 100 = caveRoom 24 // reset to defaults
= lastCaveRoom 3
= caveLevel 0
(send gRoom:newRoom(12))) // outside
(case 150 = caveRoom 1
= lastCaveRoom 4
= caveLevel 4
(send gRoom:newRoom(15))) // mushroom pool
(default (send gRoom:newRoom(13))) // Back to cave room
)
)// end doit method
)// end instance
//******************************************************************************
caveLevel = 0 // current cave level
caveRoom = 24 // current cave room
lastCaveRoom = 3 // 0=downLadder, 1=north, 2=east, 3=south, 4=west,5=upLadder
//******************************************************************************
// rm013.sc
//******************************************************************************
(include "sci.sh")(include "game.sh") (script 13)
//*****************************************************************************
(use "main")(use "controls")(use "cycle")(use "game")(use "feature")(use "obj")
//*****************************************************************************
(local
goNorth = 0
goEast = 0
goSouth = 0
goWest = 0
doYellow = FALSE
doNavy = FALSE
)
//*****************************************************************************
(instance public rm013 of Rm
(properties picture scriptNumber)
(method (init)
(super:init())
= goToRoom 0
(self:setRegions(950)) // PnC Menu
(self:setScript(RoomScript))
(switch(lastCaveRoom)
(case 0 (send gEgo:posn(160 120)loop(3)))//come down ladder
(case 1 (send gEgo:posn(157 86)loop(2)))//north
(case 2 (send gEgo:posn(219 110)loop(1)))//east
(case 3 (send gEgo:posn(157 137)loop(3)))//south
(case 4 (send gEgo:posn(98 110)loop(0)))//west
(case 5 (send gEgo:posn(176 93)loop(0)))//come up ladder
)
(switch(caveLevel)
(case 0
(switch(caveRoom)
(case 24
= goNorth 18
= goEast 0
= goSouth 100 // to world map room 12
= goWest 23
)
(case 23
= goNorth 0
= goEast 24
= goSouth 0
= goWest 22
)
(case 22
= goNorth 16
= goEast 23
= goSouth 0
= goWest 0
)
(case 21
= goNorth 15
= goEast 0
= goSouth 0
= goWest 20
)
(case 6
= goNorth 0
= goEast 0
= goSouth 12
= goWest 0
(ladderDown:addToPic())
= doYellow TRUE
)
)// end caveRoom switch for level 0
)// end level 0 case
(case 1
(switch(caveRoom)
(case 34
= goNorth 28
= goEast 35
= goSouth 0
= goWest 0
)
(case 35
= goNorth 0
= goEast 0
= goSouth 0
= goWest 34
)
(case 18
= goNorth 0
= goEast 0
= goSouth 24
= goWest 0
(ladderUp:addToPic())
= doNavy TRUE
)
)// end caveroom switch
)// end caveLevel 1
)// end caveLevel switch
(if(== goNorth 0)
(northBlock:addToPic())
Graph(grDRAW_LINE 76 134 76 177 -1 -1 clWHITE)// y1 x1 y2 x2
)
(if(== goSouth 0)
(southBlock:addToPic())
Graph(grDRAW_LINE 137 138 137 177 -1 -1 clWHITE)// y1 x1 y2 x2
)
(if(== goEast 0)
(eastBlock:addToPic())
Graph(grDRAW_LINE 99 231 121 231 -1 -1 clWHITE)// y1 x1 y2 x2
)
(if(== goWest 0)
(westBlock:addToPic())
Graph(grDRAW_LINE 101 86 120 86 -1 -1 clWHITE)// y1 x1 y2 x2
)
SetUpEgo()
(if(doYellow)
(send gEgo:observeControl(ctlYELLOW)init())
)
(else
(if(doNavy)
(send gEgo:observeControl(ctlNAVY)init())
)
(else
(send gEgo:init())
)
)
)// end init method
)// end instance
(if(>(send gEgo:y) 145)
= caveRoom goSouth // reset our global variable to the value held in local variable
= lastCaveRoom 1 // remember this actually represents direction not a room number
= goToRoom 200 // off to the jumper script which reloads cave rooms or special rooms
)
(if(<(send gEgo:y) 77) = caveRoom goNorth = lastCaveRoom 3 = goToRoom 200)
(if(>(send gEgo:x) 233) = caveRoom goEast = lastCaveRoom 4 = goToRoom 200)
(if(<(send gEgo:x) 80) = caveRoom goWest = lastCaveRoom 2 = goToRoom 200)
// Click on View
(if((> (send pEvent:x) (ladderDown:nsLeft))and
(< (send pEvent:x) (ladderDown:nsRight))and
(> (send pEvent:y) (ladderDown:nsTop))and
(< (send pEvent:y) (ladderDown:nsBottom)))
(switch(gCurrentCursor)
(case 999 (send pEvent:type(evMOUSEBUTTON) claimed(FALSE))) // walk
(case 998 (send pEvent:type(evMOUSEBUTTON) claimed(TRUE))Print("There is a ladder here leading further down into the caves."))// look
(case 996 (send pEvent:type(evMOUSEBUTTON) claimed(TRUE))Print("The ladder has nothing to say."))// talk
(case 995 (send pEvent:type(evMOUSEBUTTON) claimed(TRUE))// get
(if(send gEgo:inRect(136 94 184 120))
(switch(caveLevel)
(case 0 = caveLevel 1 = caveRoom 18 = lastCaveRoom 0)// from level 0 to level 1 and into room 18 from ladder...
(case 1 = caveLevel 2 = caveRoom 4 = lastCaveRoom 0)
(case 2 = caveLevel 4 = caveRoom 4 = lastCaveRoom 0)// skipping a level ... just too much maze
)
= goToRoom 200
)
(else
Print("You need to stand in a better spot")
)
)// end case
(default (send pEvent:type(evMOUSEBUTTON) claimed(TRUE))Print("There is no reason to use that on the ladder."))// item
)// end current cursor switch
)// end if item
I have tried setting the nsTop, lsTop, and brTop in an attempt to stretch the footprint of the prop so that it blocks the entire path rather than the small white control area seen above. But all three had no effect. I am pretty sure that the underbits property controls the control color used, but not the size. Any ideas how I can do this with the views properties?You're on the right track, actually. The brTop etc. properties are used for actor collision checks. Your problem is they are calculated automatically when stuff moves, so you can't change them directly. Instead, you want to create a "base setter" object (there is one in the template game already, it's called NormalBase in Main.sc). This object works its magic inside a doit method, where you calculate the br* properties. After writing your own base setter, all you need to do is set the baseSetter property on the actor in question to point to that object.
I can always just draw some control lines and program an observeControl or two when needed, but for some reason I think that controlling the underbits height should be accomplishable with properties, I just can't seem to find the right ones.