Page 1 of 1

Explain what the various Trigger, TriggerDelivery, and TriggerEffects do

Posted: Wed Dec 25, 2024 3:55 pm
by IsaacOscar
Looking at the documentation here for https://lua-api.factorio.com/latest/types/Trigger.html, I see 4 different options, but no explanation on exactly what they do.

Moreover, each option has an 'action_delivery' field which is a https://lua-api.factorio.com/latest/typ ... ivery.html (or an array of these). There are 7 types of TriggerDelivery, again with no explanation as to how they behave. These each have 'source_effects' and 'target_effects', of type https://lua-api.factorio.com/latest/typ ... ffect.html. Now there are 21 different kinds of trigger effect, one of which is a deadlink. None of them actually say what the 'effect' does, so you have to guess from the name and the fields. One of the effects here https://lua-api.factorio.com/latest/typ ... tItem.html has an action field of type Trigger, thus giving a loop.

I can sortof guess what the TriggerEffects do, in particular the ScriptTriggerEffect. But I have no idea how often the 'effects' will act, or 'where'.
In particular, for the script trigger effect, how often will it be executed, and what will the source_position, source_entity, target_position, target_entit, and cause_entity fields passed to the event handler be?