|
Posted By
|
Message
|
 Wiiman (Evan) Rating
Registered 6/29/2008
Points 613
 
|
11th August, 2011 at 7:22:07 AM -
I'm pretty sure this is a very commonly asked questioned around here It's gotta be at least once every 2 months right?
But I'm having trouble getting external files to work by the expression(again!)
I'm trying to get an external .png file to work. I've got the external file Personal File.png and the .MFA in a zipped folder. So the code goes=
start of frame>Active Picture>New Picture>Appdrive$+Appdir$+"Personal Icon.png"
Yet it no work...
Any suggestions?
n/a
|
 Neuro Ludologist
Registered 10/29/2006
Points 437
  
|
11th August, 2011 at 7:35:45 AM -
I use Apppath$ on its own and it has never failed me, so Apppath$+"Personal Icon.png" should work.
n/a
|
 nim
Registered 5/17/2002
Points 7046
|
11th August, 2011 at 1:17:06 PM -
Originally Posted by Wiiman I've got the external file Personal File.png and the .MFA in a zipped folder.
I could be wrong but I think a zipped file is temporarily extracted to a Windows temp folder rather than the folder it's sitting in. That would explain why the Appdrive$ etc string isn't working for you. Have you tried setting a string to AppDrive$+Appdir$ to see what it throws up?
//
|
 Duncan Thelonious Dunc
Registered 5/18/2002
Points 577
|
11th August, 2011 at 1:59:13 PM -
I've got the external file Personal File.png
Appdrive$+Appdir$+"Personal Icon.png"
Just sayin', lol
n/a
|
 nim
Registered 5/17/2002
Points 7046
|
11th August, 2011 at 5:03:14 PM -
haha, or that, yeah
//
|
 Chris Burrows
Registered 9/14/2002
Points 2396
|
11th August, 2011 at 5:13:45 PM -
haha! nah Duncan is pointing out that it's obviously not gonna work if your file is called "Personal File.png" but you try and open "Personal Icon.png".
Or.. did you know that?
Or... is that not what Duncan is trying to point out?
Or...... is that obviously going to work?
HahhahAHahaaaaaaaa
n/a
|
 Wiiman (Evan) Rating
Registered 6/29/2008
Points 613
 
|
11th August, 2011 at 9:35:22 PM -
Actually I had in right in the code I just typed it wrong on here
I tried Neuro's way and it works perfectly!
But how do make the code go through folders and such to find the file?
n/a
|
 Jon Lambert Administrator
Vaporware Master
Registered 12/19/2004
Points 8224
     
|
11th August, 2011 at 10:31:12 PM -
Apppath$ is a shortcut to the same folder as the application. Appdrive$ is just the drive letter (e.g. C:/).
Sandwich Time!Whoo!
JoyCheck & KeyCheck Widgets
For easy implementation of customizable joystick and keyboard controls.
http://www.create-games.com/download.asp?id=8364
|
 Jenswa Possibly Insane
Registered 8/26/2002
Points 2217
|
13th August, 2011 at 6:05:05 PM -
T0 debug these types of bugs in the future, you can try try displaying the text in your game.
That way you can check if the path your using (with Appdrive&Appdir) is generating the right path for you.
Happy coding
Check out DTV Boxes http://ow.ly/k13fh (work in progress)
Download hh_beer.zip from http://ge.tt/4d07kPc/v/0 and hhxl.zip from http://ge.tt/3kbXlPc/v/0
|
 GrimFusion Ancient Kliker
Registered 7/1/2002
Points 631

|
13th August, 2011 at 9:55:59 PM -
Just so everybody knows, Appdrive$ + Appdir$ does the EXACT SAME THING as Apppath$.
Appdrive$ would return the drive the application is running from.
Appdir$ returns the application directory minus the drive letter.
So, assuming the app is running from C:\Temp\Folder1\Folder2, Appdrive$ + Appdir$ returns a sting like this:
"C:\" + "Temp\Folder1\Folder2"
Apppath$ returns the full path including the drive letter.
Again, assuming the app is running from C:\Temp\Folder1\Folder2, Apppath$ would return a string like this:
"C:\Temp\Folder1\Folder2"
The Appdrive$ method is useful if you're trying to run separate software, scripts, or files that already existed before an installation, or if your game installs files to a completely different directory than the one your app is running from. That's about the only time you'll need to use the Appdrive$ expression without Appdir$.
Here's a link to all of the built in functions of MMF and MMF2.
http://mfgg.taloncrossing.com/wiki/index.php/Click_Expression_Reference
I know, I know... it's hosted on a fangame website. Not my fault. I just googled it.
ChrisD> Employer: Say, wanna see a magic trick?
ChrisD> Employee: Uhh… sure, boss.
ChrisD> Employer: Your job! It just disappeared! Pack your things and leave! Pretty good trick, huh?
|
|
|
|