User Tag List

Results 1 to 3 of 3

Thread: Possible corruption when saving an array to disk?

  1. #1
    Clicker Multimedia Fusion 2 DeveloperiOS Export ModuleSWF Export ModuleInstall Creator Pro

    Join Date
    Jul 2006
    Location
    Germany
    Posts
    1,090
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Possible corruption when saving an array to disk?

    I store game data in an array. While experimenting with the code I destroyed my array accidentally because I saved it to disk and a few event lines later I gave another save-command.

    This seems logical to me, I guess it's a timing problem when using this command 2 times within one MMF loop. But now I'm a little scared there may be other timing problems which could corrupt a file.

    How can I make sure a file is written completely before giving another write command? For example, if writing is delayed because the hd was in power saving and needs to spin up. Could something like this cause trouble?

  2. #2
    Clickteam Clickteam

    Join Date
    Jun 2006
    Location
    France
    Posts
    14,022
    Mentioned
    279 Post(s)
    Tagged
    3 Thread(s)

    Re: Possible corruption when saving an array to disk?

    When you save an array, the file is closed before the command returns, so you can do several Save actions one after each other, I don't see why there would be a timing problem. There must be another reason for this problem.

    Yves.

  3. #3
    Clicker Multimedia Fusion 2 DeveloperiOS Export ModuleSWF Export ModuleInstall Creator Pro

    Join Date
    Jul 2006
    Location
    Germany
    Posts
    1,090
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Possible corruption when saving an array to di

    I already fixed the problem some days ago, so it's a bit hard to recreate. Is it possible there's a conflict between loading and saving?

    Just found a way to add at this strange behaviour again, maybe I was wrong and it's not the combination save-save but load-save instead.

    Here's what I do:
    - load array and read some of it's strings
    - activate group "Test" when timer is greater than 00"-70 (I don't want this timer condition, but it prevents malfunction)
    - in group "Test" I compare one specific string of the array with a String Object
    - if the strings are different, I change some array fields and save the updated file
    - the group is deactivated right after this check
    - jump to next frame when timer is greater than 00"-80 and group "Test" is deactivated

    This works fine! But once I activate group "Test" without a timer delay, all data of the array is lost, all fields are empty. That's why I thought there may be a timing problem when accessing the file. Can it be that loading is only partially complete when the strings are compared, then the check fails and the incomplete data is saved, corrupting the array's structure?

    The timer condition seems to be the only difference between proper function and desaster

Similar Threads

  1. Preventing HigscoreObject from saving ini file to disk
    By King_Cool in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 22nd November 2012, 11:24 PM
  2. Saving to array from a sub app
    By Windybeard in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 6th June 2012, 01:44 PM
  3. Saving an array?
    By Tsun in forum SWF/Flash Export Module Version 2.0
    Replies: 3
    Last Post: 7th April 2012, 04:08 PM
  4. Problem saving game on a disk
    By thebeast250 in forum File Archive
    Replies: 4
    Last Post: 18th March 2011, 11:00 AM
  5. Array Saving
    By B5E in forum The Games Factory 2 - Technical Support
    Replies: 10
    Last Post: 28th July 2010, 03:51 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •