Skip to content

Fixes for Factorio 2.0 #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
*~
*.zip
12 changes: 12 additions & 0 deletions CHANGELOG.txt → changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
---------------------------------------------------------------------------------------------------
Version: 1.2.3
Date: 2025-03-26
Changes:
- added `inf-lab-speed` mod to exclusion list as this mod does the same
---------------------------------------------------------------------------------------------------
Version: 1.2.2
Date: 2025-02-17
Features:
- Bumped Factorio version to 2.0
- Research now depends on Space Science Pack

---------------------------------------------------------------------------------------------------
Version: 1.2.1
Date: 2021-02-01
Expand Down
69 changes: 34 additions & 35 deletions data.lua
Original file line number Diff line number Diff line change
@@ -1,35 +1,34 @@
data:extend(
{
{
type = "technology",
name = "research-speed-7",
icon_size = 256,
icon = "__base__/graphics/technology/research-speed.png",
effects =
{
{
type = "laboratory-speed",
modifier = 0.6
}
},
prerequisites = {"research-speed-6"},
unit =
{
count_formula = "8000*(L-6)",
ingredients =
{
{"automation-science-pack", 1},
{"logistic-science-pack", 1},
{"chemical-science-pack", 1},
{"production-science-pack", 1},
{"utility-science-pack", 1},
{"space-science-pack", 1}
},
time = 30
},
upgrade = true,
max_level = "infinite",
order = "c-m-d"
},
}
)
data:extend(
{
{
type = "technology",
name = "research-speed-7",
icon_size = 256,
icon = "__base__/graphics/technology/research-speed.png",
effects =
{
{
type = "laboratory-speed",
modifier = 0.6
}
},
prerequisites = {"research-speed-6", "space-science-pack"},
unit =
{
count_formula = "8000*(L-6)",
ingredients =
{
{"automation-science-pack", 1},
{"logistic-science-pack", 1},
{"chemical-science-pack", 1},
{"production-science-pack", 1},
{"utility-science-pack", 1},
{"space-science-pack", 1}
},
time = 30
},
upgrade = true,
max_level = "infinite",
order = "c-m-d"
},
})
25 changes: 14 additions & 11 deletions info.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
{
"name": "InfiniteLaboratorySpeed",
"version": "1.2.1",
"title": "InfiniteLaboratorySpeed",
"author": "Mongokatten",
"contact": "https://github.com/Mongokatten/InfiniteResearchSpeed/issues/",
"homepage": "https://github.com/Mongokatten/InfiniteResearchSpeed/",
"factorio_version" : "1.1",
"description": "It is now possible to research laboratory speed infinitely",
"dependencies": ["base >= 1.1.0"]
}
{
"name": "InfiniteLaboratorySpeedUpdated",
"version": "1.2.2",
"title": "Infinite Laboratory Speed 2.0",
"author": "roland77, Mongokatten",
"contact": "https://github.com/AngledLuffa/InfiniteResearchSpeed/issues/",
"homepage": "https://github.com/AngledLuffa/InfiniteResearchSpeed/",
"factorio_version" : "2.0",
"description": "It is now possible to research laboratory speed infinitely",
"dependencies": [
"base >= 2.0",
"!inf-lab-speed"
]
}
31 changes: 31 additions & 0 deletions scripts/build_package.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/usr/bin/env python3
import json
import os
import re
import zipfile

zip_suffix = 'zip'

if __name__ == '__main__':
with open("info.json") as fin:
info_json = json.load(fin)
version = info_json['version']
zip_prefix = info_json['name']

version_name = zip_prefix + "_" + version
zipname = version_name + '.' + zip_suffix
print("Building %s" % zipname)
with zipfile.ZipFile(zipname, 'w', zipfile.ZIP_DEFLATED) as zout:
for root, dirs, files in os.walk('.'):
if '.git' in dirs:
dirs.remove('.git')
for f in files:
if re.match(zip_prefix + '.*' + zip_suffix, f):
continue
if f.endswith("~"):
continue
fullname = os.path.join(root, f)
newname = os.path.normpath(os.path.join(version_name, root, f))
print("%s -> %s" % (fullname, newname))
zout.write(fullname, arcname=newname)

35 changes: 35 additions & 0 deletions scripts/install_local.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/usr/bin/env python3

import glob
import json
import os
import shutil
import sys

if __name__ == '__main__':
with open("info.json") as fin:
info_json = json.load(fin)
version = info_json['version']
zip_prefix = info_json['name']

expected_ending = version + ".zip"

new_versions = glob.glob(zip_prefix + "*")
new_versions.sort(key=os.path.getmtime)
if len(new_versions) == 0:
raise FileNotFoundError("Cannot find a version of " + zip_prefix + " to install")

latest_version = new_versions[-1]
if not latest_version.endswith(expected_ending):
raise ValueError("Expected version " + version + " but found " + latest_version)
print("Installing " + latest_version)

dest = "../../../AppData/Roaming/Factorio/mods"

existing = glob.glob(os.path.join(dest, zip_prefix + "*"))
if len(existing) > 0:
print("Removing existing versions: " + " ".join(existing))
for i in existing:
os.unlink(i)

shutil.copy(latest_version, os.path.join(dest, latest_version))
Binary file added thumbnail.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.