Please login or register.

Login with username, password and session length
Advanced search  

News:

Latest WME version: WME 1.9.1 (January 1st, 2010) - download

Author Topic: Menu Page  (Read 4076 times)

0 Members and 1 Guest are viewing this topic.

xportmedia

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 11
    • View Profile
Menu Page
« on: May 31, 2010, 10:37:30 PM »

Hi there

Rather than using the wintermute `esc` menu, I have created a scene for loading, saving, etc.  The scene does not use any window, I have attached scripts to sprite entities, this is all fine, but when I save or load a game in this manner I get an error message.  As I am also saving from a menu.scene, I need to save a thumbnail from the previous scene.  Any chance that I can do this?

At the moment I am just calling up the save and load window using scripts within my menu scene.  Do I have to bite the bullet and adapt the wintermute menu window?

Thanks

Paul
Logged

Akatosh

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 14
  • Discomfort generates evolution.
    • View Profile
Re: Menu Page
« Reply #1 on: May 31, 2010, 10:52:52 PM »

May we see the error that appears on the log ? Maybe It can help to identify the error.

Regarding the thumbnail preview of the previous scene. My best bet would be each time you load the menu.scene, it would save a temp image of the scene before loading the actual menu scene.

Hope It helped :)

xportmedia

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 11
    • View Profile
Re: Menu Page
« Reply #2 on: May 31, 2010, 11:16:10 PM »

Hi there

Here are the error logs I am getting when trying to save or load.  This is just the standard Wintermute save and load window, but accessed from a script rather than the original Menu window.

23:11:48:  CBSprite::LoadFile failed for file 'savegame:0'
23:12:03:  CBSprite::LoadFile failed for file 'savegame:1'
23:12:09:  Saving game 'C:\Users\Paul\Saved Games\Night_Train_Test_1\save001.dsv'...
23:12:11:  Runtime error. Script 'scenes\menu\scr\save.script', line 13
23:12:11:    Call to undefined method 'Close'. Ignored.

Sorry to sound really stupid?  But how would I save a previous scene as an image to use attach to a save game file?

Thanks for your help.
Logged

metamorphium

  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 12
  • Offline Offline
  • Gender: Male
  • Posts: 1511
  • Vampires!
    • View Profile
    • CBE  software s.r.o.
Re: Menu Page
« Reply #3 on: May 31, 2010, 11:22:36 PM »

you shouldn't access methods of window. Rather you should simply call Game.SaveGame by yourself. This way you're breaking the logic of already different solution.
Logged
J.U.L.I.A. Enhanced Edition, Vampires!, J.U.L.I.A., J.U.L.I.A. Untold, Ghost in the Sheet

Akatosh

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 14
  • Discomfort generates evolution.
    • View Profile
Re: Menu Page
« Reply #4 on: May 31, 2010, 11:38:06 PM »

I don't know how you did it in your game, but let's say you have something like this on game.script:
Code: [Select]
on "Keypress"
{
  // on Esc or F1 key
  if(Keyboard.KeyCode==VK_ESCAPE || Keyboard.KeyCode==VK_F1)
  {
    // takes a screenshot and loads the menu.scene
    Game.StoreSaveThumbnail();
    Game.ChangeScene("scenes\menu\menu.scene");
  }
}

I don't have access to Windows at this moment, so I can't guarantee that works. But It should be something like that. Try checking this http://docs.dead-code.org/wme/generated/scripting_ref_game.html.

« Last Edit: May 31, 2010, 11:40:46 PM by Akatosh »
Logged

xportmedia

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 11
    • View Profile
Re: Menu Page
« Reply #5 on: May 31, 2010, 11:42:52 PM »

Will give it a go!

Thanks for such a quick reply  :)
Logged
 

Page created in 0.039 seconds with 23 queries.