The Daily Click ::. Forums ::. Klik Coding Help ::. Apppath$ versus "./filename.PNG"
 

Post Reply  Post Oekaki 
 

Posted By Message

Jake G



Registered
  06/03/2010
Points
  782

Wii OwnerVIP Member
15th February, 2014 at 15/02/2014 14:22:46 -

Say I want to access a file from my game that is in a sub-folder from the EXE's root folder.

You could for example retrive Apppath$ + "pics/filename.PNG" or you could simply retrieve "./pics/filename.PNG". Is there a particular reason there are two ways to do the exact same thing? Should I be using one over the other?

Much thanks.

 
Visit www.voltic.com.au - you probably won't regret it!

~Gradually getting less bad at making games~

Riptide



Registered
  26/07/2013 21:07:20
Points
  101
15th February, 2014 at 15/02/2014 15:53:12 -

Hey jake, to be honest I didn't even know that way existed, thanks for sharing.
To get back to your question, i think it is pretty much the same thing, maybe someone knows the difference (if there is any)
Have a great day !

 
Working on some engines, working for the fun !

Emomiilol



Registered
  07/11/2007
Points
  194
16th February, 2014 at 16/02/2014 18:06:43 -

I dont know if I remeber this correctly but I think that you could't use "pics/filename.PNG" in earlier versions of TGF/MMF (MMF automaticly replaced "pics/filename.PNG" with ex. C:\MMF\pics\filename.PNG") . But i am not sure..

I have always used this command: Appdrive$ + Appdir$ + "\pics\filename.PNG".

Wow, such help. ^^

Edited by Emomiilol

 
n/a

UrbanMonk

BRING BACK MITCH

Registered
  07/07/2008
Points
  49667

Has Donated, Thank You!Little Pirate!ARGH SignKliktober Special Award TagPicture Me This Round 33 Winner!The Outlaw!VIP MemberHasslevania 2!I am an April FoolKitty
Picture Me This Round 32 Winner!Picture Me This Round 42 Winner!Picture Me This Round 44 Winner!Picture Me This Round 53 Winner!
16th February, 2014 at 16/02/2014 19:52:54 -

You should use Apppath$, and I'll tell you why.

If you use "./blah" or any variation it'll work as long as the execution directory is the same as the application's. Most of the time that's true, but if your application is launched from another application instead of by the user then the execution directory will be the program that launches it and not your application's directory.

I ran into this issue when I made a launcher for my game that wasn't in the same directory. Took me a while to figure out what was going on!

 
n/a

Riptide



Registered
  26/07/2013 21:07:20
Points
  101
16th February, 2014 at 16/02/2014 21:23:56 -

Thanks for the useful info urbanmonk

 
Working on some engines, working for the fun !

Jake G



Registered
  06/03/2010
Points
  782

Wii OwnerVIP Member
17th February, 2014 at 17/02/2014 11:38:52 -

Very useful, indeed! I will have to go find all instances where I do "./filename.png" over Apppath$ and change it over.

 
Visit www.voltic.com.au - you probably won't regret it!

~Gradually getting less bad at making games~
   

Post Reply



 



Advertisement

Worth A Click