The International Simutrans Forum

 

Author Topic: New directories for addons  (Read 12672 times)

0 Members and 1 Guest are viewing this topic.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9409
  • Languages: De,EN,JP
New directories for addons
« 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.
« Last Edit: January 17, 2012, 10:37:25 PM by prissi »

Offline Spike

  • *
  • Posts: 1361
  • First Simutrans Developer and Graphics Artist
Re: New directories for addons
« Reply #1 on: January 17, 2012, 10:04:38 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 :)

Offline Zeno

  • ENASSA Designer
  • Devotee
  • *
  • Posts: 1997
    • Zeno's Simutrans Creations
  • Languages: ES, EN, CAT
Re: New directories for addons
« Reply #2 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 :)

Offline Combuijs

  • Web Team
  • Devotee
  • *
  • Posts: 1392
  • Maintainer of maps.simutrans.com
    • Combuijs
  • Languages: EN, NL
Re: New directories for addons
« Reply #3 on: January 17, 2012, 10:30:04 PM »
Nice, very nice feature. Well done!

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9409
  • Languages: De,EN,JP
Re: New directories for addons
« Reply #4 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.

Offline Zeno

  • ENASSA Designer
  • Devotee
  • *
  • Posts: 1997
    • Zeno's Simutrans Creations
  • Languages: ES, EN, CAT
Re: New directories for addons
« Reply #5 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.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9409
  • Languages: De,EN,JP
Re: New directories for addons
« Reply #6 on: January 17, 2012, 11:14:42 PM »
The newest nightly is usually built at 3am MET. Thus r5091 or higher.

Offline An_dz

  • Web Admin
  • Administrator
  • *
  • Posts: 2836
  • D'oh
    • by An_dz
  • Languages: pt, en, it, (de)
Re: New directories for addons
« Reply #7 on: January 18, 2012, 02:52:24 AM »
Very nice addition, I need to remember it when I download the latest nightly. :D

Offline Zeno

  • ENASSA Designer
  • Devotee
  • *
  • Posts: 1997
    • Zeno's Simutrans Creations
  • Languages: ES, EN, CAT
Re: New directories for addons
« Reply #8 on: January 18, 2012, 07:25:14 AM »
That feature existed before, if you bundled you addon with translations in text/sdfdsf_xx.tab like now.
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 :(

Offline VS

  • Senior Plumber (Devotee)
  • Devotee
  • *
  • Posts: 4855
  • Vladimír Slávik
    • VS's Simutrans site
  • Languages: CS,EN
Re: New directories for addons
« Reply #9 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 ;)

Offline MHD

  • *
  • Posts: 197
  • Languages: DE,EN,CZ,FR
Re: New directories for addons
« Reply #10 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...)?

Offline VS

  • Senior Plumber (Devotee)
  • Devotee
  • *
  • Posts: 4855
  • Vladimír Slávik
    • VS's Simutrans site
  • Languages: CS,EN
Re: New directories for addons
« Reply #11 on: January 18, 2012, 02:42:55 PM »
Definitely pack-topic.

Offline Ashley

  • Coder/Patcher
  • Devotee
  • *
  • Posts: 1288
    • entropy.me.uk
Re: New directories for addons
« Reply #12 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.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9409
  • Languages: De,EN,JP
Re: New directories for addons
« Reply #13 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.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5447
  • Languages: EN, NO
Re: New directories for addons
« Reply #14 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.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9409
  • Languages: De,EN,JP
Re: New directories for addons
« Reply #15 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.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5447
  • Languages: EN, NO
Re: New directories for addons
« Reply #16 on: January 22, 2012, 09:19:45 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.

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.

Offline Zeno

  • ENASSA Designer
  • Devotee
  • *
  • Posts: 1997
    • Zeno's Simutrans Creations
  • Languages: ES, EN, CAT
Re: New directories for addons
« Reply #17 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. :-[
« Last Edit: January 29, 2012, 05:18:03 PM by Zeno »

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9409
  • Languages: De,EN,JP
Re: New directories for addons
« Reply #18 on: January 29, 2012, 08:24:51 PM »
Sorry, the text must begin with en-whatever.tab, i.e. language code first.

Offline Zeno

  • ENASSA Designer
  • Devotee
  • *
  • Posts: 1997
    • Zeno's Simutrans Creations
  • Languages: ES, EN, CAT
Re: New directories for addons
« Reply #19 on: January 29, 2012, 09:14:52 PM »
Oh, it was that, not it works... finally!
Thank you prissi.