From 22f87575de510150a1a0da7497950150656c47d7 Mon Sep 17 00:00:00 2001 From: Stephen Ward Date: Fri, 22 Jul 2016 22:57:21 -0400 Subject: [PATCH 1/4] updated migration scripts to work w/ Factorio v0.13 --- migrations/012-013.lua | 6 ++++-- migrations/012-013new.lua | 6 ++++-- migrations/013-014.lua | 6 ++++-- migrations/014-015.lua | 6 ++++-- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/migrations/012-013.lua b/migrations/012-013.lua index fadbb44..1b97c78 100644 --- a/migrations/012-013.lua +++ b/migrations/012-013.lua @@ -1,2 +1,4 @@ -game.player.force.resettechnologies() -game.player.force.resetrecipes() \ No newline at end of file +for _, force in pairs(game.forces) do + force.reset_technologies() + force.reset_recipes() +end \ No newline at end of file diff --git a/migrations/012-013new.lua b/migrations/012-013new.lua index fadbb44..1b97c78 100644 --- a/migrations/012-013new.lua +++ b/migrations/012-013new.lua @@ -1,2 +1,4 @@ -game.player.force.resettechnologies() -game.player.force.resetrecipes() \ No newline at end of file +for _, force in pairs(game.forces) do + force.reset_technologies() + force.reset_recipes() +end \ No newline at end of file diff --git a/migrations/013-014.lua b/migrations/013-014.lua index fadbb44..3b714f6 100644 --- a/migrations/013-014.lua +++ b/migrations/013-014.lua @@ -1,2 +1,4 @@ -game.player.force.resettechnologies() -game.player.force.resetrecipes() \ No newline at end of file +for _, force in pairs(game.forces) do + force.reset_technologies() + force.reset_recipes() +end diff --git a/migrations/014-015.lua b/migrations/014-015.lua index fadbb44..1b97c78 100644 --- a/migrations/014-015.lua +++ b/migrations/014-015.lua @@ -1,2 +1,4 @@ -game.player.force.resettechnologies() -game.player.force.resetrecipes() \ No newline at end of file +for _, force in pairs(game.forces) do + force.reset_technologies() + force.reset_recipes() +end \ No newline at end of file From ae0730f416ece8c8dbeeae24584047699ed6d89a Mon Sep 17 00:00:00 2001 From: Stephen Ward Date: Fri, 22 Jul 2016 22:59:47 -0400 Subject: [PATCH 2/4] migration files are run, but don't actually do anything in Factorio v0.13 --- migrations/012-013.lua | 4 ---- migrations/012-013new.lua | 4 ---- migrations/013-014.lua | 4 ---- migrations/014-015.lua | 4 ---- 4 files changed, 16 deletions(-) delete mode 100644 migrations/012-013.lua delete mode 100644 migrations/012-013new.lua delete mode 100644 migrations/013-014.lua delete mode 100644 migrations/014-015.lua diff --git a/migrations/012-013.lua b/migrations/012-013.lua deleted file mode 100644 index 1b97c78..0000000 --- a/migrations/012-013.lua +++ /dev/null @@ -1,4 +0,0 @@ -for _, force in pairs(game.forces) do - force.reset_technologies() - force.reset_recipes() -end \ No newline at end of file diff --git a/migrations/012-013new.lua b/migrations/012-013new.lua deleted file mode 100644 index 1b97c78..0000000 --- a/migrations/012-013new.lua +++ /dev/null @@ -1,4 +0,0 @@ -for _, force in pairs(game.forces) do - force.reset_technologies() - force.reset_recipes() -end \ No newline at end of file diff --git a/migrations/013-014.lua b/migrations/013-014.lua deleted file mode 100644 index 3b714f6..0000000 --- a/migrations/013-014.lua +++ /dev/null @@ -1,4 +0,0 @@ -for _, force in pairs(game.forces) do - force.reset_technologies() - force.reset_recipes() -end diff --git a/migrations/014-015.lua b/migrations/014-015.lua deleted file mode 100644 index 1b97c78..0000000 --- a/migrations/014-015.lua +++ /dev/null @@ -1,4 +0,0 @@ -for _, force in pairs(game.forces) do - force.reset_technologies() - force.reset_recipes() -end \ No newline at end of file From d0ab3786f7e9787a77c41ff70cbf6c6f8149e2e7 Mon Sep 17 00:00:00 2001 From: Stephen Ward Date: Fri, 22 Jul 2016 23:05:29 -0400 Subject: [PATCH 3/4] Reverting b/c once a game that has run the migration files is saved, factorio will throw an error if it does not find the migration file anymore Revert "migration files are run, but don't actually do anything in Factorio v0.13" This reverts commit ae0730f416ece8c8dbeeae24584047699ed6d89a. --- migrations/012-013.lua | 4 ++++ migrations/012-013new.lua | 4 ++++ migrations/013-014.lua | 4 ++++ migrations/014-015.lua | 4 ++++ 4 files changed, 16 insertions(+) create mode 100644 migrations/012-013.lua create mode 100644 migrations/012-013new.lua create mode 100644 migrations/013-014.lua create mode 100644 migrations/014-015.lua diff --git a/migrations/012-013.lua b/migrations/012-013.lua new file mode 100644 index 0000000..1b97c78 --- /dev/null +++ b/migrations/012-013.lua @@ -0,0 +1,4 @@ +for _, force in pairs(game.forces) do + force.reset_technologies() + force.reset_recipes() +end \ No newline at end of file diff --git a/migrations/012-013new.lua b/migrations/012-013new.lua new file mode 100644 index 0000000..1b97c78 --- /dev/null +++ b/migrations/012-013new.lua @@ -0,0 +1,4 @@ +for _, force in pairs(game.forces) do + force.reset_technologies() + force.reset_recipes() +end \ No newline at end of file diff --git a/migrations/013-014.lua b/migrations/013-014.lua new file mode 100644 index 0000000..3b714f6 --- /dev/null +++ b/migrations/013-014.lua @@ -0,0 +1,4 @@ +for _, force in pairs(game.forces) do + force.reset_technologies() + force.reset_recipes() +end diff --git a/migrations/014-015.lua b/migrations/014-015.lua new file mode 100644 index 0000000..1b97c78 --- /dev/null +++ b/migrations/014-015.lua @@ -0,0 +1,4 @@ +for _, force in pairs(game.forces) do + force.reset_technologies() + force.reset_recipes() +end \ No newline at end of file From 0867a58a24db0fd26fd6323db13321397c5e26ee Mon Sep 17 00:00:00 2001 From: Stephen Ward Date: Fri, 22 Jul 2016 23:19:47 -0400 Subject: [PATCH 4/4] finished changes to make Treefarm-AC compatible with factorio v0.13 --- control.lua | 9 ++++++++- info.json | 4 +--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/control.lua b/control.lua index e0bae7a..0deb348 100644 --- a/control.lua +++ b/control.lua @@ -1,7 +1,14 @@ script.on_event(defines.events.on_built_entity, function(event) if event.created_entity.name == "tf-cokery-dummy" then - game.get_surface("nauvis").create_entity{name = "tf-cokery", position = event.created_entity.position, force = game.forces.player} + local player = game.players[event.player_index] + + player.surface.create_entity({ + name = "tf-cokery", + position = event.created_entity.position, + force = player.force + }) + -- regardless of whether the cookery was created successfully or not, we still want to destroy the placeholder object event.created_entity.destroy() end end) \ No newline at end of file diff --git a/info.json b/info.json index ef7f179..8318ddb 100644 --- a/info.json +++ b/info.json @@ -6,7 +6,5 @@ "author": "drs, Blu3wolf, Treefarm Team", "homepage": "https://github.com/Blu3wolf/Treefarm-AC", "dependencies": ["base >= 0.13.0","Treefarm-Lite >= 0.5.1"], - "description": "This mod adds optional content to the treefarm like coke production, fertilizer production and biomass. - -Published under the GPLv3" + "description": "This mod adds optional content to the treefarm like coke production, fertilizer production and biomass.\r\nPublished under the GPLv3" }