Page 1 of 1

How to make a definition name for the custom event?

Posted: Mon Mar 06, 2023 11:10 pm
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?

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

Posted: Mon Mar 06, 2023 11:59 pm
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.

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

Posted: Tue Mar 07, 2023 1:35 am
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!