Simple update script for 0.14 -> 0.15

Place to get help with not working mods / modding interface.
Post Reply
thislooksfun
Burner Inserter
Burner Inserter
Posts: 8
Joined: Sun Aug 31, 2014 10:27 pm
Contact:

Simple update script for 0.14 -> 0.15

Post by thislooksfun »

Hello all! I wrote a simple shell script to help with porting mods from 0.14 to 0.15.

To use it, simply download it from here (right-click -> download linked file): https://gist.githubusercontent.com/this ... igrator.sh (v: 1.1.1)
Once you've downloaded it, open your favorite bash client, and run the following:

Code: Select all

chmod +x [drag downloaded file here]
[drag downloaded file here] [drag mod zip/folder here]
E.g., if I downloaded it to my `~/Downloads` folder, and the mod is called `example_mod_1.0.0.zip`, and is located in the standard macOS mods folder, I would run

Code: Select all

chmod +x ~/Downloads/mod_migrator.sh
~/Downloads/mod_migrator.sh ~/Library/Application\ Support/factorio/mods/example_mod_1.0.0.zip
WARNING: This is not a perfect script. There is a pretty decent chance it will make a mistake. For this reason, it will make a backup of the mod before doing any work, and it will log all its changes both to the console, and to a file called `migration_log_[mod name].txt`. Running the script on the same mod more than once might overwrite the backup.

List of changes taken from here: viewtopic.php?f=3&t=44505
Fixes
These will be actively performed
  • Remove spacing around '=' in locale files (' = ' -> '=')
  • less_then -> less_than
  • railpictures() -> rail_pictures()
  • underground_belt_distance -> max_underground_distance
  • game.get_event_handler -> script.get_event_handler
  • game.raise_event -> script.raise_event
  • alien-science-pack -> production-science-pack
Warnings
These will just notify you of problem locations.
  • Lua.coroutine
  • LuaGameScript::evolution_factor
  • LuaPlayer::build_from_cursor
  • LuaPlayer::rotate_for_build
  • LuaSurface::get_tileproperties
  • LuaForce::item_resource_statistics
  • LuaForce::fluid_resource_statistics
Note: This will not alert you to use of `LuaGameScript::save/load`—which was also removed—since `save` and `load` are widely used keywords and would produce false positives. If people want, I can add them to the warning list though.

If you come across anything you think should be added, please let me know.

judos
Filter Inserter
Filter Inserter
Posts: 266
Joined: Mon Dec 08, 2014 11:17 am
Contact:

Re: Simple update script for 0.14 -> 0.15

Post by judos »

haha awesome ideaa! Thanks for automating part of the migration process!
I'm just gonna try this out for updating my mods... :D

Post Reply

Return to “Modding help”