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: SAVE game  (Read 4471 times)

0 Members and 1 Guest are viewing this topic.

SBOVIS

  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 404
  • FORGET REALITY SURRENDER TO YOUR DARKEST DREAMS
    • View Profile
    • LIMBO of the LOST
SAVE game
« on: May 26, 2006, 07:02:59 AM »

Hi, I want to deactivate the SAVE feature of WME in certain scenes.
Or at the start of a group of scenes that are connected.

I want it that the player just cannot click on the SAVE buttons but the menu does appear.


How can I do this??



Many thanks
Logged
kind Regards
Steve Bovis
MAJESTIC STUDIOS

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: SAVE game
« Reply #1 on: May 26, 2006, 09:05:41 AM »

Well the most straighforward way would be to test the name of the current scene and disable the save button.
In the script of your menu window you'd do something like:

Code: [Select]
var SaveButton = this.GetControl("save");
if(Scene.Name=="some_scene" || Scene.Name=="some_other_scene")
  SaveButton.Disabled = true;
 

Sure there would me more elegant ways, like adding a custom scene attribute for this, but I think this will do for your purposes.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

SBOVIS

  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 404
  • FORGET REALITY SURRENDER TO YOUR DARKEST DREAMS
    • View Profile
    • LIMBO of the LOST
Re: SAVE game
« Reply #2 on: May 31, 2006, 04:28:34 PM »

Hi,
     I have tried this both in the mainmenu and in the save menu but I cannot get it to work.

I am using the base mainmenu and save menu from the WME demo if that helps??


Logged
kind Regards
Steve Bovis
MAJESTIC STUDIOS

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: SAVE game
« Reply #3 on: May 31, 2006, 06:07:59 PM »

If your save button is called "save", it should work (in mainmenu.script).
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

SBOVIS

  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 404
  • FORGET REALITY SURRENDER TO YOUR DARKEST DREAMS
    • View Profile
    • LIMBO of the LOST
Re: SAVE game
« Reply #4 on: May 31, 2006, 06:34:37 PM »

Here is my Mainmenu.script, with the code in it.

But I can still save on scene WRATH001

#include "scripts\base.inc"
#include "scripts\keys.inc"

var SaveButton = this.GetControl("save");
if(Scene.Name=="scenes\wrath001.scene")
SaveButton.Disabled = true;

////////////////////////////////////////////////////////////////////////////////
on "close"
{
Game.PlaySound("sounds\menuclose.ogg"); 
self.Close();
}


////////////////////////////////////////////////////////////////////////////////
on "quit"
{
Game.PlaySound("sounds\menu button.wav"); 
var WinQuit = Game.LoadWindow("interface\system\quit.window");
  WinQuit.Center();
  WinQuit.GoSystemExclusive();

  if(WinQuit.xResult)
  {
    Game.QuitGame();
  }
  else Game.UnloadObject(WinQuit);
}


////////////////////////////////////////////////////////////////////////////////
on "Keypress"
{
  var button;
  if(Keyboard.KeyCode==VK_ESCAPE){
    button = self.GetWidget("close");
    button.Press();
  }
}


////////////////////////////////////////////////////////////////////////////////
on "load"
{
Game.PlaySound("sounds\menu button.wav");   
var WinLoad = Game.LoadWindow("interface\system\load.window");
  WinLoad.Center();
  WinLoad.GoSystemExclusive();
  Game.UnloadObject(WinLoad);
}


////////////////////////////////////////////////////////////////////////////////


on "save"
{
Game.PlaySound("sounds\menu button.wav");
  var WinSave = Game.LoadWindow("interface\system\save.window");
  WinSave.Center();
  WinSave.GoSystemExclusive();
  if(WinSave.xResult==true)
  {
    self.Close();
    Game.UnloadObject(WinSave);
  }
  else
    Game.UnloadObject(WinSave);
}
Logged
kind Regards
Steve Bovis
MAJESTIC STUDIOS

odnorf

  • w00t?
  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 7
  • Offline Offline
  • Gender: Male
  • Posts: 1456
  • Lamp dog!
    • View Profile
Re: SAVE game
« Reply #5 on: May 31, 2006, 06:50:22 PM »

"scenes\wrath001.scene" is not the name of the scene but the filename.

So in your case I think the line should be
Code: [Select]
if(Scene.Name=="wrath001")
You can find this name in wrath001.scene at parameter NAME="something"
Logged
fl*p

SBOVIS

  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 404
  • FORGET REALITY SURRENDER TO YOUR DARKEST DREAMS
    • View Profile
    • LIMBO of the LOST
Re: SAVE game
« Reply #6 on: May 31, 2006, 07:05:29 PM »

Oh right, ok................understand now.

Thanks
Logged
kind Regards
Steve Bovis
MAJESTIC STUDIOS

SBOVIS

  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 404
  • FORGET REALITY SURRENDER TO YOUR DARKEST DREAMS
    • View Profile
    • LIMBO of the LOST
Re: SAVE game
« Reply #7 on: May 31, 2006, 08:38:30 PM »

This works fine now, But can I change the text on the button that is now Disabled?

I know its defined under the window of the mainmenu is there a command I can use to change the TEXT =" blah de blah" to TEXT ="something else"


Logged
kind Regards
Steve Bovis
MAJESTIC STUDIOS

odnorf

  • w00t?
  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 7
  • Offline Offline
  • Gender: Male
  • Posts: 1456
  • Lamp dog!
    • View Profile
Re: SAVE game
« Reply #8 on: May 31, 2006, 08:53:10 PM »

According to the excellent wme docs  ;) buttons offer a Text attribute.
Logged
fl*p

SBOVIS

  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 404
  • FORGET REALITY SURRENDER TO YOUR DARKEST DREAMS
    • View Profile
    • LIMBO of the LOST
Re: SAVE game
« Reply #9 on: May 31, 2006, 08:56:53 PM »

OK, OK, got the answer now to this, thanks for the pointer
Logged
kind Regards
Steve Bovis
MAJESTIC STUDIOS
 

Page created in 0.047 seconds with 21 queries.