It is currently 18 Apr 2024, 03:33
   
Text Size

How to use the res-folder effectively

Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins

How to use the res-folder effectively

Postby silly freak » 16 Nov 2009, 17:59

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!
___

where's the "trust me, that will work!" switch for the compiler?
Laterna Magica - blog, forum, project, 2010/09/06 release!
silly freak
DEVELOPER
 
Posts: 598
Joined: 26 Mar 2009, 07:18
Location: Vienna, Austria
Has thanked: 93 times
Been thanked: 25 times

Re: How to use the res-folder effectively

Postby DennisBergkamp » 16 Nov 2009, 18:16

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.
User avatar
DennisBergkamp
AI Programmer
 
Posts: 2602
Joined: 09 Sep 2008, 15:46
Has thanked: 0 time
Been thanked: 0 time

Re: How to use the res-folder effectively

Postby silly freak » 16 Nov 2009, 18:26

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
___

where's the "trust me, that will work!" switch for the compiler?
Laterna Magica - blog, forum, project, 2010/09/06 release!
silly freak
DEVELOPER
 
Posts: 598
Joined: 26 Mar 2009, 07:18
Location: Vienna, Austria
Has thanked: 93 times
Been thanked: 25 times

Re: How to use the res-folder effectively

Postby weirdingway » 26 Nov 2009, 08:16

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!
weirdingway
 
Posts: 57
Joined: 19 Nov 2009, 12:39
Has thanked: 0 time
Been thanked: 4 times


Return to Forge

Who is online

Users browsing this forum: No registered users and 110 guests


Who is online

In total there are 110 users online :: 0 registered, 0 hidden and 110 guests (based on users active over the past 10 minutes)
Most users ever online was 4143 on 23 Jan 2024, 08:21

Users browsing this forum: No registered users and 110 guests

Login Form