Page 1 of 1

How to use the res-folder effectively

PostPosted: 16 Nov 2009, 17:59
by silly freak
i thought i'd point out what the new system of properties files really gives you as the user. i guess many of you have a situation similar to this: every time a new version comes out, you unzip the archive to a new folder, and move your pics folder to the new version, maybe also the decks.

while this is perfectly possible, it somehow misses the point that the properties-system gives you full control over your files' locations (other that forge.properties, which has to stay together with run-forge.jar) by just changing some lines in the files

before i go on, note that it's always a good idea to backup your files before doing any changes

for me, my installation looks like this:
Code: Select all
/forge
/forge/versions
/forge/versions/20091112
/forge/versions/20091101
/forge/versions/20091017
   (and so on)
but instead of copying/moving my pictures directory into the new version, i created the pics directory in forge/res (not an individual version). the same goes for the new decks directory:
Code: Select all
/forge
/forge/versions
/forge/versions/20091112
/forge/versions/20091101
/forge/versions/20091017
   (and so on)
/forge/res/pics
/forge/res/decks
by doing this, all versions of forge can use the same pictures and decks, and if a new version is not stable enough (i heard it happens^^), you don't have to revert anything

now the real magic going on is in the res/main.properties file of every single version. you have to change two lines:
Code: Select all
decks-dir--file=../../../res/decks
image/base--file=../../../res/pics
".." three times steps from /forge/versions/YYYYMMDD/res up to /forge before going back down to /forge/res/decks

you are, of course, not limited to that. say you have multiple users playing forge, and everyone wants his own separate deck directory, you can just put
Code: Select all
decks-dir--file=~/decks
image/base--file=../../../res/pics
instead. the pictures are then shared, and forge looks in every user's home directory (for example "C:\Users\Sample User") for the decks directory



as a note in the end, i don't just point forge.properties to a shared main.properties for a specific reason: the res directory is not fully compatible between versions. besides there being a "program/version" property, the rarities-files, as mentioned with every release are NOT backwards-compatible

hope i helped, and have fun!

Re: How to use the res-folder effectively

PostPosted: 16 Nov 2009, 18:16
by DennisBergkamp
Yeahhh, I personally really like the addition of the properties files, thanks again for spending time adding them silly freak :)

What would be very cool also is to have a separate folder for token pictures (for instance /res/pics/tokens ?).
Now, I don't remember exactly, but this might require some extra coding when trying to fetch the image for the token to display.

Re: How to use the res-folder effectively

PostPosted: 16 Nov 2009, 18:26
by silly freak
the properties files are no problem, basically a line in main.properties and NewConstants.java, but i'm not so into the rest of the code and don't know what it would take

Re: How to use the res-folder effectively

PostPosted: 26 Nov 2009, 08:16
by weirdingway
Awesome! Moving files would have been more and more cumbersome as this wonderful project got larger and larger. Now I can keep them all organized in one spot! Way to go with the quality of life improvement here!