Author Topic: User Data Paths  (Read 6462 times)

Offline pmprog

  • Commander
  • *****
  • Posts: 647
  • Contributor
    • View Profile
    • Polymath Programming
User Data Paths
« on: May 31, 2014, 05:22:23 pm »
I have the /user/ folder under my openxcom game folder, which I prefer to it saving in my profile area.

However, one thing I wanted to do, is sync my save games via my ownCloud server; but the problem is, the saves are in the same location as the options. So if I were to sync my saves, I'd also transfer my options across - and whilst some settings (such as pathing etc.) is good, the resolution on my devices differ.

Would it be possible to have an option to let me change my saves directory to /openxcom/saves/ or /openxcom/user/saves/?

Offline SupSuper

  • Lazy Developer
  • Administrator
  • Commander
  • *****
  • Posts: 2162
    • View Profile
Re: User Data Paths
« Reply #1 on: May 31, 2014, 08:00:04 pm »
Would "./openxcom -user /saves/" work?

Offline pmprog

  • Commander
  • *****
  • Posts: 647
  • Contributor
    • View Profile
    • Polymath Programming
Re: User Data Paths
« Reply #2 on: June 01, 2014, 12:56:58 am »
Not really, because the options.cfg file gets saved in that folder too; and that's what I'm trying to avoid

Offline Falko

  • Commander
  • *****
  • Posts: 802
    • View Profile
Re: User Data Paths
« Reply #3 on: June 01, 2014, 01:10:42 am »
how about options.cfg:
Code: [Select]
options:
  baseYResolution: 200
...
  savefolder=.
default ="." =normal save folder but you can use a relative path?

Offline yrizoud

  • Commander
  • *****
  • Posts: 1014
    • View Profile
Re: User Data Paths
« Reply #4 on: June 01, 2014, 02:23:58 am »
It's not a very pretty workaround, but :
- prepare the options1.cfg and options2.cfg that you need, put them in same shared directory as the rest
- on device 1, make the game shortcut execute "mv options1.cfg options.cfg && ./openxcom"
- on device 2, make the game shortcut execute "mv options2.cfg options.cfg && ./openxcom"

(this is for a unix/linux with a bash-like environment)

Offline SupSuper

  • Lazy Developer
  • Administrator
  • Commander
  • *****
  • Posts: 2162
    • View Profile
Re: User Data Paths
« Reply #5 on: June 01, 2014, 03:23:31 am »
Not really, because the options.cfg file gets saved in that folder too; and that's what I'm trying to avoid
Well the game already uses different option and user folders internally for unix systems, would an extra command to customize the options.cfg folder be enough?

Offline pmprog

  • Commander
  • *****
  • Posts: 647
  • Contributor
    • View Profile
    • Polymath Programming
Re: User Data Paths
« Reply #6 on: June 01, 2014, 11:24:42 am »
Well the game already uses different option and user folders internally for unix systems, would an extra command to customize the options.cfg folder be enough?
What about Windows?

My main desktop is Windows, and one of my other computers has Debian, and my Pandora has Angstrom.

If I can still build the OXC code (my dev env is in a bit of a mess), I might sort a patch for you that has a button in the options that just says "Saves in Subfolder", and all save games are saved into (user)/saves/.

Don't worry about it though. Just thinking it'd be nice to sync them, esp' with my Pandora so I can take my game on the go, and resume on my desktop easily enough

Offline SupSuper

  • Lazy Developer
  • Administrator
  • Commander
  • *****
  • Posts: 2162
    • View Profile
Re: User Data Paths
« Reply #7 on: June 12, 2014, 04:21:39 am »
Well I mean internally OpenXcom has a Data Folder, a User Folder and a Config Folder, it's just on 99% of the platforms the User Folder is the same as the Config folder.

Anyways I've added an extra "-cfg <path>" command line parameter, so you can specify your own path just for the options file, while screenshots and saves are still kept on a separate User folder which can be kept on the cloud.

Offline pmprog

  • Commander
  • *****
  • Posts: 647
  • Contributor
    • View Profile
    • Polymath Programming
Re: User Data Paths
« Reply #8 on: June 14, 2014, 11:45:05 am »
Excellent, thanks!