Dark Matter Replicators .18+


This mod adds replicators, machines which can produce items using nothing but electricity. Lower tiers of replicators are the most energy efficient and can essentially transform depleted, empty land into a resource. Higher tier replicators can simplify production lines or otherwise act as a convenience. Tier 1 replicators can replace depleted mining drills, allowing your expansion to be for growth rather than necessity.

Content
11 months ago
0.18 - 1.1
12.5K
Manufacturing

b Tech Tree issue with Space Exploration

4 years ago

I don't know if this is on your end or SE's, but when playing with both mods, for some reason every single replication technology has chemical, SE's optimization, rocket, material 4 and deep space 4 science packs added on, making them impossible to research, given the replication lab doesn't accept those items. The replicator techs also have those added, making them inaccessible until the very end of the game, even if you could research replications.
The "first space-locked tier" setting has no effect on this.

4 years ago

I've noticed that SE has some stuff that will do that... I could try and force the tech to regenerate the initial science packs in data-final-fixes or change the lab...

I'll make note of it for the next update (soon-ish)

4 years ago

Putting SE in debug mode and then looking at the logs revealed something interesting, it's reading the numbers in your tech names as a tech level, and setting the science pack requirements accordingly, like it does for the infinite techs. "dmr18-replication-1" reads as level 181, "dmr18-repl-dmr18-29-ore-copper" reads as level 181829, "dmr18-repl-water" reads as level 18, ect. The procedural tech script has an "exclude" value, but I'm not sure how you call it.

4 years ago

LOL, that's amazing.

4 years ago

Oh goodness. What a mess. Good job finding that bug!

4 years ago

I think I found the solution too, there's a table "se_prodecural_tech_exclusions" that the mod inserts to to exclude certain techs, like the module levels and mining prod. If you insert your techs into that table, it should skip them when adding science packs to leveled research. Also that's not a typo, it's spelled like that in the code.

4 years ago
(updated 4 years ago)

How'd you get the tech names from dmr18, chipgeek_jr? I can confirm adding the tech to the table works, I did it already for the techs that you posted for my own installation, but I have no idea how to get the rest of the tech names. BTW, I have no idea how lua works, but it seems like support needs to be added from space exploration's side since se_prodecural_tech_exclusions is not a global variable.
Edit: I tried making it global and then adding to the table from dark-replicators but there's no function to update the tech tree again as far as I can tell, so I guess imma go back to adding each one in separately.

4 years ago
(updated 4 years ago)

If SE is doing an exact string compare it would be super-annoying to exclude prototypes. If it does a string find/match, a pattern can be used instead. I think I started everything with dmr18, so the pattern "^dmr18" can be used as one pattern that would exclude everything from this mod. If I missed a few things, "dmr"/"dmr18" is probably not a likely string for other mods to use, and it should be in everything. I think.

4 years ago
(updated 4 years ago)

Thank you for the idea, while I have no idea how you'd fix it for your mod, I was able to fix the issue for myself by adding support from my local installation of SE by adding "dmr18" to se_prodecural_tech_exclusions. SE does use a pattern match for the exclude, but it doesn't look like you can use the exclude from outside of SE since it's not a function, but a local variable. Also the exclusion is done outside of a function which to my knowledge makes it impossible for you to support in your own mod, but I don't know lua so maybe theres a hack.

4 years ago
(updated 4 years ago)

Biggest problem I think is that nothing is in a function, so you can't remote.call it since pretty sure factorio doesn't support relative file paths, if it does I couldn't get it to work.

4 years ago
(updated 4 years ago)

While I'd really like for there to be an official fix, but for the meantime for anyone who wants to play SE with dmr18, a simple fix is to add table.insert(se_prodecural_tech_exclusions, "dmr18") after line 74 in space-exploration_version/data.lua.

4 years ago
(updated 4 years ago)

Btw, you can overwrite SE's changes by undeprecating data-final-fixes and moving

require("prototypes.repltable.process-costs")
require("prototypes.repltable.process-prereqs")
require("prototypes.repltable.process-actual-creation")

from data-updates.lua to data-final-fixes.lua

and adding

current_replication.prequisites = {}

after line 61 in process-prereqs.lua

it's not preferable but it does fix the issue without waiting for SE to someday add dmr18 to their exclusion table. I know you mentioned it earlier, but I'm not sure if you tested it so I'm just putting it out again after testing it.

4 years ago
(updated 4 years ago)

To fix my copy of dmr, since it updates less often than SE, I just put
if mods["space-exploration"] then
table.insert(se_prodecural_tech_exclusions, "dmr18")
end
at the end of dmr's data.lua, after the other mod checks for replications. Then just add SE as an optional dependency to dmr, so it loads first. Fixed all the techs right away, even in an existing save.

4 years ago
(updated 4 years ago)

Oh that's interesting, like I said I don't know lua, so I assumed that the table was local since it didn't have a global identifier _G and unable to be accessed by dmr. That's def a better solution and one that's supported by SE.

4 years ago

I didn't even know there was supposed to be an identifier for a global table. I know next to nothing about lua, other than what I've picked up from reading through factorio mod code, which is a very specific use case.

4 years ago

chipgeek_jr, yoink, thanks. Optional dependency for "space-exploration", added to data.lua. I'll look over the other discussions (some small tweaks hopefully). 1.0 version, then I'll also upload it as a 1.1 version. Then wait for the bugs to roll in :(

4 years ago

Added chipgeek_jr's fix

If it's fixed in the newer version let me know I can mark the topic. Of course reporting any more bugs, (related to this or otherwise) I would appreciate.

This thread has been locked.