I've recreated a short demo plug that plays when you look into the rock on from the cliff platform in KQ2. When it's initialized I hide the menubar and disable it. Once it's over it takes you back to the screen where you looked into the hole and I want the menubar to be re-enabled and shown again. I took out the menubar DISABLED code because it was crashing but if I just hide it for the duration of the sequence it crashes once it gets back to the room it came from and try to show() it again.
I'm just using it as a test Said statement in room one for now. the "case 117" in the gPreviousRoomNumber is where I've programmed the inits when you come back from the last screen in the sequence which is room 117.
It says "'show' is not a selector for TheMenuBar" when I run sciv.exe -d.
/******************************************************************************
SCI Template Game
By Brian Provinciano
******************************************************************************
rm001.sc
Contains the first room of your game.
******************************************************************************/
(include "sci.sh")
(include "game.sh")
/******************************************************************************/
(script 1)
/******************************************************************************/
(use "main")
(use "controls")
(use "cycle")
(use "game")
(use "feature")
(use "obj")
(use "inv")
(use "door")
(use "jump")
(use "dpath")
(use "menubar")
/******************************************************************************/
(instance public rm001 of Rm
(properties
picture scriptNumber
// Set up the rooms to go to/come from here
north 43
east 2
south 8
west 0
)
(method (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)
)
)*/
(case north
(send gEgo:
posn(220 38)
loop(2)
)
)
(case east
(send gEgo:
posn(310 send gEgo:y) //y is remembered
loop(1)
)
)
(case west
(send gEgo:
posn(10 send gEgo:y) //y is remembered
loop(0)
)
)
(case south
(send gEgo:
posn((send gEgo:x) 180) //x is remembered
loop(3)
)
)
(case 117
(send gEgo:
posn((send gEgo:x) (send gEgo:y))
loop (send gEgo:loop())
)
(send gGame:setCursor(999 1))
PlayerControl()
= gProgramControl FALSE
(TheMenuBar:show())
)
// Set up ego's position if it hasn't come from any room
(default
(Animate((DrawPic(1 dpCLOSEREOPEN_CHECKBOARD))))
(send gEgo:
posn(139 132)
loop(0)
)
)
)
// 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 (doit)
(if (== (send gEgo:onControl()) ctlGREEN)
(ankleWater:dispose())
(send gEgo:setCycle(StopWalk gEgoWading gEgoWading))
)
(if (& (send gEgo:onControl()) ctlTEAL)
(send gEgo:setCycle(StopWalk gEgoWadingDeep gEgoWadingDeep))
)
(if (& (send gEgo:onControl()) ctlMAROON)
(send gEgo:setCycle(StopWalk gEgoSwimming gEgoSwimming))
)
(if (& (send gEgo:onControl()) ctlNAVY)
(if (== (send gEgo:view()) (gEgoView))
(ankleWater:init()setCycle(Fwd))
)(else
(if (== (send gEgo:view()) (gEgoStoppedView))
(ankleWater:init()setCycle(CT))
)(else
(send gEgo:setCycle(StopWalk gEgoView gEgoStoppedView))
)
)
)
(if (== (send gEgo:onControl()) ctlBLACK)
(ankleWater:dispose())
(send gEgo:setCycle(StopWalk gEgoView gEgoStoppedView))
)
(if (& (send gEgo:onControl()) ctlPURPLE)
(send gRoom:newRoom(43))
)
)
(method (handleEvent pEvent)
(super:handleEvent(pEvent))
/*****************************************
* Handle the possible said phrases here *
*****************************************/
(if(Said('look>'))
(if(Said('/rock'))
Print("The rocks are the usual sort of rocks, nothing special.")
)
(if(Said('/(palm<tree) , tree'))
Print("The leaning palm trees sway in the ocean breeze.")
)
(if(Said('/wave'))
Print("You see waves crashing upon the rocks.")
)
(if(Said('/water'))
Print("The calm water of the clear blue ocean looks inviting.")
)
(if(Said('/plant'))
Print("The plants grow well in the moist sea air.")
)
(if(Said('/flower'))
Print("The flowers are a beautiful contrast to the blue ocean.")
)
(if(Said('/sky'))
Print("The clouds in the sky float along slowly on this hot sunny day.")
)
(if(Said('[/around]'))
Print("The glittering white sand of the beach feels warm from the sun.
The azure water of the ocean laps up to its edge.")
)
(if(Said('/*'))
Print("You don't see that here.")
)
)
(if(Said('get>'))
(if(Said('/sand'))
Print("Sifting through the sand, you notice nothing of interest.")
)
(if(Said('/flower'))
Print("The flowers are of no interest.")
)
(if(Said('/water'))
Print("You have no need to carry water.")
)
(if(Said('/rock'))
Print("The rocks are too large and heavy.")
)
(if(Said('/*'))
Print("You can't get that")
)
)
(if(Said('sqdemo'))
Print("Here we go!")
(send gRoom:newRoom(111))
)
)
)
/******************************************************************************/
(instance ankleWater of Prop
(properties
x 0
y 0
view 2
cel 0
)
(method (init)
(super:init())
(self:z(-90))
(self:setScript(anklewaterScript))
)
)
(instance anklewaterScript of Script
(properties)
(method (doit)
(ankleWater:
posn((send gEgo:x) (- (send gEgo:y) 89))
setPri(+ 1 (send gEgo:priority))
)
(super:doit())
)
)