From: Melbourne, Australia
I need to silently check for the existence of an event by name.
If I call ScenEdit.GetEvent(), and the event exists, the code works fine, no error, the event is found.
If I call ScenEdit.GetEvent(), and it does not exist, Command throws up an error message to the user (not silent) AND the script stops executing.
If I wrap the ScenEdit.GetEvent() with pcall or xpcall to trap the error, the same thing happens. (not silent) AND the script stops executing.
So I tried ScenEdit_GetEvents() to iterate through the list manually...
but this returns an error: attempt to call global 'ScenEdit_GetEvents' (a nil value)
Perhaps I am missing something, but I still need to test for the existence of my event.
Is this in a console or an event?
If a console, it will give an error.
If in an event, it should return nothing/nil.