Page 1 of 1

Add a custom/scriptable TechnologyTrigger

Posted: Mon Aug 25, 2025 7:14 am
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.

Type impossible for TechnologyTrigger

Posted: Fri Sep 19, 2025 9:03 pm
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

Re: Type impossible for TechnologyTrigger

Posted: Sat Sep 20, 2025 7:21 am
by curiosity

Re: Type impossible for TechnologyTrigger

Posted: Sat Sep 20, 2025 5:21 pm
by Subject314159
curiosity wrote: Sat Sep 20, 2025 7:21 am Duplicate of viewtopic.php?t=130498
..that's this exact thread

Re: Type impossible for TechnologyTrigger

Posted: Sat Sep 20, 2025 5:27 pm
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.

Re: Type impossible for TechnologyTrigger

Posted: Sat Sep 20, 2025 7:43 pm
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.

Re: Add a custom/scriptable TechnologyTrigger

Posted: Sun Sep 21, 2025 3:22 am
by Fishbus
+1 for just a few different built-in tech trigger types

Re: Add a custom/scriptable TechnologyTrigger

Posted: Wed Sep 24, 2025 7:41 am
by Quezler
+1 this would really fill a gap, like for space exploration's hidden unofficial quality mod compatibility i used the "capture" type set to a non-spawner building entity (weird that it's even allowed) just because it thematically it would make sense, but it would be nice if there was a "nothing" research trigger that mods can just completely control.

Re: Add a custom/scriptable TechnologyTrigger

Posted: Wed Sep 24, 2025 10:46 am
by MrSmoothieHuman
+1, NothingModifiers already exist for the same concept (fake thing that lets you add custom effects)