Allow mod zip files to have version numbers
Allow mod zip files to have version numbers
The game seems to expect a mod's zip file to have the same name as the mod's directory would have. This is annoying when mods have different versions available for download. For example, right now in my downloads folder I have "testingmode.zip" and "testingmode (1).zip" and "testingmode (2).zip" because I've downloaded three different versions of the mod all named testingmode.zip. I named the downloads for my own mod something_0.1.zip but this confuses the game because it can't match up __something__/ to that zip file.
If there was some standard schema for version numbering on mod zip files then the game might just ignore that schema at the end of zip/directory names.
If there was some standard schema for version numbering on mod zip files then the game might just ignore that schema at the end of zip/directory names.
Re: Allow mod zip files to have version numbers
That is a good point.
Do you have some advice about the notation?
Do you have some advice about the notation?
-
- Fast Inserter
- Posts: 204
- Joined: Tue Feb 25, 2014 7:22 am
- Contact:
Re: Allow mod zip files to have version numbers
How about 'MODNAME[0.1.2].zip' ?
Using such characters makes it easy for both a program and the users to identify the verison numbers
Using such characters makes it easy for both a program and the users to identify the verison numbers
Re: Allow mod zip files to have version numbers
Yes, that is a good one, we use it already on the forums, I put this as an issue into our inernal tracker.
Thank you for the idea
Thank you for the idea
-
- Filter Inserter
- Posts: 559
- Joined: Mon Mar 04, 2013 9:23 am
- Contact:
Re: Allow mod zip files to have version numbers
Are square brackets alowed characters that can be used in file names on all suported platforms? I'm not sure they are but I may be wrong.
Re: Allow mod zip files to have version numbers
Square brackets are tricky. I think something like name_version will be safer ...
Re: Allow mod zip files to have version numbers
What about if the game ignores the zip name, and only takes the name of a folder that should be inside the zip?
So:
Modfolder can be used in the mods folder.
Modzip that contains modfolder can also be used in the mods folder, and the game ignores the name Modzip haves.
This way, zip files can be used compressed or non compressed, so when the we need to upload our mod, we dont need to compress the files inside Modfolder, we just compress the whole folder, and the whole folder can be used for us, modders to be able to edit easily the mod.
So:
Modfolder can be used in the mods folder.
Modzip that contains modfolder can also be used in the mods folder, and the game ignores the name Modzip haves.
This way, zip files can be used compressed or non compressed, so when the we need to upload our mod, we dont need to compress the files inside Modfolder, we just compress the whole folder, and the whole folder can be used for us, modders to be able to edit easily the mod.
Re: Allow mod zip files to have version numbers
good idea, ficolas.
how do you propose handling two zips with the same folder inside them?
how do you propose handling two zips with the same folder inside them?
Re: Allow mod zip files to have version numbers
Error?sparr wrote:good idea, ficolas.
how do you propose handling two zips with the same folder inside them?
Two versions of the same mod shouldnt exist in the same place.
Or reading the info.json file to see what version is higher.
- AlexPhoenix
- Fast Inserter
- Posts: 149
- Joined: Tue Feb 18, 2014 7:48 am
- Contact:
Re: Allow mod zip files to have version numbers
just make folder name just folder name, not mod name.
so any info must come from json.
so any info must come from json.
Re: Allow mod zip files to have version numbers
+1AlexPhoenix wrote:just make folder name just folder name, not mod name.
so any info must come from json.
Also if the mod folder contains 2 or more versions of the same mod, I would like the following:
If both mod-version are enabled then use the most recent version (and notify the player about it) otherwise use the version that is enabled
Re: Allow mod zip files to have version numbers
Bump. What if Factorio ignored both folder name, zip names, any file system names. But instead used "name" property from the info.json?
Right now mod naming is still crippled, zip-file-name == mod-folder-name or you gonna have a bad time.
Right now mod naming is still crippled, zip-file-name == mod-folder-name or you gonna have a bad time.
Re: Allow mod zip files to have version numbers
Makes total sense to use "name" as the identifier, since it should be unique anyways. Just do a split on the version and check
Code: Select all
table loadTheseMods
foreach mod in allModsFound do
if loadTheseMods contains mod.name then
currentVersion = loadTheseMods.getValue1(mod.name).version
split1[] = string.split(currentVersion)
split2[] = string.split(mod.version)
higher = true
for index = 0 up to max(split1.length, split2.length) do
if split1[index] = nil and split2[index] != nil then
do nothing
elseif split1[index] != nil and split2[index] = nil then
higher = false
elseif int.parse(split1[index]) > int.parse(split2[index]) then
higher = false
endif
endfor
if higher then
loadTheseMods.overwrite(mod.name, mod)
endif
elseif
loadTheseMods.put(mod.name, mod)
endif
endforeach
Re: Allow mod zip files to have version numbers
This will be done for 0.10.7
We decided to force one unified system to be used to make it organised.
So the mod zip package (and the folder inside) needs to have format "<Mod name>_<Mod version>" it will be checked if the format matches the version and the mod game at the start of the game.
This will invalidated all existing mods, but since the fix is very simple it shouldn't be so huge problem. We believe that it is better to do these kind of changes while it is in alpha.
We decided to force one unified system to be used to make it organised.
So the mod zip package (and the folder inside) needs to have format "<Mod name>_<Mod version>" it will be checked if the format matches the version and the mod game at the start of the game.
This will invalidated all existing mods, but since the fix is very simple it shouldn't be so huge problem. We believe that it is better to do these kind of changes while it is in alpha.