## Hey, well you can try something like this:
npc_spawn_listShuffled : [ ]npc_spawner_device = array{}
var npc_eliminated_this_wave : int = 0
OnBegin():void=
– set npc_eliminated_this_wave : int = 0
– for (npcDevice : index_npcDevice):
– - - if (npc_currentSpawnDevice := npc_spawn_listShuffled[npcDevice]):
- - — - npc_currentSpawnDevice.Spawn()
- - — - npc_currentSpawnDevice.SpawnedEvent.Subscribe(OnNPCSpawned)
- - — - npc_currentSpawnDevice.EliminatedEvent.Subscribe(EliminateNPC)
EliminateNPC(result : device_ai_interaction_result): void=
– Print(“NPC has been eliminated”)
– set npc_eliminated_this_wave += 1
OnNPCSpawned(NPCAgent : agent): void=
– Print(“NPC Spawned”)
## Here you have device_event_ai_interaction info from documentation, you can get for
instance killer info from this or specific npc
#Payload of device_event_ai_interaction
.
device_ai_interaction_result := struct<epic_internal>:
# Optional agent that triggered the interaction
Source:?agent
#Optional agent targeted by Source
.
Target:?agent
## Cancelables are used to cancel your Subscriptions