I have found a workaround
Create a fake technology.
Code: Select all
data:extend{{
type = "technology",
name = "tips-and-tricks-trigger",
icon = "__core__/graphics.empty.png",
icon_size = 1,
hidden = true,
unit = {
count = 1,
time = 1,
ingredients = {}
},
prerequisites = {},
effects = {}
}}
Then configure a ResearchTechnologyTipTrigger:
Code: Select all
data:extend{{
type = "tips-and-tricks-item",
name = "script-triggered-tip",
trigger = {
type = "research",
technology = "tips-and-tricks-trigger"
},
-- ...
}}
Then control-time code can simply do:
Code: Select all
player.force.technologies['tips-and-tricks-trigger'].researched = true
This will unlock the Tip/Trick when the script says so, on a per-force basis.
If per-player is needed, you have to get a bit more creative, but it may be possible with a CraftItemTipTrigger, and the script can put a 1-frame fake recipe to craft a dummy item, which is then removed from the player's inventory... But then you have awkwardness if the player's inventory is full, so might not work out overall. Per-force is fine for my needs anyway, and the "fake research" works for me.