News:

Simutrans Tools
Know our tools that can help you to create add-ons, install and customize Simutrans.

New directories for addons

Started by prissi, January 17, 2012, 09:26:53 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

prissi

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.

Spike

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 :)

Zeno

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 :)

Combuijs

Nice, very nice feature. Well done!
Bob Marley: No woman, no cry

Programmer: No user, no bugs



prissi

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.

Zeno

It doesn't work for merged pak files with last nightly :(
I may try tomorrow with a single-object pak file.

prissi

The newest nightly is usually built at 3am MET. Thus r5091 or higher.

An_dz

Very nice addition, I need to remember it when I download the latest nightly. :D

Zeno

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 :(

VS

As to translations, all the files will be loaded, regardless of names. Naming with some recognizable prefix will certainly help make things recognizable, though ;)

My projects... Tools for messing with Simutrans graphics. Graphic archive - templates and some other stuff for painters. Development logs for most recent information on what is going on. And of course pak128!

MHD

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...)?

VS


My projects... Tools for messing with Simutrans graphics. Graphic archive - templates and some other stuff for painters. Development logs for most recent information on what is going on. And of course pak128!

Ashley

Will Simutrans load paksets from the ~/.simutrans/ (e.g. user directory) location too? This would be ideal for App bundles on the Mac.
Use Firefox? Interested in IPv6? Try SixOrNot the IPv6 status indicator for Firefox.
Why not try playing Simutrans online? See the Game Servers board for details.

prissi

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.

Ters

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.

prissi

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.

Ters

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.

Zeno

#17
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. :-[

prissi

Sorry, the text must begin with en-whatever.tab, i.e. language code first.

Zeno

Oh, it was that, not it works... finally!
Thank you prissi.