Author Topic: Disallow access to menubar  (Read 6193 times)

0 Members and 1 Guest are viewing this topic.

Offline MusicallyInspired

Disallow access to menubar
« on: June 22, 2007, 06:04:04 PM »
How? I can make it hide but if I press ESC it brings it up anyway.


Brass Lantern Prop Competition

Offline troflip

Re: Disallow access to menubar
« Reply #1 on: June 22, 2007, 07:24:01 PM »
Why would you do that?  What if the user wants to quit the game?
Check out my website: http://icefallgames.com
Groundhog Day Competition

Offline Doan Sephim

Re: Disallow access to menubar
« Reply #2 on: June 22, 2007, 07:30:35 PM »
I've wanted to do that also because during my intro, if you click on the menubar it messes up the syncrhonization of my views...the time is off. I also want to know how to achieve this...the user in my case could quit by skipping the intro and then quitting via menubar...

Offline troflip

Re: Disallow access to menubar
« Reply #3 on: June 22, 2007, 11:06:06 PM »
Are there any Sierra games that do this? (if so, then at least we'd know it's possible)
Check out my website: http://icefallgames.com
Groundhog Day Competition

Offline Doan Sephim

Re: Disallow access to menubar
« Reply #4 on: June 23, 2007, 12:33:51 AM »
All games do it during the titlescreen.

Offline MusicallyInspired

Re: Disallow access to menubar
« Reply #5 on: June 23, 2007, 01:11:28 AM »
Yeah. And I, for one, would like to disable any means of saving or restoring a game in the middle of a introduction, cutscene, or ending sequence.
Brass Lantern Prop Competition

Offline troflip

Re: Disallow access to menubar
« Reply #6 on: June 23, 2007, 02:34:24 AM »
Try
Code: [Select]
(use "menubar")

and
Code: [Select]
(TheMenuBar:state(DISABLED))

Code: [Select]
(TheMenuBar:state(ENABLED))

Check out my website: http://icefallgames.com
Groundhog Day Competition

Offline Doan Sephim

Re: Disallow access to menubar
« Reply #7 on: June 23, 2007, 12:10:37 PM »
Nice and easy, simple and perfect!

Thank Troflip...it's always the simplest things I can never figure out ;)

Offline MusicallyInspired

Re: Disallow access to menubar
« Reply #8 on: June 23, 2007, 03:27:30 PM »
It works. But whenever I use
Code: [Select]
(TheMenuBar:state(ENABLED))the game crashes.

EDIT: Actually, whenever I use
Code: [Select]
(TheMenuBar:show())it always crashes, too. I've already got
Code: [Select]
(use "menubar")in there.
« Last Edit: June 23, 2007, 03:33:18 PM by MusicallyInspired »
Brass Lantern Prop Competition

Offline troflip

Re: Disallow access to menubar
« Reply #9 on: June 23, 2007, 03:44:39 PM »
Post your code...

What does the sierra interpreter show when you run it with the -d option?
e.g. go to a windows command prompt, and type
Code: [Select]
sciv.exe -d
Check out my website: http://icefallgames.com
Groundhog Day Competition

Offline MusicallyInspired

Re: Disallow access to menubar
« Reply #10 on: June 23, 2007, 05:06:30 PM »
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.

Code: [Select]
/******************************************************************************
 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())
)
)
« Last Edit: February 10, 2010, 09:20:26 PM by Cloudee1 »
Brass Lantern Prop Competition

Offline troflip

Re: Disallow access to menubar
« Reply #11 on: June 23, 2007, 07:30:36 PM »
show is not a method on TheMenuBar.  You're probably looking for (TheMenuBar:draw()).

My c-style compiler will probably catch this error at compile time.

(TheMenuBar:state(DISABLED))  should work fine though.
Check out my website: http://icefallgames.com
Groundhog Day Competition

Offline MusicallyInspired

Re: Disallow access to menubar
« Reply #12 on: June 23, 2007, 10:04:31 PM »
Ah there we are. I was using the DISABLED code the same time I was using the hide() code. Which is why it crashed. All good now
Brass Lantern Prop Competition


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

Page created in 0.027 seconds with 23 queries.