What events does my mod listen to?
What events does my mod listen to?
Is there a way to find out what events my mod is listening to at any given time? It could be useful for debugging, especially when event handlers are added in response to other events.
A good mod deserves a good changelog. Here's a tutorial (WIP) about Factorio's way too strict changelog syntax!
Re: What events does my mod listen to?
You can run https://lua-api.factorio.com/latest/Lua ... nt_handler on every event ID. Not sure how to know what range to use given custom events.
My mods: Multiple Unit Train Control, Smart Artillery Wagons
Maintainer of Vehicle Wagon 2, Cargo Ships, Honk
Maintainer of Vehicle Wagon 2, Cargo Ships, Honk
Re: What events does my mod listen to?
Thanks, forgot about that one! It's a bit cumbersome, but should do.robot256 wrote: ↑Tue May 24, 2022 8:37 pmYou can run https://lua-api.factorio.com/latest/Lua ... nt_handler on every event ID.
That wouldn't be a problem. I already have a reverse look-up list of defines.events, to which I've added on_init, on_configuration_changed, and on_load as well as the custom events from other mods that I listen to, so I can have markers like this in the log file:Not sure how to know what range to use given custom events.
Code: Select all
====================================================================================================
Entered event script for on_player_driving_changed_state
Event data: tick = 13173, player_index = 1, entity = car "crawler" (32)
(@__GCKI__/scripts/event_handlers.lua: 912)
====================================================================================================
A good mod deserves a good changelog. Here's a tutorial (WIP) about Factorio's way too strict changelog syntax!