Wintermute Engine Forum
Wintermute Engine => Technical forum => Topic started by: Wraith on March 09, 2004, 07:44:28 PM
-
Howdy Y'all,
I've created an "intro screen/menu" once the game loads up for buttons such as "Replay Intro", "New Game" "Load Game", "Options", "Quit Game", etc. and am wanting to suspend the floating "MainMenu" Window (load, save, quit, resume, etc.) found in the game once sombody hits the "ESC" key. I need to suspend it only for that one screen, though it is loaded in the game.script. Is there an easy way to do this, am I overlooking the obvious in code, am I incredibly lazy, or is this a silly question? Inquiring minds want to know!
-Wraith :-\
-
Ok, unless your intro buttons are formed by a window running in an exclusive mode, you'll have to do this:
Open the game.script and find the "keypress" handles.
It should look like this:
////////////////////////////////////////////////////////////////////////////////
on "Keypress"
{
// on Esc or F1 key
if(Keyboard.KeyCode==VK_ESCAPE || Keyboard.KeyCode==VK_F1)
{
...
You will need to modify the condition to check current scene name:
////////////////////////////////////////////////////////////////////////////////
on "Keypress"
{
// on Esc or F1 key
if(Scene.Name=="intro" && (Keyboard.KeyCode==VK_ESCAPE || Keyboard.KeyCode==VK_F1))
{
...
Of course, you'll have to replace "intro" with the actual name of your intro scene.
-
Okay, so my first game screen/scene is called "intromenu.scene" (the Intro Menu with buttons) where I do not want the "mainmenu.window" popping up. The very first in-game scene is called "cr1.scene", is the condition this?:
if(Scene.Name=="cr1.scene" && (Keyboard.KeyCode==VK_ESCAPE || Keyboard.KeyCode==VK_F1))
so when I enter into the game (actor and all) starting at cr1.scene this will then enable the "mainmenu.window" or do I have this backward?
-W
-
Oops, sorry, I wrote it wrong, the condition in your case will be:
if(Scene.Name!="intromenu" && (Keyboard.KeyCode==VK_ESCAPE || Keyboard.KeyCode==VK_F1))
i.e. "if the scene is NOT "intromenu" AND Key is pressed THEN ..."
-
Great! So the "!=" is the key there, huh? I understand now. Thank you!
-Wraith
(http://archetype-design.net/mquest/images/logos/BrownApproved.jpg)
-
Okay, on this same subject, there is a similar issue with the actor I want to suspend momentarily from loading in my Intro Screen. Shoud I use an "If...then" statement ("if(Scene.Name!="intromenu"...") in my game.script or a scene.UnloadObject(actor) or game.UnloadObject(actor) command in the "intromenu" scene's "scene_ini.script"? I've tested these options already with no good results. But then again, that's why I'm titled "Newbie".
-W :P
-
add actor.Active = false; to the scene_init.script of your intro scene. This will hide the actor. But you'll have to show him again before leaving the intro scene; i.e. before you call Game.ChangeScene, make actor.Active = true; again.