Wintermute Engine Forum

Wintermute Engine => Technical forum => Topic started by: Wraith on March 09, 2004, 07:44:28 PM

Title: Intro Screen Menu without mainmenu window
Post 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  :-\
Title: Re:Intro Screen Menu without mainmenu window
Post by: Mnemonic on March 09, 2004, 07:50:59 PM
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:

Code: [Select]
////////////////////////////////////////////////////////////////////////////////
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:

Code: [Select]
////////////////////////////////////////////////////////////////////////////////
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.
Title: Re:Intro Screen Menu without mainmenu window
Post by: Wraith on March 09, 2004, 08:03:04 PM
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
Title: Re:Intro Screen Menu without mainmenu window
Post by: Mnemonic on March 09, 2004, 08:08:09 PM
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 ..."


Title: Re:Intro Screen Menu without mainmenu window
Post by: Wraith on March 09, 2004, 08:33:50 PM
Great! So the "!=" is the key there, huh? I understand now. Thank you!
-Wraith
(http://archetype-design.net/mquest/images/logos/BrownApproved.jpg)
Title: Re:Intro Screen Menu without mainmenu window
Post by: Wraith on March 11, 2004, 03:19:16 PM
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
Title: Re:Intro Screen Menu without mainmenu window
Post by: Mnemonic on March 11, 2004, 03:22:06 PM
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.