add_niagara_event_handler
Add an event handler to a Niagara emitter to consume a source event, create its event script, and persist it without duplicate handlers.
Instructions
Add an event handler to a Niagara emitter (the writer for event_handler_count). Constructs an FNiagaraEventScriptProperties (allocating its UNiagaraScript with usage ParticleEventScript, mirroring add_niagara_simulation_stage) and adds it via UNiagaraEmitter::AddEventHandler. Idempotent by source_event_name: if a handler for that event already exists it is returned (already_exists=true) without adding a duplicate. The system is saved after modification. The handler's event-script graph is created in a default state — full event wiring must be completed in the Niagara editor (reported honestly via note); the handler properties are persisted and re-readable.
Returns: { system_path: string, emitter_name: string, usage_id: string, source_event_name: string, execution_mode: string, spawn_number: int, max_events_per_frame: int, already_exists: bool, event_handler_count: int, saved: bool, save_error?: string, note: string }
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| system_path | Yes | Asset path of the Niagara System (e.g. "/Game/Niagara/NS_Example"). | |
| emitter_name | Yes | Display name of the emitter handle within the system. | |
| spawn_number | No | Optional int particles to spawn per event (SpawnedParticles mode). | |
| execution_mode | No | Optional EveryParticle | SpawnedParticles | SingleParticle (default EveryParticle). | |
| min_spawn_number | No | Optional int minimum spawn when random_spawn_number is set. | |
| source_emitter_id | No | Optional GUID of the emitter handle that generates the event (default: this emitter). | |
| source_event_name | Yes | Name of the source event this handler consumes (its identity key for idempotency). | |
| random_spawn_number | No | Optional bool: spawn a random count in [min_spawn_number, spawn_number]. | |
| max_events_per_frame | No | Optional int cap on events consumed per frame. |