Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / How I get an absolut path in debug mode

Author
Message
MadBit
VIP Member
Gold Codemaster
14
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 10th Dec 2020 15:06 Edited at: 10th Dec 2020 15:28
Hello everybody,

I have the following problem, which I am obviously not able to solve.
The plugin I wrote can load fonts from any directory.
Only 3rd party commands are used there. When used normally, everything works fine.
However, when the project is run in debug mode, the plugin does not find the file.

I know that AppGameKit is started in debug mode from another directory ($(AGK_BASE_FOLDER)\Tier 1\Compiler\interpreters\).
And the input of the font is a relative path.
But the normal AppGameKit commands used to load files (LoadImage, ...) still work.

How do I get to the path where my font file is located in debug mode (relative path: 'media/ttf/font.ttf').

I have tried some commands without success.
GetFolder -> returns only a relative path
GetFirstFile/GetNextFile -> only file without path
GetFirstFolder/GetNextFolder -> relative to SetFolder path
OpenRawFolder/GetRawFolderFolderName -> unusable because OpenRawFolder requires an absolute path.

I even loaded an image and had it give me the file name. Unfortunately, it only saves the filename as I specified it.

Have I overlooked something, can someone help me?
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 11th Dec 2020 01:42 Edited at: 11th Dec 2020 01:51
Maybe GetWritePath()

What you might be able to do is open the font file using OpenFile() seeing as that should find the file,
then copy it to another file and then you know the file will be in the GetWritePath()
MadBit
VIP Member
Gold Codemaster
14
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 11th Dec 2020 06:17
Thanks, I didn't even think of that.
Although I prefer a direct use of the files.
But as a stopgap I could adopt this idea.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
MadBit
VIP Member
Gold Codemaster
14
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 12th Dec 2020 07:00
Ok, thanks again for your solution suggestion.
In the end I went a different way.
I looked at the load function of the 3rd party lib and finally built my own from agk functions.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 12th Dec 2020 09:04
Awesome! Glad you sorted it out

Login to post a reply

Server time is: 2024-03-29 13:03:55
Your offset time is: 2024-03-29 13:03:55