Page 1 of 1

Event Order with multiple mods?

Posted: Sun Oct 16, 2016 8:05 pm
by Peppe
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?

Re: Event Order with multiple mods?

Posted: Sun Oct 16, 2016 8:07 pm
by Supercheese
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?

Posted: Sun Oct 16, 2016 8:46 pm
by Peppe
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 have a dependency on the mod I hoped to run after in the event stack, but it runs first.

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.

Re: Event Order with multiple mods?

Posted: Sun Oct 16, 2016 9:06 pm
by aubergine18
If you set a dependency on another mod, that mod will get loaded before your mod, and thus register its events before your mod.

Re: Event Order with multiple mods?

Posted: Sun Oct 16, 2016 9:46 pm
by Peppe
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.
I have that already and that is not true.

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?

Posted: Mon Oct 17, 2016 4:33 am
by Rseding91
Peppe wrote:
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.
I have that already and that is not true.

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.
Correct. Events are fired in order by mod name.

Re: Event Order with multiple mods?

Posted: Mon Oct 17, 2016 4:38 am
by Peppe
Rseding91 wrote:
Peppe wrote:
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.
I have that already and that is not true.

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.
Correct. Events are fired in order by mod name.
Thanks for the confirmation.

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.

Re: Event Order with multiple mods?

Posted: Mon Oct 17, 2016 9:41 pm
by aubergine18
Seems 0.15 will change the event order :)

viewtopic.php?p=216063#p216063

Re: Event Order with multiple mods?

Posted: Tue Oct 18, 2016 4:29 am
by impetus maximus
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.