Page 1 of 1

Add technology unlocks as modifiers to Prototype/Technology

Posted: Fri Jul 10, 2020 6:56 pm
by lyvgbfh
This would allow effective implementation of alternate research routes without complex scripting checks.

Per https://lua-api.factorio.com/latest/Con ... l#Modifier we have several effects that can be activated when a technology is researched, I am requesting the ability to have a research trigger completion of another, different research.

Why? Branching paths, alternate unlock routes, options for different gameplay. One could base their research tree around a military-centric production, or a peaceful route for example, within the same mod, using different science packs.

Code: Select all

dummytech.effects = {
  {
    type  = "unlock-technology",
    technology = "solar-energy"
  },
  {
    type = "unlock-technology",
    technology = "another-tech"
   }
}

Re: Add technology unlocks as modifiers to Prototype/Technology

Posted: Fri Jul 10, 2020 10:03 pm
by mrudat
on_technology_researched, unlock another technology; quite easily done already?

Re: Add technology unlocks as modifiers to Prototype/Technology

Posted: Sat Jul 11, 2020 3:36 am
by lyvgbfh
mrudat wrote: Fri Jul 10, 2020 10:03 pm on_technology_researched, unlock another technology; quite easily done already?
That method has a few issues, the biggest is that there isn't a visual representation of what said tech unlocks. Currently a tech will list recipes/buildings/etc that are unlocked, but if you were to do so using on_technology_researched that method of communication is lost.

Re: Add technology unlocks as modifiers to Prototype/Technology

Posted: Sat Jul 11, 2020 8:27 am
by mrudat
I believe that you can add an arbitrary icon to a dummy effect entry with an arbitrary localised string, so it's entirely possible to document to the player what is about to happen.


Given that I perpetrated OR-Nodes, I would like to be able to say that researching this technology also completes researching that technology.

The specific use-case that OR-Nodes satisfies in vanilla is that to depend on the Roboport, the Storage or Passive Provider chest, you currently need to depend on one of two technologies, so I added a dummy node to the tech tree to represent the state of having researched either of the prerequisite technologies. I have a script that watches on_technology_researched, and when a technology is researched that is a parent of one of the dummy nodes, it marks the child technology as researched.

If there was a facility to specify that on unlocking technology x that technology y was also unlocked, I could throw away (most of) my control script.

Omnicompression is another mod that I can think of that would have some benefit from the added feature.