I’m trying to figure out which device in an array signaled an event but can’t find a nifty way to pass an agent into function after the device in the array gets signaled.
Anyone have a nifty solution to this?
Test := class(creative_device):
@editable Muts : []mutator_zone_device = array{}
var mutindex : []int = array{}
var count : int = 0
# Runs when the device is started in a running game
OnBegin<override>()<suspends>:void=
InitializeArray()
InitializeArray():void=
for(device:Muts):
set mutindex = mutindex + array{count}
set count = count + 1
IdentifyMut():void=
for(i:mutindex):
index := i
if(Mut := Muts[i]):
Mut.AgentEntersEvent.Subscribe(PassDevice(**AgentWouldGoHere**, index))
PassDevice(Agent:agent, mutzone:int):void=
block: