User Tag List

Results 1 to 7 of 7

Thread: Array Paths Saving/loading issues

  1. #1
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleSWF Export Module

    Join Date
    Oct 2011
    Posts
    81
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Array Paths Saving/loading issues

    Hi,

    I have been using a global Array Object with same name and properties across all frames to save data on the Save Menu frame. I save and load with the Array fine with the save file created on my desktop where the EXE is. I use the expression "FileNumber"

    However, when I get to a certain frame and then create new save data at the Save Menu, there is no new save file on my desktop. When I open the game to load the file, I do not see any data at all. Then when I get to that certain frame and go create new save data at the Save Menu, it displays that saved data even though it wasn't created on my desktop. But I cannot find my data from the files that were created on the desktop.

    I happened to find that the file is created in my AppData Roaming folder rather than on the desktop only if I have been through that certain frame. I do not know why this happens because that certain frame does not affect file paths in anyway because no saving or loading is done. Otherwise, if I do not go through that certain frame, the file is created on my desktop next to the EXE and I can see all my desktop files data.

    So how do I make it that the data is saved and load from where the EXE directory is consistently?

    I've tried the following but still had a problem that the file path is changed to AppData Roaming as long as I go through that particular frame:

    - Enter "./Arrayfile.arr" in the expression
    - FilePath object: set directory to original
    - FilePath object: create directory ".\Save Folder" + current directory ".\Save Folder" (this creates the Save Folder in the App Roaming unless I don't go to that frame, which will create Save Folder on my desktop)

  2. #2
    Clicker Fusion 2.5 DeveloperInstall Creator Pro

    Join Date
    Sep 2006
    Posts
    517
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Mike,
    Do you have any INI object in your application? If yes, untick its following property: "Create file in AppData directory".

    Additional comments:
    • Set directory to original should not be used in most of the cases. Setting directory to original revert current working directory to the original working directory which may not be the same as executable directory. Use set directory to Apppath$ instead.
    • Changing directory should be done before saving array file. This means that File object's actions must be before Array object's action.
    • Don't save data beside executable because the directory will probably be read-only (and it supposed to be read-only for security reasons) but save them in Application Data instead.


    ouly

  3. #3
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleSWF Export Module

    Join Date
    Oct 2011
    Posts
    81
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you, ouly. You have been a great help.

    I previously deleted all INI Objects, but I think the culprit is the HiScore Object in that particular frame. It automatically creates the Clickteam folder in AppData roaming to save the cncscore file. So in the Save Menu frame when I go save the Array data, it goes to there instead. So I had to set the current directory back to Apppath$.

    I do not want the HiScore object to create any folder or save data. I did not set an INI file for it to associate and left it blank. Even when I set the HiScore file path to Apppath$, the Clickteam folder is still created. How do I prevent that?


    - What's the difference between saving to Appdir$+"File1" and Apppath$+"File1" - I tried both, and both works to get the save data in the same directory as the EXE.
    - Since you suggested to save the data file in Application Data, what is the correct expression I should input for that?

  4. #4
    Clicker Fusion 2.5 DeveloperInstall Creator Pro

    Join Date
    Sep 2006
    Posts
    517
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Mike,
    • Effectively, the Hi-Score object is creating a Clickteam folder in AppData and current directory is changed at the same time. I don't think it can be prevented any way.
    • If you don't specify any INI file, Hi-Score object will use cncscore.ini by default and still create Clickteam folder to store this file in it.
    • Appdrive$ + Appdir$ == Apppath$ (not valid in CF2.5). If you don't specify Appdrive$ before Appdir$, the path is a relative one and therefore may not produce the same result all the time (this will depend on the code before and the current state of the computer).
    • If you are willing to save the data for all users on the same computer, the folder to use is: AllUsersAppDataDirectory$( "FilePath" ) but in most of the cases, the right folder is this one: AppDataDirectory$( "FilePath" )


    ouly

  5. #5
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleSWF Export Module

    Join Date
    Oct 2011
    Posts
    81
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello,

    Let me see if I am understanding it right:

    - So the expression Apppath$ cannot be used in CF2.5, but Appdrive$ and Appdir$ can be?
    - And is AppDataDirectory$( "FilePath" ) applicable for Windows XP and above? I read somewhere that different Window versions may have different folder paths.

  6. #6
    Clicker Fusion 2.5 DeveloperInstall Creator Pro

    Join Date
    Sep 2006
    Posts
    517
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Oh sorry, I'm mixing with MMF1.5. So in MMF1.5 Apppath$ was equivalent to Appdrive$+Appdir$+Appname$ and starting with MMF2 it is only Appdrive$+Appdir$ (see http://community.clickteam.com/threads/75476-Migration-Diff%C3%A9rences-MMF-1-5-et-MMF-2 for details).

    Using AppDataDirectory$() expression will return the right path according to the current configuration. It's the interesting thing of expression that they will not always return the same string but compute the right one when called. AppDataDirectory$() will works well on Windows XP and above.

  7. #7
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleSWF Export Module

    Join Date
    Oct 2011
    Posts
    81
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks a lot for the clarifications, ouly. I ended up learning a bunch.

Similar Threads

  1. Loading an object from array when needed (loading an array in chunks)
    By fishrod in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 20th March 2014, 06:01 PM
  2. [RC5] Saving and/or loading array files
    By colej_uk in forum Android Export Module Version 2.0
    Replies: 9
    Last Post: 11th March 2013, 12:49 AM
  3. Problem with saving/loading an NVO array file from the Named Variable object?
    By RGBreality in forum Multimedia Fusion 2 - Technical Support
    Replies: 8
    Last Post: 12th January 2012, 01:17 PM
  4. Problem with array loading/saving with INI++
    By timcclayton in forum Multimedia Fusion 2 - Technical Support
    Replies: 7
    Last Post: 21st November 2010, 06:21 PM
  5. array object : saving loading
    By jpcr in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 15th February 2008, 02:31 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
  •