Array Paths Saving/loading issues

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

Clickteam.
  • 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)

    Please support Esper Excite (a Fusion JRPG) on Steam Greenlight. Please login to see this link.. Thank you.

    Edited 9 times, last by Mikegames (August 8, 2014 at 9:01 AM).

  • 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

    Please login to see this link.

  • 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?

    Please support Esper Excite (a Fusion JRPG) on Steam Greenlight. Please login to see this link.. Thank you.

    Edited 7 times, last by Mikegames (August 8, 2014 at 7:11 PM).

  • 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

    Please login to see this link.

  • 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.

    Please support Esper Excite (a Fusion JRPG) on Steam Greenlight. Please login to see this link.. Thank you.

  • 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 Please login to see this link. 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.

    Please login to see this link.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!