Latest Posts

Topic: add ons

Ron_of_Nord
Avatar
Topic Opener
Joined: 2024-04-20, 23:43
Posts: 19
OS: Windows
Version: 1.2rc1
Ranking
Pry about Widelands
Location: Land_down_under
Posted at: 2024-04-20, 23:59

I've been a long time player since build 18 or so and I have found add ons to be both great and a curse. i find that if I create a map with an add on enabled but the map doesnt need it, widelands stubbonley refuses to load the map with out the add on enabled. This was a real problem a little while a go when I updated my laptop, installed widelands 1.2 rc1 , copied my maps ,the ones without addons but created with foreign planet enabled on my old laptop but not on the new one and widelands refused to load my maps. Add ons are great but may you could look at some sort of test when loading a map to see if an add on is used or required and only reject the map if so and the add on is not installed. Thanks for both a great game and your patience. Ron.


The aussies are coming, ya ho! ya ho!

Top Quote
Nordfriese
Avatar
Joined: 2017-01-17, 18:07
Posts: 2056
OS: Debian Testing
Version: Latest master
Ranking
One Elder of Players
Location: 0x55555d3a34c0
Posted at: 2024-04-21, 20:15

I am not entirely sure about this. For most common cases, it is fairly straightforward to keep track of which units are created and/or modified by which add-ons, and use that information to judge which add-ons could be removed from the map. But add-ons can use arbitrary Lua scripting which is especially important as it allows multiple add-ons to "talk" to each other to "discuss" how to proceed if they all want to modify the same or related units, and this could potentially confuse any simple detection algorithm.

Any removal of unused add-ons would have to be done before saving the map though.
When you want to load a map, there is no way of knowing whether the add-on conflicts will actually prevent the map from loading or not, other than trying it out and possibly failing.


Top Quote
Ron_of_Nord
Avatar
Topic Opener
Joined: 2024-04-20, 23:43
Posts: 19
OS: Windows
Version: 1.2rc1
Ranking
Pry about Widelands
Location: Land_down_under
Posted at: 2024-04-22, 11:18

Thanks for the response, I think i now have a work-around thanks to your information. I'll have to examine the add-on and have a look at one of the maps with my hex editor. I have a feeling that there is something saved in the maps causing this and the only way to know is to investigate. thanks for mentioning the Lua scripting, I'll have a look at the add-on and see what its doing,


The aussies are coming, ya ho! ya ho!

Top Quote
Nordfriese
Avatar
Joined: 2017-01-17, 18:07
Posts: 2056
OS: Debian Testing
Version: Latest master
Ranking
One Elder of Players
Location: 0x55555d3a34c0
Posted at: 2024-04-22, 11:26

The wmf file is simply a ZIP archive that you can extract with the archive manager of your choice. Or you can unselect the option to save data files compressed in the Widelands Options menu.

Once the map file is uncompressed into a directory, the info about required add-ons is in its elemental file. If you're sure an add-on is not used, you can simply edit that file and remove the add-on from the list therein.

Foreign Planet is a very straightforward add-on (one of the first ones I wrote to demo the add-ons system when I started developing it), it simply defines some new terrains and nothing else, so if you don't use any of its terrains it is safe to remove.

Edited: 2024-04-22, 11:28

Top Quote
Ron_of_Nord
Avatar
Topic Opener
Joined: 2024-04-20, 23:43
Posts: 19
OS: Windows
Version: 1.2rc1
Ranking
Pry about Widelands
Location: Land_down_under
Posted at: 2024-04-22, 11:56

Thanks , Nordfriese, I was unaware of the file format of the wmf. I will grab one of the maps and have a look at it when I get a chance. I'm actually quiite happy with the add-on, its just that I do like to do more traditional maps as well. I will definately have a look at a map though with your noes in mind.


The aussies are coming, ya ho! ya ho!

Top Quote
Ron_of_Nord
Avatar
Topic Opener
Joined: 2024-04-20, 23:43
Posts: 19
OS: Windows
Version: 1.2rc1
Ranking
Pry about Widelands
Location: Land_down_under
Posted at: 2024-04-22, 12:25

Again, thanks, I have had the chance to experiment and your note on Elemental was right on the money, remove the field and, recompress the files and voila! it works correctly.There is just one thing I am not sure of, what compression level should be used. 'Normal' worked but I dont know as yet wether higher compression will work. I will play with this to find out. Thank you very much, I have quite a few map files to check and fix so i am going to be busy for a while. There's no rest for the weary...


The aussies are coming, ya ho! ya ho!

Top Quote
kaputtnik
Avatar
Joined: 2013-02-18, 20:48
Posts: 2550
OS: Archlinux
Version: current master
Ranking
One Elder of Players
Location: Germany
Posted at: 2024-04-22, 16:42

You do not need to compress the folder again. Just add the extension .wmf to the folder, if it hasn't this extension. Windows hide the extensions form files by default, so you probably do not see if an, or which, extension is used...

I do not know the compression level of the zipped wmf files.


Top Quote