Add technology unlocks as modifiers to Prototype/Technology

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Post Reply
lyvgbfh
Fast Inserter
Fast Inserter
Posts: 165
Joined: Fri Jul 10, 2020 6:48 pm
Contact:

Add technology unlocks as modifiers to Prototype/Technology

Post 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"
   }
}

User avatar
mrudat
Fast Inserter
Fast Inserter
Posts: 229
Joined: Fri Feb 16, 2018 5:21 am
Contact:

Re: Add technology unlocks as modifiers to Prototype/Technology

Post by mrudat »

on_technology_researched, unlock another technology; quite easily done already?

lyvgbfh
Fast Inserter
Fast Inserter
Posts: 165
Joined: Fri Jul 10, 2020 6:48 pm
Contact:

Re: Add technology unlocks as modifiers to Prototype/Technology

Post 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.

User avatar
mrudat
Fast Inserter
Fast Inserter
Posts: 229
Joined: Fri Feb 16, 2018 5:21 am
Contact:

Re: Add technology unlocks as modifiers to Prototype/Technology

Post 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.

Post Reply

Return to “Modding interface requests”