Please login or register.

Login with username, password and session length
Advanced search  

News:

IRC channel - server: waelisch.de  channel: #wme (read more)

Author Topic: Intro Screen Menu without mainmenu window  (Read 5951 times)

0 Members and 1 Guest are viewing this topic.

Wraith

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 21
  • I put the "EW" in "Newbie".
    • View Profile
    • Archetype Illustration & Design
Intro Screen Menu without mainmenu window
« 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  :-\
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re:Intro Screen Menu without mainmenu window
« Reply #1 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.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Wraith

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 21
  • I put the "EW" in "Newbie".
    • View Profile
    • Archetype Illustration & Design
Re:Intro Screen Menu without mainmenu window
« Reply #2 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
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re:Intro Screen Menu without mainmenu window
« Reply #3 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 ..."


Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Wraith

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 21
  • I put the "EW" in "Newbie".
    • View Profile
    • Archetype Illustration & Design
Re:Intro Screen Menu without mainmenu window
« Reply #4 on: March 09, 2004, 08:33:50 PM »

Great! So the "!=" is the key there, huh? I understand now. Thank you!
-Wraith

« Last Edit: March 09, 2004, 08:37:13 PM by Wraith »
Logged

Wraith

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 21
  • I put the "EW" in "Newbie".
    • View Profile
    • Archetype Illustration & Design
Re:Intro Screen Menu without mainmenu window
« Reply #5 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
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re:Intro Screen Menu without mainmenu window
« Reply #6 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.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave
 

Page created in 0.154 seconds with 21 queries.