The Daily Click ::. Forums ::. Klik Coding Help ::. External File Help
 

Post Reply  Post Oekaki 
 

Posted By Message

Otter

Rating

Registered
  29/06/2008
Points
  514

Wii OwnerIt's-a me, Mario!Mushroom
11th August, 2011 at 07:22:07 -

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
  29/10/2006
Points
  437

Game of the Week WinnerVIP MemberI'm on a BoatPokemon Ball!
11th August, 2011 at 07:35:45 -

I use Apppath$ on its own and it has never failed me, so Apppath$+"Personal Icon.png" should work.

 
n/a

nim



Registered
  17/05/2002
Points
  7233
11th August, 2011 at 13:17:06 -


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
  18/05/2002
Points
  552

VIP Member
11th August, 2011 at 13:59:13 -


I've got the external file Personal File.png




Appdrive$+Appdir$+"Personal Icon.png"



Just sayin', lol

 
n/a

nim



Registered
  17/05/2002
Points
  7233
11th August, 2011 at 17:03:14 -

haha, or that, yeah

 
//

Chris Burrows



Registered
  14/09/2002
Points
  2396

GOTW WINNER OCT. 2011
11th August, 2011 at 17:13:45 -

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

Otter

Rating

Registered
  29/06/2008
Points
  514

Wii OwnerIt's-a me, Mario!Mushroom
11th August, 2011 at 21:35:22 -

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
  19/12/2004
Points
  8235

VIP MemberWii OwnerTDC Chat Super UserI am an April FoolSSBB 3265-4741-0937ACCF 3051-1173-8012360 Owner
11th August, 2011 at 22:31:12 -

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
  26/08/2002
Points
  2722
13th August, 2011 at 18:05:05 -

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

 
Image jenswa.neocities.org

The_Antisony

At least I'm not Circy

Registered
  01/07/2002
Points
  1341

VIP MemberStarSnow
13th August, 2011 at 21:55:59 -

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?
   

Post Reply



 



Advertisement

Worth A Click