Page 1 of 1

Updating Old Mods to work with new versions

Posted: Mon Sep 25, 2017 2:38 pm
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.

Re: Updating Old Mods to work with new versions

Posted: Mon Sep 25, 2017 2:44 pm
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.

Re: Updating Old Mods to work with new versions

Posted: Thu Nov 30, 2017 11:53 pm
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.

Re: Updating Old Mods to work with new versions

Posted: Thu Dec 28, 2017 5:08 am
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.

Re: Updating Old Mods to work with new versions

Posted: Thu Dec 28, 2017 11:21 am
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

Re: Updating Old Mods to work with new versions

Posted: Thu Dec 28, 2017 11:26 am
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)

Re: Updating Old Mods to work with new versions

Posted: Fri Dec 29, 2017 5:12 am
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".