How to make a definition name for the custom event?

Place to get help with not working mods / modding interface.
DiRten
Burner Inserter
Burner Inserter
Posts: 5
Joined: Sat Mar 04, 2023 9:01 pm
Contact:

How to make a definition name for the custom event?

Post by DiRten »

How to make a definition name for the custom event?
I generated uint event name:

Code: Select all

local event_name = script.generate_event_name()
And to "hear" it, I use:

Code: Select all

script.on_event(new_event, check_test_event)
But how can i create a definitive name for other mods?
Classic events are defined as:

Code: Select all

script.on_event(defines.events.EVENTNAME, ACTION)
How do I add a name to my event?
robot256
Filter Inserter
Filter Inserter
Posts: 995
Joined: Sun Mar 17, 2019 1:52 am
Contact:

Re: How to make a definition name for the custom event?

Post by robot256 »

There is no way to assign a global name to a custom event ID. When cross-mod compatibility is needed, you will need to add a remote interface so that mod can ask your mod what event ID to register.
DiRten
Burner Inserter
Burner Inserter
Posts: 5
Joined: Sat Mar 04, 2023 9:01 pm
Contact:

Re: How to make a definition name for the custom event?

Post by DiRten »

robot256 wrote: Mon Mar 06, 2023 11:59 pm There is no way to assign a global name to a custom event ID. When cross-mod compatibility is needed, you will need to add a remote interface so that mod can ask your mod what event ID to register.
Thanks!
Post Reply

Return to “Modding help”