The International Simutrans Forum

Information and Announcements => Information & Announcements => Archived Announcements => Topic started by: prissi on January 17, 2012, 09:26:53 PM

Title: New directories for addons
Post by: prissi on January 17, 2012, 09:26:53 PM
In order to streamline addon packaging and allow addon functionality also with portable installations (no data outisde the simutrans directory are modified), the locations of addons have been changed in r5091.

Now alls addons reside in "addons/pakset-name/..." either in simutrans program directory (portable) or in the user directory. A typical example is  addons/pak128.britain/little-red-vehicle.pak The same is true of local pakset configs, translations and so on.

If you make an addon, it is highly advisable to pak it onto the following path

simutrans/addons/pak/name.pak
simutrans/addons/pak/text/name_de.tab
simutrans/addons/pak/text/name_en.tab

By this you could even supply a translation with your addons, and by simply extration it to either the user directory (default) or the program directory it will be in the right place, including translation.
Title: Re: New directories for addons
Post by: Spike on January 17, 2012, 10:04:38 PM
Quote from: prissi on January 17, 2012, 09:26:53 PM
By this you could even supply a translation with your addons, and by simply extration it to either the user directory (default) or the program directory it will be in the right place, including translation.

Cool, that's something that had been missing quite long :)
Title: Re: New directories for addons
Post by: Zeno on January 17, 2012, 10:25:50 PM
Does the translation file name need to be same than object name? Thus, for a whole set of objects do we need one file per each object? What about merged paks?
Thank you very much for this feature; it's really nice for addon builders to have the possibility of including translations with their paks :)
Title: Re: New directories for addons
Post by: Combuijs on January 17, 2012, 10:30:04 PM
Nice, very nice feature. Well done!
Title: Re: New directories for addons
Post by: prissi on January 17, 2012, 10:36:44 PM
The translation file should not overwrite an existing file. A safe bet is therefore the name of the pak-file + _xx.tab with xx the language.

(That feature existed before, if you bundled you addon with translations in text/sdfdsf_xx.tab like now. The only difference is, that addons should now include "simutrans/addons/..." instead "simutrans/..." in their base directory name.
Title: Re: New directories for addons
Post by: Zeno on January 17, 2012, 10:49:14 PM
It doesn't work for merged pak files with last nightly :(
I may try tomorrow with a single-object pak file.
Title: Re: New directories for addons
Post by: prissi on January 17, 2012, 11:14:42 PM
The newest nightly is usually built at 3am MET. Thus r5091 or higher.
Title: Re: New directories for addons
Post by: An_dz on January 18, 2012, 02:52:24 AM
Very nice addition, I need to remember it when I download the latest nightly. :D
Title: Re: New directories for addons
Post by: Zeno on January 18, 2012, 07:25:14 AM
Quote from: prissi on January 17, 2012, 10:36:44 PM
That feature existed before, if you bundled you addon with translations in text/sdfdsf_xx.tab like now.
Quote from: prissi on January 17, 2012, 11:14:42 PM
The newest nightly is usually built at 3am MET. Thus r5091 or higher.
Sorry, I meant the translations don't work with r5090. I have a set of airplanes called whatever.pak which is copied into documents/simutrans/pakname, and it is loaded properly. I have added a translation file called whatever_en.tab to the path documents/simutrans/pakname/text/ and the game loads the object but doesn't load the translation :(
Title: Re: New directories for addons
Post by: VS on January 18, 2012, 09:26:12 AM
As to translations, all the files will be loaded, regardless of names. Naming with some recognizable prefix will certainly help make things recognizable, though ;)
Title: Re: New directories for addons
Post by: MHD on January 18, 2012, 11:10:48 AM
Hmm, maybe I didn't get the clue...besides the tranlation thing
Either it is a simple "shift it in another subfolder" situation, where I will not have a problem, when making a single addon like a vehicle (people who download have to shift it in the right folder usually on their own).
Or do I have to change something in the dat-file
Is it a pak-topic or a pack-topic (zip, rar etc...)?
Title: Re: New directories for addons
Post by: VS on January 18, 2012, 02:42:55 PM
Definitely pack-topic.
Title: Re: New directories for addons
Post by: Ashley on January 21, 2012, 12:34:20 AM
Will Simutrans load paksets from the ~/.simutrans/ (e.g. user directory) location too? This would be ideal for App bundles on the Mac.
Title: Re: New directories for addons
Post by: prissi on January 21, 2012, 08:25:10 PM
with -single_user, everything can go into the same folder.

If not, paksets must go into the game folder, only addons go into user folder.
Title: Re: New directories for addons
Post by: Ters on January 22, 2012, 11:06:50 AM
Could it become possible to load addons from the simutrans folder while not -single_user? That does not appear to work now.

I have been using pak64 with food and waste. Waste is now included by default, but food has become an addon. Since I build everything myself from svn, I have a routine for merging the build input into the main simutrans directory and it would be much easier if I could send the food addon into the main simutrans directory along with the rest. Mostly because the main simutrans directory is located at c:\simutrans, while the user directory has a long name including a space.

Or I could hack the makefile to include food in the main pak, but that could lead to conflicts later on.
Title: Re: New directories for addons
Post by: prissi on January 22, 2012, 07:49:15 PM
Food is addon, since it is relatively difficult and has not so good vehicle choices.

Building from SVN make participation in network games difficult; but of course you could add DIR += factory_food/ to the upper part and food is part of the man pak.

If you want to have you addons in the main directory, you have to start simutrans with "-single_user" or define it in the simuconf.tab.
Title: Re: New directories for addons
Post by: Ters on January 22, 2012, 09:19:45 PM
Quote from: prissi on January 22, 2012, 07:49:15 PM
Building from SVN make participation in network games difficult; but of course you could add DIR += factory_food/ to the upper part and food is part of the man pak.

I don't care about network play, so that's okay. I don't want others interfering with my work. The main problem with modifying the makefile is that I keep getting merge conflicts every now and then. But then again, I'm already in trouble there, since I have to comment out calls to command line tools I don't have, like svn and zip.

Quote from: prissi on January 22, 2012, 07:49:15 PM
If you want to have you addons in the main directory, you have to start simutrans with "-single_user" or define it in the simuconf.tab.

If I understand correctly, -single_user puts the save games in the main directory. I don't want that. The save games should go to my user directory so they get backed up.
Title: Re: New directories for addons
Post by: Zeno on January 29, 2012, 04:52:31 PM
Got my addons in my user folder and single-user = 0. It hasn't worked since the release of this feature. Maybe user folder is not documents folder? The addons used to be at /user/documents/simutrans/pakset/files.pak; I guess this has not changed... then I don't know why I can get this to work

D'oh... now (it took me more than 10 minutes) I understood the change. Let me add a small advice for the release: before the 10 lines of explanations you might write a message like "wherever you have your addons, create a folder called "addons" and put them inside", or whatever more easy to understand for nut-heads like me. So what was "whatever/simutrans/paksetname/blah.pak" should be now "whatever/simutrans/addons/paksetname/blah.pak", no matter if it's in the game folder or the user folder. That explanation might help for the next stable release.

PS: Anyway, as I said before the texts aren't being loaded into my games. I'm tired of moving things up and down without sense, I give up. Sorry. :-[
Title: Re: New directories for addons
Post by: prissi on January 29, 2012, 08:24:51 PM
Sorry, the text must begin with en-whatever.tab, i.e. language code first.
Title: Re: New directories for addons
Post by: Zeno on January 29, 2012, 09:14:52 PM
Oh, it was that, not it works... finally!
Thank you prissi.