Page 1 of 1

Detect installed mods on_load

Posted: Wed Jun 19, 2019 6:41 am
by ownlyme
I want to register conditional event handlers (based on whether another mod is installed or not)
Afaik we are supposed to do that on_load to retain multiplayer compatibility.
The event is a custom input event from that other mod (which doesn't exist and error out if that other mod is not installed)

is there a better way of doing it except pcall?

Re: Detect installed mods on_load

Posted: Wed Jun 19, 2019 6:49 am
by Bilka
Read whether the mod is installed in on_init + on_config_changed, save that in global, read that in on_load it to determine whether to register the event.