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 / I don't understand how getWritePath() works

Author
Message
Brian Lancaster
10
Years of Service
User Offline
Joined: 20th Dec 2013
Location: Oakland, CA
Posted: 16th Jan 2021 03:57
I am trying to finish my loadGame function, but getWritePath is returning the wrong directory.

Here is the real folder that is written to:
C:\Users\kako_\AppData\Local\AGKApps\Warlordocracy\media

Unfortunately, the getWritePath commnd is returning this:
C:/Users/kako_/AppData/Local/AGKApps/windows/Warlordocracy

I'm using Windows 10. I can't find anything about it on the forums, and I really need this to work cross-platform. Thanks for any help you can give.
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 16th Jan 2021 04:39
It will return a different value when using debug
Brian Lancaster
10
Years of Service
User Offline
Joined: 20th Dec 2013
Location: Oakland, CA
Posted: 16th Jan 2021 05:44 Edited at: 16th Jan 2021 05:51
Ah, yeah, you're right. Thanks.

EDIT: Still having a problem loading files from the write path (loading from the game folder works fine). The help files say that forward slashes work on every platform. So I'm not sure what I'm doing wrong.

EDIT #2: Also, here is the code I am using:
path$ = getWritePath() + "media/" + filename$ + ".gam"

Attachments

Login to view attachments
Brian Lancaster
10
Years of Service
User Offline
Joined: 20th Dec 2013
Location: Oakland, CA
Posted: 16th Jan 2021 17:30
I still haven't been able to make the default write path work, but I discovered something even better: the setRawWritePath command, so I can save files in the game folder like God intended. So it's working fine now, at least on Windows. It will be a problem when I try getting it to work on iOS, though.
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 16th Jan 2021 19:55
You need to prefix those filenames with "raw:"
Brian Lancaster
10
Years of Service
User Offline
Joined: 20th Dec 2013
Location: Oakland, CA
Posted: 17th Jan 2021 04:21
Got it, thanks.

Login to post a reply

Server time is: 2024-11-21 17:11:48
Your offset time is: 2024-11-21 17:11:48