Multiple mods trigger on the on_player_created event and their functions run in what order?
If I want my mod to run last on an event can I set/influence my order in the event stack?
Event Order with multiple mods?
-
- Filter Inserter
- Posts: 841
- Joined: Mon Sep 14, 2015 7:40 am
- Contact:
Re: Event Order with multiple mods?
I'd imagine they'd run in order of which mod is loaded first on your mod list. You can influence this order by using dependencies.
Re: Event Order with multiple mods?
I have a dependency on the mod I hoped to run after in the event stack, but it runs first.Supercheese wrote:I'd imagine they'd run in order of which mod is loaded first on your mod list. You can influence this order by using dependencies.
I played around with renaming my mod and could get it to run in the order i desired. But don't really want to rename the mod just to tweak the event handling.
Sort appears to be AZ-az -- like it is based on the ASCII value of the mod name.
Target mod was lowercase -- any mod name starting with capital ran before the target mod. Mod names lower case but alphabetically after the target mod ran after the target mod.
- aubergine18
- Smart Inserter
- Posts: 1264
- Joined: Fri Jul 22, 2016 8:51 pm
- Contact:
Re: Event Order with multiple mods?
If you set a dependency on another mod, that mod will get loaded before your mod, and thus register its events before your mod.
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.
Re: Event Order with multiple mods?
I have that already and that is not true.aubergine18 wrote:If you set a dependency on another mod, that mod will get loaded before your mod, and thus register its events before your mod.
It would be nice if it worked that way, but events appear to be executed based on mod name and not by when the listener was registered.
Re: Event Order with multiple mods?
Correct. Events are fired in order by mod name.Peppe wrote:I have that already and that is not true.aubergine18 wrote:If you set a dependency on another mod, that mod will get loaded before your mod, and thus register its events before your mod.
It would be nice if it worked that way, but events appear to be executed based on mod name and not by when the listener was registered.
If you want to get ahold of me I'm almost always on Discord.
Re: Event Order with multiple mods?
Thanks for the confirmation.Rseding91 wrote:Correct. Events are fired in order by mod name.Peppe wrote:I have that already and that is not true.aubergine18 wrote:If you set a dependency on another mod, that mod will get loaded before your mod, and thus register its events before your mod.
It would be nice if it worked that way, but events appear to be executed based on mod name and not by when the listener was registered.
Bit of a corner case -- like most of a mod, but it adds something to the starting inventory, so I wanted to come in after it and remove the starter item.
- aubergine18
- Smart Inserter
- Posts: 1264
- Joined: Fri Jul 22, 2016 8:51 pm
- Contact:
Re: Event Order with multiple mods?
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.
- impetus maximus
- Smart Inserter
- Posts: 1299
- Joined: Sat Aug 20, 2016 10:07 pm
- Contact:
Re: Event Order with multiple mods?
would be nice to have some control over the order, or at least the display order in game.
having multiple mods in the upper left corner. some come pretty far down.
having those to the far left would be helpful.
having multiple mods in the upper left corner. some come pretty far down.
having those to the far left would be helpful.