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 should I modified the path for files?

Author
Message
halley
13
Years of Service
User Offline
Joined: 27th Apr 2011
Location: China
Posted: 29th Sep 2012 05:41
I use agk:penToRead(). or OpenToWrite(). it's not the same path as the project, how should I change it?
I sent my game to a client, but he couldn't play the game. the game can't load level files.

The Miracrea Games
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 29th Sep 2012 18:47
Assuming Tier 1, you would have a directory named media. And you would make any sub directories under that.

I'm now working in Tier 2, having converted my Tier 1 project. And I kept the media directory for simplicity. And it does.

For accessing (read or write) files, I add '/media/' ahead of any file name. This works very well on all the platforms I've tested it on (Windows, iOS 5.1/6.0 and Android 3.2/4.0).

And the AppGameKit engine will create the directories and files specified, when you write stuff, in the app's work area (most platforms sand box apps).

If you avoid using the SetFolder and SetDirectory commands and just explicitly add the path to file references, you should be okay.

Cheers,
Ancient Lady
AGK Community Tester
MarcoBruti
13
Years of Service
User Offline
Joined: 20th Nov 2011
Location: Caput Mundi
Posted: 29th Sep 2012 20:01
I confirm what Ancient Lady wrote. I never use setFolder, setDirectory, they are really buggy commands, so I use explicit path: in 1.064 I used "levels\level1.xml", in 1.07x it should be "media\levels\level1.xml", although I confess that, in order to avoid problems, I throw everything into the media folder, ugly practice but it works for sure.
Since I have got no willing to shift to Tier-2 for a number of reasons disseminated into one hundred of posts , I assume that the next release 1.08 shall fix the issues, trying to be, at least once in my life, optimistic.

Login to post a reply

Server time is: 2024-11-23 23:15:43
Your offset time is: 2024-11-23 23:15:43