Docs: Mention event order by mod name

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
User avatar
aubergine18
Smart Inserter
Smart Inserter
Posts: 1264
Joined: Fri Jul 22, 2016 8:51 pm
Contact:

Docs: Mention event order by mod name

Post by aubergine18 »

viewtopic.php?p=215849#p215849

This was completely unexpected to me. I was expecting the events to be fired based on mod load order, and thus dependencies would have had an effect on it, but this is not the case. IMO docs should mention this.
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.
User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5286
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: Docs: Mention event order by mod name

Post by Klonan »

Mods shouldn't be doing anything based off other mods script event actions,
The remote interface and/or custom events are what you use when your mod script depends on some other mod
User avatar
aubergine18
Smart Inserter
Smart Inserter
Posts: 1264
Joined: Fri Jul 22, 2016 8:51 pm
Contact:

Re: Docs: Mention event order by mod name

Post by aubergine18 »

Yes, but recent discussions have shown that modders, myself included, were assuming that events would be handled based on mod load order, not alphabetical order. The current documentation does nothing to rectify this widely adopted invalid assumption. This will lead to bugs, and frustrated end users and modders.
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.
User avatar
aubergine18
Smart Inserter
Smart Inserter
Posts: 1264
Joined: Fri Jul 22, 2016 8:51 pm
Contact:

Re: Docs: Mention event order by mod name

Post by aubergine18 »

Suggested text:
When multiple mods listen to the same event, the order the mods receive the event is determined by alphabetic order of the mod names, not the order in which the mods are loaded. Setting mod dependencies will have no effect on event sequencing. To ensure correct flow between mods, use remote interfaces instead.
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.
Post Reply

Return to “Modding interface requests”