Detect installed mods on_load

Place to get help with not working mods / modding interface.
User avatar
ownlyme
Filter Inserter
Filter Inserter
Posts: 445
Joined: Thu Dec 21, 2017 8:02 am
Contact:

Detect installed mods on_load

Post 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?
creator of 55 mods
My api requests/suggestions: ui relative for overlay||Grenade arc||Player Modifiers||textbox::selection||Singleplayer RCON||disable car's ground sounds
Bilka
Factorio Staff
Factorio Staff
Posts: 3464
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: Detect installed mods on_load

Post 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.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
Post Reply

Return to “Modding help”