Remove Version requirment from mod folder names
Remove Version requirment from mod folder names
2 Slightly related requested changes regarding unzipped mods:
#1 Unzipped mods should not be required to have the version # appended to it.
If someone makes changes to a mod that include a change in version in info.json # (i.e new migrations/on_config_changed etc), they now have to rename all of their folders with the new version # before they can test their changes. This gets doubly annoying if the mod being tested has some sort of Version Control system and you are constantly going back and for between 2 (or more) versions for testing/fixes
#2 Unzipped mods should be ignored when updating in game (or have some way of manually clicking to add them to the update list). Chances are a config change or other local change was made and upgrading without thinking can throw this out the windows.
Just my 2 cents.
#1 Unzipped mods should not be required to have the version # appended to it.
If someone makes changes to a mod that include a change in version in info.json # (i.e new migrations/on_config_changed etc), they now have to rename all of their folders with the new version # before they can test their changes. This gets doubly annoying if the mod being tested has some sort of Version Control system and you are constantly going back and for between 2 (or more) versions for testing/fixes
#2 Unzipped mods should be ignored when updating in game (or have some way of manually clicking to add them to the update list). Chances are a config change or other local change was made and upgrading without thinking can throw this out the windows.
Just my 2 cents.
- Ranakastrasz
- Smart Inserter
- Posts: 2174
- Joined: Thu Jun 12, 2014 3:05 am
- Contact:
Re: Remove Version requirment from mod folder names
Same here. If there was an easy way to use git or similar with a folder that keeps changing name, this is fine. But there isnt, so its a problem.
This is my second least favorite part of nodding. Worst part is getting migration scripts to work.
This is my second least favorite part of nodding. Worst part is getting migration scripts to work.
My Mods:
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16
Re: Remove Version requirment from mod folder names
Migrations are easy. .json for swapping one item to another, .lua to change anything in game. (but no global)Ranakastrasz wrote:Same here. If there was an easy way to use git or similar with a folder that keeps changing name, this is fine. But there isnt, so its a problem.
This is my second least favorite part of nodding. Worst part is getting migration scripts to work.
Re: Remove Version requirment from mod folder names
I like #1. The most troublesome part for the current approach IMO is the need to set up the whole workspace again after changing the mod folder name, thus the references to files are lost.
I'm not sure about #2. Unzipped mods are supposed to be used for quick testing. If the changes are not recognized by the game, it will lose their purpose.
But I guess manual update will do the job, according to FFF #168.
I'm not sure about #2. Unzipped mods are supposed to be used for quick testing. If the changes are not recognized by the game, it will lose their purpose.
But I guess manual update will do the job, according to FFF #168.
You can create a folder above the mod folder and use it as a repo, so changing the mod folder name will not affect the reference to that repo.Ranakastrasz wrote:Same here. If there was an easy way to use git or similar with a folder that keeps changing name, this is fine. But there isnt, so its a problem.
Re: Remove Version requirment from mod folder names
Symlinks/junctions are your friend here as the only thing you need to change is the shortcut name in the mods folder. Which is still a pain and hence the changeMooncat wrote:I like #1. The most troublesome part for the current approach IMO is the need to set up the whole workspace again after changing the mod folder name, thus the references to files are lost.
I'm not sure about #2. Unzipped mods are supposed to be used for quick testing. If the changes are not recognized by the game, it will lose their purpose.
But I guess manual update will do the job, according to FFF #168.
You can create a folder above the mod folder and use it as a repo, so changing the mod folder name will not affect the reference to that repo.Ranakastrasz wrote:Same here. If there was an easy way to use git or similar with a folder that keeps changing name, this is fine. But there isnt, so its a problem.
Factorio/Devel/name_of_repository -- your mod code here
Factorio/Mods/name_of_repositry_0.0.0 -- junction to name_of_repository
As for #2 if a mod is unzipped it is typically for a reason i.e. config change or some other changes in a mod pack
- Ranakastrasz
- Smart Inserter
- Posts: 2174
- Joined: Thu Jun 12, 2014 3:05 am
- Contact:
Re: Remove Version requirment from mod folder names
While I can make it inside another folder, and make that an archive instead, if I do that the comparison function fails since literally everything changes when I change the version.
Where Can I learn about "Symlinks/junctions?"
Where Can I learn about "Symlinks/junctions?"
My Mods:
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16
Re: Remove Version requirment from mod folder names
That would defeat the entire purpose of the requirement if it wasn't there for unzipped.Nexela wrote:#1 Unzipped mods should not be required to have the version # appended to it.
The game makes no differentiation between zipped or unzipped mods as that would make no sense. If someone does manual modification of a mod then it's up to them to handle those changes.Nexela wrote:#2 Unzipped mods should be ignored when updating in game (or have some way of manually clicking to add them to the update list). Chances are a config change or other local change was made and upgrading without thinking can throw this out the windows.
If you want to get ahold of me I'm almost always on Discord.
Re: Remove Version requirment from mod folder names
So I decided to cook up a quick solution for myself:
http://sprunge.us/cWYC
It's a small shell script which finds out the mod version from the JSON file and creates a zip file at the right location with the right name. Now I can just keep my mods in a separate dir without the version in the dir name.
Just replace __user_folder__ accordingly.
http://sprunge.us/cWYC
Code: Select all
#!/bin/sh
DEPLOY_DIR=__user_folder__/mods/
MOD_NAME=${1%/}
MOD_VERSION=$( cd ${MOD_NAME} ; python << 'EOFEOF'
import json
with open("info.json") as file:
print(json.load(file)[u'version'])
EOFEOF
)
git --git-dir=${MOD_NAME}/.git archive --format zip --output ${DEPLOY_DIR}/${MOD_NAME}_${MOD_VERSION}.zip master
Just replace __user_folder__ accordingly.
- bobingabout
- Smart Inserter
- Posts: 7352
- Joined: Fri May 09, 2014 1:01 pm
- Contact:
Re: Remove Version requirment from mod folder names
I can agree this is annoying. it caused no end of problems for my 3rd party locale mod, in that one version was updated, where the other wasn't, and vica verca. long story short, they didn't match, which caused an issue.Nexela wrote:If someone makes changes to a mod that include a change in version in info.json # (i.e new migrations/on_config_changed etc), they now have to rename all of their folders with the new version # before they can test their changes. This gets doubly annoying if the mod being tested has some sort of Version Control system and you are constantly going back and for between 2 (or more) versions for testing/fixes
As a modder myself though, it is a pain in the arse making sure they both match all the time. I never used to have a number on my folders, just the zip file when I made one, and that worked fine for me until the version requirement came in, then it was a huge headache.
Re: Remove Version requirment from mod folder names
I just don't understand the version requirement at all. It reads the info.json to tell you that it doesn't match so......
Re: Remove Version requirment from mod folder names
This is the part I don't really understand.Nexela wrote:I just don't understand the version requirement at all. It reads the info.json to tell you that it doesn't match so......
It needs to look into zip anyway to grab the json and read the version number. So why it also needs folder name to have the version?
When mod is extracted folder name needs to match mod name afaik but why need the version in there if you have it in json.
- bobingabout
- Smart Inserter
- Posts: 7352
- Joined: Fri May 09, 2014 1:01 pm
- Contact:
Re: Remove Version requirment from mod folder names
There was a reason for it given when they decided to add it in the first place. I think it was somewhere mid 0.11 or something, I forget. But there should still be a topic floating around somewhere that details why they added it.
But yeah, the obvious answer is: so you can tell at a glance what version you have installed... and although this might be useful for a zip file you've downloaded... the necessity is lost, I mean, it's right there in the json file. There's no logical reason I can think of WHY you NEED it, especially considering it loads the json files to get the version numbers anyway, and instead of loading the mod, throws and error telling you it has no version number in the zip/folder name. Just load the damn mod!
But yeah, the obvious answer is: so you can tell at a glance what version you have installed... and although this might be useful for a zip file you've downloaded... the necessity is lost, I mean, it's right there in the json file. There's no logical reason I can think of WHY you NEED it, especially considering it loads the json files to get the version numbers anyway, and instead of loading the mod, throws and error telling you it has no version number in the zip/folder name. Just load the damn mod!
-
- Long Handed Inserter
- Posts: 95
- Joined: Thu May 18, 2017 2:22 pm
- Contact:
Allow uncompressed mod folders without version
Like many modders, I'm using git to version my work. This works nicely except when I have to bump the version number. The process is:
- Close the VSCode workspace
- Close the repo in SourceTree
- Rename the folder
- Open the workspace again
- Change the info file to match
- Open the repo again
- Commit
- Change the info file
- Commit
Re: Remove Version requirment from mod folder names
Merged the above post into this older topic.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
-
- Long Handed Inserter
- Posts: 95
- Joined: Thu May 18, 2017 2:22 pm
- Contact:
Re: Remove Version requirment from mod folder names
I feel like I’ve missed the original premise: what’s the reason for the version number requirement for folders?
Re: Remove Version requirment from mod folder names
Only this way you can have more than one version simultaneously.danielbrauer wrote: Sat Apr 13, 2019 4:40 pm I feel like I’ve missed the original premise: what’s the reason for the version number requirement for folders?
But why we need more than on unzipped mod folder - real question.
-
- Long Handed Inserter
- Posts: 95
- Joined: Thu May 18, 2017 2:22 pm
- Contact:
Re: Remove Version requirment from mod folder names
You could still have more than one version if one was allowed without a version number. The one without the version number should just take precedence.
Re: Remove Version requirment from mod folder names
The primary reason: so everyone can quick and easily see which version of which mod is in the mod(s) folder.danielbrauer wrote: Sat Apr 13, 2019 4:40 pm I feel like I’ve missed the original premise: what’s the reason for the version number requirement for folders?
The other benefits:
* It makes for an easy way to have multiple of the same mod installed without having to go change otherwise working mods.
* It gives a consistent naming scheme for mods
But at the end of the discussion it doesn't matter what anyone else says here we are not changing it.
If you want to get ahold of me I'm almost always on Discord.
-
- Long Handed Inserter
- Posts: 95
- Joined: Thu May 18, 2017 2:22 pm
- Contact:
Re: Remove Version requirment from mod folder names
Ok so one last possibility: a “development mode” option for Factorio which loosens the naming requirement for mod folders. Obviously I don’t know the complexity of the code involved, but that seems like it shouldn’t be too much work to maintain, considering how many modders would appreciate it. It also feels like most users wouldn’t touch such an option, so you’d still get the benefits of strict naming requirements for 99% of your user base.
Re: Remove Version requirment from mod folder names
Is it about zip archives or about folders? On mod creating I haven't any archive, but only one version of folder. On mod using I haven't any folder, but a lot of archives, I can see the version of them.Rseding91 wrote: Sun Apr 14, 2019 3:47 pm The primary reason: so everyone can quick and easily see which version of which mod is in the mod(s) folder.
The other benefits:
* It makes for an easy way to have multiple of the same mod installed without having to go change otherwise working mods.
* It gives a consistent naming scheme for mods