Please login or register.

Login with username, password and session length
Advanced search  

News:

For WME related articles and tutorials visit WME Resource Center.

Author Topic: Excluding a window from saving procedure !  (Read 4292 times)

0 Members and 1 Guest are viewing this topic.

pakhpakh64

  • Lurker
  • *
  • Karma: -1
  • Offline Offline
  • Gender: Male
  • Posts: 28
    • View Profile
Excluding a window from saving procedure !
« on: February 28, 2013, 01:33:35 PM »

hello everybody,
I have problem with saving procedure. I want to exclude a specific window from saving. here is what troubles me: ::slug
in some state of the game development I create a save slot, THEN change some properties in a window. but when I load the saved game, the old version of the window is loaded and it doesn't reflects the changes. :'(

the question is can I have such a window that works inside the game but is Not included in saving procedure?
I hope I've been able to describe my problem well.
thanks in advance

PakhPakh64
Logged

anarchist

  • Regular poster
  • ***
  • Karma: 5
  • Offline Offline
  • Gender: Male
  • Posts: 212
    • View Profile
Re: Excluding a window from saving procedure !
« Reply #1 on: February 28, 2013, 06:28:26 PM »

I assume you mean game properties which you wish to remain whether you load an old save or even start a new game (like volume, subtitles etc). I also assume that you save those properties in variables inside the game.

If you indeed save the properties in variables, then what happens is correct, since the WME save function makes sure to save everything you have in memory. What I suggest you do is saving the settings in a file, and every time you start or load a game, open that file and set your properties from there. I haven't worked with files in WME yet but if you have tried working with files in other languages you will not have any trouble. I am certain other members of the forum who have finished games have worked with files.

Better start from the file object documentation: http://docs.dead-code.org/wme/generated/scripting_ref_file.html
Logged

2.0

  • Regular poster
  • ***
  • Karma: 4
  • Offline Offline
  • Posts: 217
    • View Profile
Re: Excluding a window from saving procedure !
« Reply #2 on: February 28, 2013, 10:07:33 PM »

Also - and this is a little bit simpliest way than working with files - you can use functions that read/write data in the registry:

RegWriteNumber    Writes a given number to the Windows Registry.
RegWriteString    Writes a given string to the Windows Registry.
RegReadNumber    Reads a numeric value from the Windows Registry.
RegReadString     Reads a string value from the Windows Registry.
Logged

pakhpakh64

  • Lurker
  • *
  • Karma: -1
  • Offline Offline
  • Gender: Male
  • Posts: 28
    • View Profile
Re: Excluding a window from saving procedure !
« Reply #3 on: March 01, 2013, 09:30:37 AM »

tnx a lot, I try them.
Logged

anarchist

  • Regular poster
  • ***
  • Karma: 5
  • Offline Offline
  • Gender: Male
  • Posts: 212
    • View Profile
Re: Excluding a window from saving procedure !
« Reply #4 on: March 01, 2013, 06:50:36 PM »

What 2.0 proposed seems better than mine, so I suggest you try his first.

The only drawback I can see is something many games and applications do, which is not deleting the registry entries they used after the application is uninstalled  ::)
Logged

2.0

  • Regular poster
  • ***
  • Karma: 4
  • Offline Offline
  • Posts: 217
    • View Profile
Re: Excluding a window from saving procedure !
« Reply #5 on: March 02, 2013, 07:51:07 AM »

What 2.0 proposed seems better than mine, so I suggest you try his first.

The only drawback I can see is something many games and applications do, which is not deleting the registry entries they used after the application is uninstalled  ::)

WME anyway creates its own section in the registry to store some service data, and user's data will be created in that section, so in our case it is not so bad :)
Logged

pakhpakh64

  • Lurker
  • *
  • Karma: -1
  • Offline Offline
  • Gender: Male
  • Posts: 28
    • View Profile
Re: Excluding a window from saving procedure !
« Reply #6 on: March 03, 2013, 08:38:49 AM »

hello again, well since the strings I want to load in the window are not so little and there is is a good possibility that the strings would get changed, so I went for the anarchist's method. ::)
So after doing this method a new problem arose! before I explain it I have to say that this window is for loading presaved games. so now I really need to call "AfterLoad" event to refresh the window according to the string file. the window is loaded in a script other than Game.script, the problem is even though I have declared the window variable in both script as global, I still get these two error and warning:  ::slug
Code: [Select]
Warning: variable 'GameDebugModeToolWindow' is inaccessible in the current block. Consider changing the script (script:scripts\game.script, line:138)
Runtime error. Script 'scripts\game.script', line 138
     Call to undefined method 'ApplyEvent'. Ignored.
any ideas?
Logged

pakhpakh64

  • Lurker
  • *
  • Karma: -1
  • Offline Offline
  • Gender: Male
  • Posts: 28
    • View Profile
Re: Excluding a window from saving procedure !
« Reply #7 on: March 03, 2013, 03:35:27 PM »

ok problem solved, but honestly I don't know how!
now I can load my window according to the file. thank you all.
Logged
 

Page created in 0.019 seconds with 21 queries.