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

Author
Message
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 21st Jan 2014 15:30
I've hit a stumbling block and looking for a creative workaround. I'm working on a Windows App in Tier 1.

I want the user to be able to save images, but having to retrieve them from MyDocuments/AGK/Program/Media isn't a great solution.

SetRawWritePath() would need to know where to write to and I don't think there is a way to interrogate the file disk structure. I can't make assumptions, my main drive for example is J:\.

Any bright ideas for saving images in a more user-friendly way?

Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 21st Jan 2014 16:39 Edited at: 21st Jan 2014 16:40
maybe with the cloud google drive or windows live sky drive
and web api.
so your app running at pc/android still in a sand box.
or alternate php script and mail the files or just
show them as download.
need OpenBrowser ( url )

AGK 108 (B)19 : Windows 8.1 Pro 64 Bit : AMD Radeon HD 6670
JLMoondog
Moderator
15
Years of Service
User Offline
Joined: 18th Jan 2009
Location: Paradox
Posted: 22nd Jan 2014 03:06
Honestly this might not be too much of a hassle for user's. Allot of recent "AAA" games I've played, mostly MMO's, when taking a screenshot put them in the MyDocuments/Game/Screenshot folder. With no way of redirecting them. This seems to be the new norm.

If you're building an image manipulation program, than my argument is probably invalid.

Naphier
13
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 30th Jan 2014 03:41 Edited at: 30th Jan 2014 03:41
Thought I replied to this awhile ago... sorry for not doing so.
Here's some code to do it:


This makes me realize that I didn't have to use the AppGameKit folder for my dFenz game

BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 30th Jan 2014 11:43
Thanks for the suggestions

@Markus: I considered something like this, but I don't want the app to rely on an internet connection, and the service at the other side being available 24/7

@JLMoondog: Yes, the user will be collecting the images every time they use it.

@Naphier: Thanks, that's a nice solution for getting to the user folder. I was fixed on there being a @MYDOCS@ type parameter somewhere. I might need to tweak it slightly if I want it to be compatible with Win XP (Which I don't recall using the C:\Users\... configuration)

Naphier
13
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 30th Jan 2014 23:50
http://www.westga.edu/its/index_5327.php

The directory structure is a bit different in XP and 95.
I'd suggest that if you can't find the users/username then just create it at the root level.
Also I think that querying with the GetRawWritePath would return something like C:\Documents and Settings\UserName\My Documents
I can't confirm though because no XP for me.
I wonder if the @MYDOCS@ parameter would work, it might. But with my solution at least you can find the main drive letter and take it from there. On Win 7 and up you might not have permission to write to the root. Not sure about XP. Personally, I hate Window's user directory structure and I miss using root a lot (I actually use root over the My Documents crap).

BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 4th Mar 2014 22:30
A quick update to this thread.

I realised that with a really easy mod, Naphier's solution works for all versions of Windows.

The end of every AppGameKit folder ends with:

"/AGK/APPNAME/"

So you can simply remove 2 of the string tokens and you get the My Documents folder. Here's my routine for returning the My Documents path, not optimised yet. location$ is the folder you want to use or create within My Docs.



Login to post a reply

Server time is: 2024-05-02 16:34:24
Your offset time is: 2024-05-02 16:34:24