If I make a map editor with MMF2 and I want people to be able to open up the maps they make with it by double clicking on the file, when the program launches, how do I tell it what file to use?
Printable View
If I make a map editor with MMF2 and I want people to be able to open up the maps they make with it by double clicking on the file, when the program launches, how do I tell it what file to use?
You can use the YASO object to associate files to your application.
Try doing this within your app (replace .map with your map file extension):
+ Start of frame
- Associate ".map"
- To """"+Appdrive$+Appdir$+Appname$+""""+" ""%1"""
- for type "open
- with icon "!"
You'll need to then go to your application properties and untick the "Compress the runtime" box.
Now, if you put a string in your frame and do:
+ Start of level
- Change alterable string to CommandLine$
The string will set to the commandline at the start of the level, and you should receive your application name along with the name of the file that was opened.
If you have any problems, then I'll make an example file for you.
I know this post is a month old, but really helpful with the YASO object to associate files. My question is, how to I extract the resulting file path that is double clicked without getting the actual application path?
thanks.
okay, i figured out a way using the "extract right sub string" expression. I'm guessing that's the best way. Had to use a String object first for some reason. could be me!
Yea and whats with all the " things.
The quotation marks? Two "s in a row within a string are converted to a " in the string - normally they would be parsed as delimiters.
Why does the directory have to have quotes around it?
DavidN,
where do some of you guys learn all this stuff! I'm a manual type guy, love to read manuals, and I've read the MMF manual and didn't see anything about the double-quote thing... is there a website somewhere that explains all these extra code things?
thanks for the explanation of the quotes... I just copied and pasted, but love to know why it works the way it works.
I picked most of it up by reading this very forum. :)
Where do you get the "extract right sub string" expression?? :confused:Quote:
Originally Posted by aidmm