Delete an event

All discussions & material related to Command's Lua interface

Moderators: RoryAndersonCDT, michaelm75au, angster, MOD_Command

Post Reply
TyphoonFr
Posts: 188
Joined: Thu Nov 23, 2017 4:27 pm
Location: FRA
Contact:

Delete an event

Post by TyphoonFr »

Hello
How can we delete an Event, 'Remove' does not work
http://commandlua.github.io/beta/index.html#EventUpdate



10/07/2018 12:22:23 -- B998.9 --
Console:
ScenEdit_SetEvent("Event", {mode="remove"})
...
Function:ScenEdit_SetEvent (0) Error:Unknown operation!
ScenEdit_SetEvent 0 : ,Unknown operation!
Christophe

To all English teachers of the forum, sorry if English is not my mother language.
User avatar
michaelm75au
Posts: 12463
Joined: Sat May 05, 2001 8:00 am
Location: Melbourne, Australia

RE: Delete an event

Post by michaelm75au »

I only have 'add' and 'update' defined for events.
You can remove trigger, condition and action, but I didn't allow that on events due to issues around having to 'undo' any assigned elements in the event.

If there is a need for it, we can revisit, but I don't see any real game reason for cleaning up empty events.
Michael
TyphoonFr
Posts: 188
Joined: Thu Nov 23, 2017 4:27 pm
Location: FRA
Contact:

RE: Delete an event

Post by TyphoonFr »

In 'Dynamic Pilot Ejection And SAR Rescue', Angster uses it, thinking it works.

With every lost plane, he creates a new Event.
once the pilot is recovered or lost, it removes triggers, actions and events:

-- Create Event For Destruction
ScenEdit_SetEvent("Event - Cancel Pilot"..downedPilot.guid, {mode="add",IsRepeatable=0})
local cancelEvent = ScenEdit_GetEvent("Event - Cancel Pilot"..downedPilot.guid)
SetLongKeyValuePairs(cancelEvent.guid,downedPilot.guid)
 
-- Remove Actual Event
   ScenEdit_SetEvent ("Event - Cancel Pilot" .. keyGUID, {mode = "remove"})


Gunner 98 took the same functions for his IOF # 4 scenario The Gate of Tears.

I want to use it too, I'm going to modify not to create all those Events that we can not delete, and to make the Triggers and Actions create in one and only Repeatable Event.

Thanks,
Christophe

To all English teachers of the forum, sorry if English is not my mother language.
User avatar
michaelm75au
Posts: 12463
Joined: Sat May 05, 2001 8:00 am
Location: Melbourne, Australia

RE: Delete an event

Post by michaelm75au »

Okay. I'll have a look at what I can do about it.
Michael
Post Reply

Return to “Lua Legion”