Dilemma of mod events

Place to get help with not working mods / modding interface.
Post Reply
User avatar
ZwerOxotnik
Long Handed Inserter
Long Handed Inserter
Posts: 66
Joined: Tue Dec 19, 2017 6:58 pm
Contact:

Dilemma of mod events

Post by ZwerOxotnik »

There's a mod and I want to separate its functionality on ~2 mods with mod event compatibility. However, I noticed that they can be both optional to each other actually. So, it doesn't matter where the events will be between the 2 mods, because it's either breaks compatibility of mod events or makes one of mods dependent upon the other.

And, there's another solution which can bring other issues because of uncertain conditions. I can use a third mod which will have the mod events with its own remote interface to reveal the mod events.

1. Is it enough to only just reveal the mod events with some description?
Example below:

Code: Select all

local mod_events = {
  on_mod_event_1 = script.generate_event_name(),
  on_mod_event_2 = script.generate_event_name()
}

remote.add_interface("my-mod-interface", {
  get_event_name = function(name)
    return mod_events[name]
  end
})
2. Do I need to care about a case when none of mods/interfaces will request the mod events actually?

3. Did I forget something else?

(I don't know an elegant solution for migration or something like that in this case. Also, such solution can bring more problems with compatibility in some cases)
Although, I can create mod events and remote interfaces in each mod and use the third mod to support mod events between other mods and, probably, it's an over complex solution.

Post Reply

Return to “Modding help”