--- title: event_ui_triggered summary: An MD condition for a Lua UI event, with payload read through event.param3. section: reference kind: api status: reference tags: ["X4","modding","event","ui","triggered"] sources: ["https://wiki.egosoft.com/X4%20Foundations%20Wiki/Modding%20Support/"] --- ## Return value | Type | Meaning | | --- | --- | | [event data](wiki:type-md-values) | MD condition, not a Lua return. screen/control are matching expressions; event.param3 is the sender-defined payload in the shown bridge. | [Types and methods](wiki:types) ## Observed form Layer: Mission Director cue conditions. Insert the cue below inside `cues`. Its screen/control pair matches [AddUITriggeredEvent](wiki:add-ui-triggered-event). ```xml ``` **What happens:** On a matching WikiBridge / ping event, $Payload receives its payload. For the paired Lua example it is the string "hello". Without the event, these cue actions do not run. ## Parameters `screen` and `control` are expressions used to match the event. In the shown project contract, `event.param3` holds the payload. ## Before a mutation Validate value types, list length, context and rights to the target object. A UI event is not authorization. `instantiate` and `namespace` affect repeated handling and variable scope. A one-time Init uses a different lifecycle: see [cues](wiki:md-cues).