Author Topic: How to use the "addons" folder in GAE 0.3?  (Read 2809 times)

wciow

  • Behemoth
  • *******
  • Posts: 968
    • View Profile
How to use the "addons" folder in GAE 0.3?
« on: 16 September 2010, 16:32:17 »
I was thinking of making another tileset and wanted to make it compatible with the new physfs system but I don't know exactly how it should be packaged to make it useable?
Check out my new Goblin faction - https://forum.megaglest.org/index.php?topic=9658.0

me5

  • Guest

silnarm

  • Local Moderator
  • Behemoth
  • ********
  • Posts: 1,373
    • View Profile
Re: How to use the "addons" folder in GAE 0.3?
« Reply #2 on: 17 September 2010, 03:06:49 »
That link should tell you what you need to know...

...but in a nutshell, recreate the directory structure as if you were in the data folder, so for a tileset, create a folder called tilesets, put your new tileset in it, then go back up and compress the 'tilesets' folder, plonk it in addons/ and away you go.
Glest Advanced Engine - Code Monkey

Timeline | Downloads

John.d.h

  • Moderator
  • Airship
  • ********
  • Posts: 3,757
  • I have to go now. My planet needs me.
    • View Profile
Re: How to use the "addons" folder in GAE 0.3?
« Reply #3 on: 17 September 2010, 03:38:17 »
Does compression slow down the loading much?  I'm just thinking, if I've got extra space would it behoove me to extract it or leave it compressed?

silnarm

  • Local Moderator
  • Behemoth
  • ********
  • Posts: 1,373
    • View Profile
Re: How to use the "addons" folder in GAE 0.3?
« Reply #4 on: 17 September 2010, 03:51:12 »
This is what my addons folder looks like atm,


I haven't had the stop-watch out or anything like that, but I haven't been able to notice any difference  :thumbup:
Glest Advanced Engine - Code Monkey

Timeline | Downloads

ultifd

  • Airship
  • ********
  • Posts: 4,443
  • The Glest Video Guy :) The one and only. :P
    • View Profile
    • My Youtube Channel
Re: How to use the "addons" folder in GAE 0.3?
« Reply #5 on: 17 September 2010, 04:07:45 »
Do we have to use zip or any kind of archived formats is ok? Specifically I'm thinking about 7z...

silnarm

  • Local Moderator
  • Behemoth
  • ********
  • Posts: 1,373
    • View Profile
Re: How to use the "addons" folder in GAE 0.3?
« Reply #6 on: 17 September 2010, 04:32:29 »
   * mods can be loaded from zip files
Only "zip" or "7-zip" too?
Only zip. 7zip support is broken and disabled.
:'(
Glest Advanced Engine - Code Monkey

Timeline | Downloads

John.d.h

  • Moderator
  • Airship
  • ********
  • Posts: 3,757
  • I have to go now. My planet needs me.
    • View Profile
Re: How to use the "addons" folder in GAE 0.3?
« Reply #7 on: 17 September 2010, 22:30:41 »
So... you just zip up a tech tree (for example) and pop it into your ~/.glestadv/addons and it should work?  That's what I'm doing, but it's not letting me select anything other than magitech. :look:

silnarm

  • Local Moderator
  • Behemoth
  • ********
  • Posts: 1,373
    • View Profile
Re: How to use the "addons" folder in GAE 0.3?
« Reply #8 on: 18 September 2010, 01:32:53 »
The whole directory structure as if it were in the game's main data directory needs to be within the zip, so the zip would need to include,

+ techs
   + new_tech
      + etc

just zipping new_tech wont work, because it will be mapped to the main data folder, so the game will be able to see it but wont know that its a tech-tree (because its not in the techs direectory).

Glest Advanced Engine - Code Monkey

Timeline | Downloads

John.d.h

  • Moderator
  • Airship
  • ********
  • Posts: 3,757
  • I have to go now. My planet needs me.
    • View Profile
Re: How to use the "addons" folder in GAE 0.3?
« Reply #9 on: 18 September 2010, 01:56:56 »
Huh... it's amazing how well some things work when you actually do them the right way.  In that case, the current Megapack works in GAE. :)

ultifd

  • Airship
  • ********
  • Posts: 4,443
  • The Glest Video Guy :) The one and only. :P
    • View Profile
    • My Youtube Channel
Re: How to use the "addons" folder in GAE 0.3?
« Reply #10 on: 18 September 2010, 02:25:43 »
Huh... it's amazing how well some things work when you actually do them the right way.  In that case, the current Megapack works in GAE. :)
Megapack v4 or the megapack from MG 3.3.6

John.d.h

  • Moderator
  • Airship
  • ********
  • Posts: 3,757
  • I have to go now. My planet needs me.
    • View Profile
Re: How to use the "addons" folder in GAE 0.3?
« Reply #11 on: 18 September 2010, 02:37:52 »
Huh... it's amazing how well some things work when you actually do them the right way.  In that case, the current Megapack works in GAE. :)
Megapack v4 or the megapack from MG 3.3.6
The one from MG 3.3.6. :)

ultifd

  • Airship
  • ********
  • Posts: 4,443
  • The Glest Video Guy :) The one and only. :P
    • View Profile
    • My Youtube Channel
Re: How to use the "addons" folder in GAE 0.3?
« Reply #12 on: 18 September 2010, 02:44:30 »
Oh, ok. I guess we should release a megapack v5 for people who want it for GAE... Maybe after MG 3.3.8, where there might be factions added to it. But I'm getting OT...

So, I guess this is the equivalent of the "My Data" in MG...Kinda.

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: How to use the "addons" folder in GAE 0.3?
« Reply #13 on: 19 September 2010, 01:12:53 »
Wow, this is amazing, kudos to you on this silnarm (and Hailstone, and Yggdrasil, and any other contributors). Does this mean that this will be the new way to release mods?

Also, can it be used to "overwrite" any file, such as a the main menu model, or is it limited to techtrees, factions, and tilesets?

Finally, this may be a bad idea to ask, but I simply must, you stated that "7zip support is broken and disabled". Will we see support in a future version? After all, the LZMA compression format is free and (I think) open source, while also being far more efficient than zip, and it certainly would be easier to just upload a single 7zip file to throw into the addons folder than trying to 7zip a zip file, or even just uploading the zip file (for those with faster internets). Of course, the ability to use zip files is handy still, since even zip can cut the filesize in half, and the major plus, new players won't have any problems with this at all. Since there's one standardized folder structure, there's no explaining that you must place this folder in whatever...

Anyway, as always, good work Silnarm.
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

silnarm

  • Local Moderator
  • Behemoth
  • ********
  • Posts: 1,373
    • View Profile
Re: How to use the "addons" folder in GAE 0.3?
« Reply #14 on: 19 September 2010, 02:06:55 »
Wow, this is amazing, kudos to you on this silnarm (and Hailstone, and Yggdrasil, and any other contributors). Does this mean that this will be the new way to release mods?

This would be the preferred way to distribute mods, yes.

Quote
Also, can it be used to "overwrite" any file, such as a the main menu model, or is it limited to techtrees, factions, and tilesets?

Yes, any file from the base data can be overwritten in this way, but if you have two 'overwrites' in the addons folder, which will be used is undefined.

7zip would be nice, I'm not even sure what wrong with it, Yggdrasil is the one who gave us PhysFS, so he'll be able to tell us more....
Glest Advanced Engine - Code Monkey

Timeline | Downloads

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: How to use the "addons" folder in GAE 0.3?
« Reply #15 on: 19 September 2010, 18:21:44 »
Yes, any file from the base data can be overwritten in this way, but if you have two 'overwrites' in the addons folder, which will be used is undefined.
Hmm, so what would happen in such a case then? Would glest crash or something? I would think it would be preferable to have the addons folder content overwrite the normal stuff. I can think of many situations that could be handy, but NONE where the reverse would be needed (and besides, to remove an addon, you just have to delete that zip file, thus returning to the original state). For example, I might make an add-on which slightly modifies magic so that the energy source uses the generate command instead of having to build multiple energy sources, so I'd have to overwrite the energy source XML.
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

Yggdrasil

  • Local Moderator
  • Ornithopter
  • ********
  • Posts: 408
    • View Profile
Re: How to use the "addons" folder in GAE 0.3?
« Reply #16 on: 19 September 2010, 23:03:54 »
It would not crash. It's just a bit unclear which one from the addon folder is used. The first one in the search path will be used but the order is not well defined and can be different on different platforms. Quote from the documentation of the used function:
Quote
Feel free to sort the list however you like. We only promise there will be no duplicates, but not what order the final list will come back in.
We don't sort. The base data folder is always last, so you can safely "overwrite" the base data with addons. Just avoid conflicting addons which contain files with the same full path.

7zip:
Haven't tested in a while. It just didn't work, read wrong xml files from the 7z archive and similar stuff. Did not really investigate, but will do so in the next time.