Please login or register.

Login with username, password and session length
Advanced search  

News:

This forum provides RSS feed. To query recent posts use this url. More...


Author Topic: main menu scene for all situations  (Read 9323 times)

0 Members and 1 Guest are viewing this topic.

Rocco

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 87
    • View Profile
    • Virtual-Illusion
main menu scene for all situations
« on: June 30, 2005, 09:44:25 PM »

hi,

i use a menu scene at the beginning of the game, and want to use it also during the game,
when the player press Esc.

is this in the meaning of the engine, or is it better to use *.window objects for the menu?

problem:
i didnt found a variable where i can query the scene(String) which is loaded now, or the scene loaded before?
i thougt it could work like this:

var oldscene = scene.activescene;
Game.ChangeScene("scenes\Room\menu.scene");

and pressing resume game back to the game:
Game.ChangeScene(oldscene);

is this possible?
thx for hints
rocco


Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: main menu scene for all situations
« Reply #1 on: June 30, 2005, 10:01:27 PM »

I would probably use a window for this purpose, but the scene approach would work too. You'd have to hide the actor though, and show him again when leaving the menu. The attribute you're looking for is Game.PrevSceneFilename, i.e. you'd call:

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

Rocco

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 87
    • View Profile
    • Virtual-Illusion
Re: main menu scene for all situations
« Reply #2 on: June 30, 2005, 10:57:59 PM »

thx, i only searched the scene object for this attribute.
i work on a myst style game, there is no actor to hide.
Logged

TheDerman

  • Regular poster
  • ***
  • Karma: 0
  • Offline Offline
  • Posts: 225
    • View Profile
Re: main menu scene for all situations
« Reply #3 on: July 02, 2005, 03:02:37 PM »

I used a "scene" menu at the start of the game as the first scene loaded, and then a full screen window when the player presses "Esc", made to match that first scene - this works perfectly.

How would a menu scene work with the load and save options? If you save with a window menu you get returned to the scene, and similarly if you load the game, you get put into the scene where you saved. Presumabley if using a "scene" menu, you'd get put back to the menu scene each time you saved and loaded, rather than where you want to be...

Would it work to add "Game.ChangeScene(Game.PrevSceneFilename);" to the load and save scripts, after the code that handles those things? Would that be "savename.script" for save, and "load.script" for load?

I think that might work for save, but would it work with load? Would the previous scene value be stored in the save, to be used AFTER the game was loaded next time round?

My "scene" menu isn't setup to save so I can't test this without redoing some things - I'm just wondering about it.
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: main menu scene for all situations
« Reply #4 on: July 02, 2005, 03:25:34 PM »

Yes, it will work. The Scene.PrevSceneFilename attribute gets saved and restored respectively.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Rocco

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 87
    • View Profile
    • Virtual-Illusion
Re: main menu scene for all situations
« Reply #5 on: July 05, 2005, 01:05:46 PM »

Can I Query the scene which is currently active - like PrevSceneFilename??

cause i dont want the sierra style rightcklick-actions in the menu-scene.
also for the keypress command it would be useful for me,
in a game scene <Esc> returns to menu scene, in menu <Esc> shut down the game.
Logged

Jerrot

  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 690
    • View Profile
Re: main menu scene for all situations
« Reply #6 on: July 05, 2005, 01:22:28 PM »

Can I Query the scene which is currently active - like PrevSceneFilename??

You can use Scene.Name for this. (I'm not sure whether Scene.Filename exists as well though)

EDIT: As Mnemonic just told me they both do exist, they just missed the documentation somehow. :)
« Last Edit: July 05, 2005, 01:31:19 PM by Jerrot »
Logged
Mooh!

Rocco

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 87
    • View Profile
    • Virtual-Illusion
Re: main menu scene for all situations
« Reply #7 on: July 05, 2005, 02:49:35 PM »

ohh thx, its often better to try some things out.
I did it now with scene.name, which was a bit more scripting.
another question:
is it possible to activate a click event in script??
my case - i want to store the latest used cursor and
reassign it if the player resumes the game.
one thing is to insert the switch statement in all possibilities,
but with Game.RightMouseClick it could be much easier.
is there a command for this??
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: main menu scene for all situations
« Reply #8 on: July 05, 2005, 03:23:39 PM »

You'd better put the cursor setting code into a function and then call the function whenever needed.
But if you insist on simulating the mouse click, you can achieve it by calling this:

Game.ApplyEvent("RightClick");
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Rocco

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 87
    • View Profile
    • Virtual-Illusion
Re: main menu scene for all situations
« Reply #9 on: July 05, 2005, 05:12:27 PM »

big thanks, the rightClick cursor thing looks good now.
but other things are not so easy for me.
As TheDerman wrote, when i load a saved game, it starts in the menuscreen.
I tried some things with AfterLoad, to determine when i have to use the Game.ChangeScene(Game.PrevSceneFilename); command
but without success, which script place i have to put this command??
another question, i have an Start-new-game Button in the menu, is there a command to reset the whole game??
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: main menu scene for all situations
« Reply #10 on: July 05, 2005, 05:31:56 PM »

As TheDerman wrote, when i load a saved game, it starts in the menuscreen.
I tried some things with AfterLoad, to determine when i have to use the Game.ChangeScene(Game.PrevSceneFilename); command
but without success, which script place i have to put this command??
Put the ChangeScene right after the Game.SaveGame() call. That's the point where the game continues after loading a saved game.


another question, i have an Start-new-game Button in the menu, is there a command to reset the whole game??
Yes, there's Game.Reset() (surprise! ;))
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Rocco

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 87
    • View Profile
    • Virtual-Illusion
Re: main menu scene for all situations
« Reply #11 on: July 05, 2005, 05:59:38 PM »

Put the ChangeScene right after the Game.SaveGame() call. That's the point where the game continues after loading a saved game.
thanks :-))))

Yes, there's Game.Reset() (surprise! ;))
lol, sorry for beeing such a pain in the neck.
i think your engine is really great, and when im finished with the GUI things,
i will make it open source, maybe its useful for other newbies.
the problem is there are not much examples for newbies, and the engine is rather complex,
ok, the reset command was not so well hidden in the documentation that nobody can find it, but....

thx  ;D


 
Logged

Rocco

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 87
    • View Profile
    • Virtual-Illusion
Re: main menu scene for all situations
« Reply #12 on: July 05, 2005, 06:29:51 PM »

ok, next problem,
the save-game thumbnail show the menu scene.
is it possible to make a screenshot of the prevScene??
thx,
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: main menu scene for all situations
« Reply #13 on: July 05, 2005, 06:50:03 PM »

ok, next problem,
the save-game thumbnail show the menu scene.
is it possible to make a screenshot of the prevScene??
thx,
Hm, right, that's a problem. No, it's not possible for the saved game to get a picture of a previous scene. You could manually take a picture of the scene before entering the menu scene (using Game.TakeScreenshotEx()), but you'd have to store/display the screenshot yourself, i.e. you couldn't use the built-in savegame thumbnail functionality...
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.053 seconds with 20 queries.