Updating Old Mods to work with new versions

Looking for a mod? Have a review on a mod you'd like to share?
User avatar
Alien_Squasher
Long Handed Inserter
Long Handed Inserter
Posts: 85
Joined: Wed Oct 12, 2016 9:18 am
Contact:

Updating Old Mods to work with new versions

Post by Alien_Squasher »

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 :D

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.
Bilka
Factorio Staff
Factorio Staff
Posts: 3309
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: Updating Old Mods to work with new versions

Post by Bilka »

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.
User avatar
Alien_Squasher
Long Handed Inserter
Long Handed Inserter
Posts: 85
Joined: Wed Oct 12, 2016 9:18 am
Contact:

Re: Updating Old Mods to work with new versions

Post by Alien_Squasher »

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.
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.
Hi. I kill Aliens :D

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.
User avatar
DaCyclops
Long Handed Inserter
Long Handed Inserter
Posts: 85
Joined: Mon Aug 25, 2014 12:37 am
Contact:

Re: Updating Old Mods to work with new versions

Post by DaCyclops »

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.
mrvn
Smart Inserter
Smart Inserter
Posts: 5855
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: Updating Old Mods to work with new versions

Post by mrvn »

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
User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2905
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: Updating Old Mods to work with new versions

Post by darkfrei »

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
+ change GUI styles (just cut "_style" from names of styles)
User avatar
DaCyclops
Long Handed Inserter
Long Handed Inserter
Posts: 85
Joined: Mon Aug 25, 2014 12:37 am
Contact:

Re: Updating Old Mods to work with new versions

Post by DaCyclops »

Yeah, but there are many more situations, which makes an "all covering" guide quite hard
  • 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
And before you try to use that as a hitlist of "what to fix", I only included the most glaringly "will break a mod" options I could see in the changelogs.

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".
Post Reply

Return to “Questions, reviews and ratings”