How to properly call a function from a trigger in Arma 3.

Calling a function from a trigger in Arma 3 can be very tricky, this is how I managed to do it. commanderDead = { [’task2′,’SUCCEEDED’] call BIS_fnc_taskSetState; { _x setMarkerPos getPos house1; } forEach ["hqMarker", "hqCircle"]; [player, player, opfor, ["LOP_AFR_OPF_Infantry_IED","LOP_AFR_OPF_Infantry_Corpsman","LOP_AFR_OPF_Infantry_GL","LOP_AFR_OPF_Infantry_Rifleman_4","LOP_AFR_OPF_Infantry_Rifleman_4","LOP_AFR_OPF_Infantry_AR_Asst_2","LOP_AFR_OPF_Infantry_AT","LOP_AFR_OPF_Infantry_Rifleman_8","LOP_AFR_OPF_Infantry_Rifleman_5"], 16, 120] spawn BIS_fnc_spawnEnemy; private _attack = [] spawn KER_fnc_attackers; };   man2 = createTrigger … Read more