Can anyone explain in detail the best way to include external files in your application? I'm having weird, inconsistent results when I try to run my game on different computers. Recently I reinstalled Windows on a fresh hard drive, and parts of the game break depending on where I put the whole working directory.
Here's the basic setup: I have my main application, DataJack.mfa. In the same MMF project, I have a separate .mfa application that is included in the main game as a sub-application; therefore it builds to a .ccn which I have to point to in the subapplication object properties while in the frame editor.
Living in the same directory of the main .mfa files are several other directories which contain many .ini files that the game references in order to create missions or look up weapon stats, etc. To point to these, I reference them by path in the events editor. I.E., tell the ini object to load Appdrive$+Appdir$+"missions/m1.ini" and go from there.
If I take my entire working directory and move it to, say, C:/, the inventory subapplication stops working.
Part of the inventory subapplication uses the path variables to point to various .png files and load them into a Picture Object. When I move the game to a different computer, this completely ceases to work. No pictures are loaded.
I've had the program spit out the path where it thinks the .png file is, and it looks correct in every way. Yet, for some reason, the picture object will not load the .png.
I ran into a handful of other problems that seem to come and go at random. Loading .mp3s or .oggs sometimes seems to not work, again based on the path variables method. Not sure if this was an issue with the directshow object.
So I have a few questions:
1. Appdrive$ , Appdir$ , Apppath$ , AppTempPath$ : what exactly do these all refer to? Right now, I try to construct my path via Appdrive$+Appdir$ to get to the game's root directory, and then go from there. Is this right? Is there a simpler way? What is AppTempPath? Does this all refer to where the .mfa file lives, where the built .exe lives, or where MMF2 itself lives? What do these variables refer to when I use them in a subapplication?
2. Because I actually use the subapplication object properties to point to inventory.ccn in MMF2 (instead of passing it a path variable at runtime,) it is included in the data elements "external files" list. I understand that this means it will be built into the installer? How does this differ from pointing to objects at runtime with path variables? Is one preferred over the other?
Basically, I must be doing something fundamentally wrong and I don't have a consistent, working system in place. I'd like to understand the intricacies of relative pathing and external files in MMF2.