Quarry

by shylie

Mine ores without an ore patch. Probably compatible with any mod.

Content
5 years ago
0.14 - 0.17
137
Mining

i Bobs compatibility

7 years ago

Can you add compatibility for Bob's mods

7 years ago

I don't know how support other mods at the moment, but I can take a look into it.
Side note: I've never used Bob's mods in a full playthrough, so if you could send me a list of items I need to add, that'd be great!

7 years ago

Bob's ore mod in particular is easy to support, as he provides functions for checking his existence, even for each individual ore.
Add an optional dependency to ensure you load afterwards --
"dependencies": [
"? bobconfig >= 0.14.0",
"? bobores >= 0.14.0",
]

And then you can just

if bobmods.config.ores.EnableBauxite then
require("prototypes.quarry.bob-bauxite")
end

I don't have a list handy of all the ore names, but they're pretty well separated/pseudo-documented in the mod itself.

7 years ago

I understood how to add optional dependencies, but I never understood how to check if the mod was active.

This really clears things up, thanks!

7 years ago

For a more general solution, you can check for the existence of the ore item itself --
if data.raw.item["tenemut"] then
require("prototypes.quarry.dark-matter-replicators-tenemut")
end

For mods with APIs available like Bob's, use them, as for example I think Bob's bauxite ore will still trigger this snippet of code even if it's not being actively used. Not that that's a critical failure, of course, but...

7 years ago

if data.raw.item["tenemut"] then
require("prototypes.quarry.dark-matter-replicators-tenemut")
end

so this means that when a mod is an optional dependency, it loads that mod into your mod's files?

7 years ago
(updated 7 years ago)

No.
The startup sequence of loading the prototypes is in reality creating/editing working copies of the data in memory. At this point, it doesn't retain separate parity of mods, just a knowledge of where it came from and what it was edited by (this is the yellow mod text in the inspector).
Loading something as an optional dependency just means that if it's found, it'll make sure your mod's code gets executed after that mod's.
That code snippet says "If you find ["tenemut"] in the dataset, then load that file."
It's all Lua code. Careful about conceptualizing "files", because aside from requires/imports (and resources like images), it doesn't really know anything about them itself.

7 years ago

I didn't understand that "prototypes.quarry.dark-matter-replicators-tenemut" was a file example for MY mod, and not from dark matter replicators.

wow.

7 years ago

Haha, sorry. I pulled that example from my own modifications to Quarry for my current active modset.

7 years ago

lol

7 years ago

I went ahead and custom made a quarry-recipe.lua for bob support, this has no built in anti crash/dependency check you must have bobs ores loaded for this to work! I haven't dealt with tungsten/gems myself but I raised the cost of them.

https://pastebin.com/KC8v0ufM

Enjoy and anyone is 100% free to use this file in any way they like, i claim no ownership/copyright or any other legal bind between it and myself so that it may be used freely.

7 years ago

oh thanks!

New response