file load works in test, doesn't work when built (in the same folder) - ??

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.
  • All right... so I'm having incredibly bizarre, nonsensical changes in program behavior between testing in-editor and compiling the .exe.

    My game, when run, sets the ini file, then immediately checks if "filevalid" is equal to 1. If the ini doesn't exist (which is the only way this variable can equal 0), the game bypasses loading from the .ini and sets initial values manually.

    START OF FRAME -> set ini file to "filename.ini", set filevalidator global var to "filevalid" (from ini)
    If filevalidator = 1 + RUN ONCE -> load all game data from ini into global variables.
    If filevalidator = 0 + RUN ONCE -> bypass data load, manually set all variables to initial values.

    This works every time. I don't set "filevalid" until the user closes the app, which triggers (on "close window has been selected", or ctrl+Q) KILL FRAME, which loops through and saves all settings/high scores. filevalid is set to 1 here - this also works every time.

    When I'm in the editor, the next time I load the game it properly finds the filevalid set to 1, loads the data in from the file, and all is well!

    When I compile and run however, it correctly sets filevalid to 1, but every other value in the .ini has been set to 0. I have no clue what's doing this - when I open the .ini file after the game closes the first time all the values are properly set. Somehow my load operation is setting everything to 0, which then saves everything to 0 as soon as I close the app again.

    I cannot figure this out for the life of me. I'm even putting the compiled .exe in the same folder that the in-editor version is using to access the .ini, but no dice.

    Anyone have any clue what could be going wrong? I can't use the debugger, as it functions fine in editor, and I know for a fact the folder isn't access-restricted - ran in several different locations just to be sure....this is infuriating :(

    -swerdmurd

    Please login to see this link. - still pretty barren, but it's mine :)

  • I know it's frustrating, but I would re-check the folder where your .exe and maybe .mfa projects are saved and make sure they're the same. I had a similar problem before where whenever I ran an .exe from a folder on my desktop it'd work but running it from the MMF2 project it wouldn't load the same external files even though it should have as far as I thought because I compiled the .exe to that very same folder on my desktop.

    Weebish Mines, my retro Metroidvania!
    Please login to see this link.

  • I'm having the inverse problem (works in mmf2 project, .exe 0's out) - but it could very well be symptomatic of the same thing.

    How'd you solve the problem?

    I'm gonna replace Apppath$+"bz1data.ini" with a static file path... I still can't see why that would help, since it's able to save the data to the correct path in .exe, and load path is the exact same....

    How the hell do people have the patience to debug!? :)

    -swerdmurd

    Please login to see this link. - still pretty barren, but it's mine :)

  • Wooooow.

    Finally found it. I'm a complete and total moron. Isn't coding great for the self esteem!?

    So idk if this'll help anyone else... But the problem was that I had a global event (that had been sitting in the game for over a month - totally forgot about it) that was setting the filepath to AppTempPath$ on start of app. This wasn't an issue in the mmf2 project, as apparently AppTempPath$ and AppPath$ reference the same folder in-editor. However, once executed, these folder-finder-strings point to differenet places, hence only seeing evidence of this issue when i compiled and ran the program.

    So:

    Lesson 1) Don't forget to check your global events... even if you don't think you've used any. You might have forgotten that one, kinda drunken night, where you haphazardly tried to change the logic of your data loading and failed.

    Lesson 2) AppTempPath$ and AppPath$ are THE SAME while running the mmf2 project in the editor, but different once you've compiled and run the .exe

    Lesson 3) swerdmurd needs to exhaust all his options before crying to the forums.

    Thanks for putting up w/ this all... I swear I'll transition into the helpful guy on the forums once I get better w/ this software!

    -swerdmurd

    Please login to see this link. - still pretty barren, but it's mine :)

Participate now!

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