Updating Old Mods to work with new versions
- Alien_Squasher
- Long Handed Inserter
- Posts: 85
- Joined: Wed Oct 12, 2016 9:18 am
- Contact:
Updating Old Mods to work with new versions
Hi, so I would like to give a basic tutorial of how to update any mod to work with 0.15. In the mod is "info.json" in here are the mod's dependencies and the base factorio version. If there are any dependencies you don't want remove all the dependencies within the quotation marks in the dependencies part of this file but leave "base >= 0.15.34" or whatever version you use. Then if there isn't a line that looks like this "factorio_version": "0.15.34", copy and paste one from a working mod from this version (This will also be located in the info.json file.) Congratulations, you have tricked the game into thinking this mod is a new shiny one for your version.
Hi. I kill Aliens
The Hitchiker's Guide to the Galaxy states that when dealing with complex machinery of any sort the first step is: do not panic. If you can do this you're well on your way to being a grade A excuse for an engineer.
The Hitchiker's Guide to the Galaxy states that when dealing with complex machinery of any sort the first step is: do not panic. If you can do this you're well on your way to being a grade A excuse for an engineer.
Re: Updating Old Mods to work with new versions
Except... if the mod isn't updated by now, the mod will likely not work just by changing the factorio version. So don't be suprised if the mod that you edit like that breaks.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
- Alien_Squasher
- Long Handed Inserter
- Posts: 85
- Joined: Wed Oct 12, 2016 9:18 am
- Contact:
Re: Updating Old Mods to work with new versions
So? I just copy the .15 style libraries and model the old mod's libraries after it. 90% of mods use base game content which they modify to create something new, so libraries for things like roboports and modded roboports are often quite similar if not the same. Easy as pie.Bilka wrote:Except... if the mod isn't updated by now, the mod will likely not work just by changing the factorio version. So don't be suprised if the mod that you edit like that breaks.
Hi. I kill Aliens
The Hitchiker's Guide to the Galaxy states that when dealing with complex machinery of any sort the first step is: do not panic. If you can do this you're well on your way to being a grade A excuse for an engineer.
The Hitchiker's Guide to the Galaxy states that when dealing with complex machinery of any sort the first step is: do not panic. If you can do this you're well on your way to being a grade A excuse for an engineer.
Re: Updating Old Mods to work with new versions
Unfortunetly, new versions of the game can break many a thing, even if the code was originally copied. For example, 0.16 adds an "icon_size" option you NEED to include alongside the icons. If you dont provide it, the item refuses to work.
This has happened many times in the past when new required, or renamed, options change inside the base code.
Also, some functions may have the same name but return DIFFERENT results. If a mod assumes its going to get "ABC" and it gets "BCB" it may have a heart attack.
This has happened many times in the past when new required, or renamed, options change inside the base code.
Also, some functions may have the same name but return DIFFERENT results. If a mod assumes its going to get "ABC" and it gets "BCB" it may have a heart attack.
Re: Updating Old Mods to work with new versions
To sum it up (and add my own), required fixes so far:
* Bump version in info.json, obviously.
* Add icon_size to all icons missing it
* change circuit connections (see base entities for new syntax)
* change graphics sizes and animations where base graphics are used that now have new pictures
* change autoplacement for resources
* Bump version in info.json, obviously.
* Add icon_size to all icons missing it
* change circuit connections (see base entities for new syntax)
* change graphics sizes and animations where base graphics are used that now have new pictures
* change autoplacement for resources
Re: Updating Old Mods to work with new versions
+ change GUI styles (just cut "_style" from names of styles)mrvn wrote:To sum it up (and add my own), required fixes so far:
* Bump version in info.json, obviously.
* Add icon_size to all icons missing it
* change circuit connections (see base entities for new syntax)
* change graphics sizes and animations where base graphics are used that now have new pictures
* change autoplacement for resources
Re: Updating Old Mods to work with new versions
Yeah, but there are many more situations, which makes an "all covering" guide quite hard
Thats why they added the "factorio_version" flag in mods info.json, because major updates to Factorio can completely break a mod. And "base >= 0.13.6" was not enough to say "dont try to use this code in newer versions"
EDIT: Yes, you could make a generic guide that just says "ensure X, Y and Z are all fixed" but I would NOT tell people it will "make a mods work with new versions".
- Is it from 0.11, and tries to deal with entities or tiles or polution? whoops, many things have moved around since then
- An 0.12 mod? Make sure your not still including defines.lua, or that your not making recipes with old uncorrected item names
- A Mod from 0.13 that deals with equipment grids will find sooo many changes have happened
- That 0.14 mod that works with alien artifacts or fluids, well its gonna break
- an 0.15 mod that dealt with FluidBoxs might find itself suddenly not running
Thats why they added the "factorio_version" flag in mods info.json, because major updates to Factorio can completely break a mod. And "base >= 0.13.6" was not enough to say "dont try to use this code in newer versions"
EDIT: Yes, you could make a generic guide that just says "ensure X, Y and Z are all fixed" but I would NOT tell people it will "make a mods work with new versions".