Add a custom/scriptable TechnologyTrigger

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Subject314159
Burner Inserter
Burner Inserter
Posts: 15
Joined: Thu Oct 12, 2023 8:53 pm
Contact:

Add a custom/scriptable TechnologyTrigger

Post by Subject314159 »

For the mod that I am developing I want to unlock a technology on killing a certain enemy. Unfortunately there is no "on entity destroyed" trigger but I managed to implement this via scripting. However every technology requires either a trigger unlock or a cost, and both of them does not quite convey the essence of the trigger;
ImageImage

Now the road towards unlocking a technology might be different for other mods so implementing specific research triggers would not be efficient for you devs, so maybe it is a good idea to have a custom TechnologyTriggere, which might look like:

Code: Select all

{
   type = "custom" --or "script"
   localised_string = LocalisedString
}
Where the LocalisedString would replace the "Mine [Entity: X]" part.

Optionally it would be nice to have a script unlock trigger, e.g.;

Code: Select all

LuaTechnology.trigger_scripted_research()
Why this would be nice: In editor mode I mined oil before unlocking the technology, removed the oil pump, then research_recursive until oil-gathering. What happened is that oil-processing was also researched, which leads me to believe that the game retains a memory of the trigger unlocks. By calling this function we would set the in-game "memory" of the trigger so that it is automatically unlocked if the trigger occurred before the prerequisites have been met.
meifray
Long Handed Inserter
Long Handed Inserter
Posts: 96
Joined: Sat May 29, 2021 6:12 pm
Contact:

Type impossible for TechnologyTrigger

Post by meifray »

I think modder can just manually implement their research trigger, all they need actually just a localization key for them to display any requirement they want :/

ImpossibleTechnologyTrigger Loaded when the type is "impossible ".
type :: "impossible"
trigger_description (*optional) :: LocalisedString
curiosity
Filter Inserter
Filter Inserter
Posts: 689
Joined: Wed Sep 11, 2019 4:13 pm
Contact:

Re: Type impossible for TechnologyTrigger

Post by curiosity »

Subject314159
Burner Inserter
Burner Inserter
Posts: 15
Joined: Thu Oct 12, 2023 8:53 pm
Contact:

Re: Type impossible for TechnologyTrigger

Post by Subject314159 »

curiosity wrote: Sat Sep 20, 2025 7:21 am Duplicate of viewtopic.php?t=130498
..that's this exact thread
Bilka
Factorio Staff
Factorio Staff
Posts: 3634
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: Type impossible for TechnologyTrigger

Post by Bilka »

Subject314159 wrote: Sat Sep 20, 2025 5:21 pm
curiosity wrote: Sat Sep 20, 2025 7:21 am Duplicate of viewtopic.php?t=130498
..that's this exact thread
I merged the threads.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
curiosity
Filter Inserter
Filter Inserter
Posts: 689
Joined: Wed Sep 11, 2019 4:13 pm
Contact:

Re: Type impossible for TechnologyTrigger

Post by curiosity »

Subject314159 wrote: Sat Sep 20, 2025 5:21 pm ..that's this exact thread
You can tell from the post titles that another thread has been merged into this one.
User avatar
Fishbus
Inserter
Inserter
Posts: 48
Joined: Sat Sep 28, 2024 8:20 pm
Contact:

Re: Add a custom/scriptable TechnologyTrigger

Post by Fishbus »

+1 for just a few different built-in tech trigger types
Post Reply

Return to “Modding interface requests”