Exactly.
Basically I hoping to get back a table of just events containing maybe id\guid and name\description (just enough to call getevent() for more investigation). It would enable me to scan through the full list. Otherwise I'm forced to know the the 'name' of all events ahead of time and getevent() them and check for nil (in addition to EnmunlatingNoConsole enabling\disabling throughout if not inside an event) in order to see if they exist yet.
Also related - Ideally I wish I could do the same for triggers and actions too. Yesterday came across situation where I wanted to check if a particular action existed already for code that created them dynamically (Gunners recent question). Even when knowing the name of the trigger I couldn't find a way to essentially check for nil as there is no GetTrigger() like there is for events. Using SetTrigger() mode=list didn't much help because if you feed it an invalid Trigger name it sends back a full table dump (in xml) instead of nil\error like GetEvent() does. idk if a GetTrigger or GetAction is really needed though if GetEvents did something like the following.
I was thinking\expecting GetEvents(level) to return something like this:
GetEvents(0) would return a table of side=,id=,guid=,name=,type= where type was not filtered
GetEvents(1) would return a table of side=,id=,guid=,name=,type= where type was Events only
GetEvents(2) would return a table of side=,id=,guid=,name=,type= where type was Triggers only
GetEvents(3) would return a table of side=,id=,guid=,name=,type= where type was Conditions only
GetEvents(4) would return a table of side=,id=,guid=,name=,type= where type was Action only
Nil on no entries for given level.
Code: Select all
local allEvents = ScenEdit_GetEvents(0);
print(allEvents);
[1]{id='agah-fasdfasdfasd',name='some event #1',type='Event',side='red'}
[2]{id='agah-dfasd23ssdfs',name='some trigger name',type='Trigger',side='red'}
[3]{id='aghsf-dfasd22sdfs',name='some condition name',type='Condition',side='red'}
[4]{id='aghsf-dfasdsasfvs',name='some action name',type='Action',side='red'}
[5]{id='aghsf-dfasdsahhvs',name='some action name',type='Action',side='blue'}
local allEvents = ScenEdit_GetEvents(2);
print(allEvents);
[1]{id='agah-dfasdfassdfs',name='some trigger name,type='Trigger',side='red'}
Then not only does it solve the 'get a full list of all events' problem but also solves the ability to check if a particular action or trigger exists already via GetEvents(x) and scanning the table if not already coming back nil. Originally I thought this more or less existed already since I saw docs and the method in the code, but if it was never actually implemented I get this is additional work and some low priority work at that most likely. Just providing some feedback\suggestions as I encounter challenges.