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 / doubts files

Author
Message
pamerco
11
Years of Service
User Offline
Joined: 2nd Jul 2012
Location:
Posted: 9th Jul 2012 22:40
hello
I'm programming a game with the full version of AGK.
so far, I've been spending the versions to a friend who has been trying to go smoothly, but today I built functions load and save files and now does not work.
I did not know where he had created the file (I had put the path "media / data.txt") and was not there.
doing a search on drive c: I've found, but not within the project ....
if you want to pass someone, I have to say that copy that folder in my documents?
or?
no way to save files in the same folder of the project to unify everything.

thanks
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 10th Jul 2012 04:10
The files created by an AppGameKit app will appear in your <windowsusers>/My Documents/AGK/<yourapp>/media directory.

Cheers,
Ancient Lady
AGK Community Tester
pamerco
11
Years of Service
User Offline
Joined: 2nd Jul 2012
Location:
Posted: 10th Jul 2012 08:20
yeah, I've seen.
but still I have questions

if you want to share my game, I have to tell you to copy that file there, or do an installation of the game, or I can copy that file to the folder "media" project, because I've tried and do not load and is out if I do wrong or that.
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 10th Jul 2012 15:43
If you want a file to be part of the game, it needs to initially exist in the <project>/media directory.

However, if you write the file from within the game, it will always end up in the My Directories/AGK/<game>/media directory.

If you only read the file then it can be in the <project>/media directory and you can share that.

How do you plan to share the game? That might make a difference as to how you set it up.

Cheers,
Ancient Lady
AGK Community Tester
pamerco
11
Years of Service
User Offline
Joined: 2nd Jul 2012
Location:
Posted: 10th Jul 2012 16:06
well

My file contains:

maxima points of gameplay

volume of the music

sound volume

and level attained .... so should be kept from play, and that this varies in each game or not.

first of all say on the subject of the files I am a newbie perfect ...

PC works perfect, ie when you leave saves changes options volume of sounds and music and play the next time data is loaded and everything is fine ...

the problem is you need that file to start the game the first time you run it the first time you run the game should check if the file exists and if there is one with values ​​created by default.

at the following times and the file already exists, to check charge only what .....

is something like it?
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 10th Jul 2012 19:46
What I do for options is check to see if the option file exists already.

If it does exist, load it up.

If it does not, create one with default values and leave it up to the player to change them. You can safely assume that players will usually use the 'options' menu/button to set the game the way they want.

Cheers,
Ancient Lady
AGK Community Tester
anwserman
12
Years of Service
User Offline
Joined: 20th May 2011
Location: Wisconsin
Posted: 10th Jul 2012 19:53 Edited at: 10th Jul 2012 19:56
Quote: "What I do for options is check to see if the option file exists already.

If it does exist, load it up.

If it does not, create one with default values and leave it up to the player to change them. You can safely assume that players will usually use the 'options' menu/button to set the game the way they want."


This is exactly what I do as well - with a slight twist. Within my init code, I search to see whether or not my "userpref.txt" file exists. If it does, I load the values. If it doesn't, I set all variables to their default values.

I don't save the "userpref.txt" file unless the user goes into the options screen and exits out. If the user doesn't change any default value - no need to save them then, because they're the same whenever the application starts up

EDIT The same thing here applies to high-score tables and the such. Don't ever assume that there will be a file there to load from (users might delete it, etc.) so ALWAYS create it from scratch programatically, and save it whenever you update or change any values.

This way, whenever someone starts the app, the default mode it goes into is "fresh install, clean state". Whenever they make a change to options, or complete a level, save it immediately after updating the values.

Hi there. My name is Dug. I have just met you, and I love you.
pamerco
11
Years of Service
User Offline
Joined: 2nd Jul 2012
Location:
Posted: 10th Jul 2012 23:07
thank you very much both.
I have it working.

when starting the application checks if the file exists, if there is "assumed"
which is the first time, and save the file with default values​​, if the file exists load the data ...

glad to participate in a forum like this, where people working with novices.
deadlyduck
21
Years of Service
User Offline
Joined: 19th Sep 2002
Location: United Kingdom
Posted: 24th Jul 2012 04:21
SetRawWritePath( str )

Sets the folder where files created by AppGameKit will be stored.

you can set this to where your .exe is located, haven't found a command to get this location easily from within AppGameKit yet, they need a GetAppPath() command
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 24th Jul 2012 04:30
Quote: "you can set this to where your .exe is located, haven't found a command to get this location easily from within AppGameKit yet, they need a GetAppPath() command "

But it dosent work on an mobile device.

Android 2.3 Gingerbread , ZTE Skate , 480x800 , 4.3 inches , 800 mhz cpu , 512 mb ram
Android 4.0 Sandwich , Dmtech 3g 9738B , 1024x768 , 9.7 inches , cortex A8 1.2 cpu , 1 gb ram.

Login to post a reply

Server time is: 2024-05-05 21:07:15
Your offset time is: 2024-05-05 21:07:15