Continuing exploring trigger functionality and there is some good news. You can now create local instance of a trigger using optional 3rd param – true or nothing will create global trigger as before, false will make trigger exist only on PC it is created, which is pretty useful in multiplayer in particular. Now you do not have to worry about client triggers getting dumped on the server when client leaves. Local triggers will get destroyed with client leaving.

Long needed solution indeed, considering that all other trigger params are already local and have local effect, it only makes sense to have fully local trigger. In addition you can now move trigger area as you wish, before it was problematic since you had to move the whole trigger, not very useful if you needed to change position only on one client. You can thank BI’s David “Dwarden” Foltyn personally for this addition.

So alt syntax is: createTrigger [type, position, isGlobal];

What I’d like to show in this post a few scripted solutions on how to set some useful trigger activation params. Lets look at some of the activation types:

VEHICLE

This type is used to monitor attached vehicle. The vehicle can be set with triggerAttachVehicle command. When attached vehicle is inside detection area it triggers the detection event.

//fires when player object is in trigger area tr triggerAttachVehicle [player]; tr setTriggerActivation ["VEHICLE", "PRESENT", true]; tr setTriggerStatements ["this", "hint str thisList", ""];

GROUP

This type is used to monitor a particular group. There is no attach group command, instead triggerAttachVehicle is used and group is the group of the attached vehicle, if it has one. Only when every alive member of the group is in the trigger area, detection event occurs.

//fires when all alive members of the player's group are in trigger area tr triggerAttachVehicle [player]; tr setTriggerActivation ["GROUP", "PRESENT", true]; tr setTriggerStatements ["this", "hint str thisList", ""];

MEMBER

This type is used to monitor a member of a particular group. Just like with “GROUP” it requited triggerAttachVehicle and member is a member of the group of the attached vehicle. Detection triggers when any member of the group of the vehicle is in trigger area.

//fires when any player's group member is in trigger area tr triggerAttachVehicle [player]; tr setTriggerActivation ["MEMBER", "PRESENT", true]; tr setTriggerStatements ["this", "hint str thisList", ""];

LEADER

This type is used to monitor the leader of a particular group. Same principle as in “GROUP” and “MEMBER” and it also needs triggerAttachVehicle. Detection happens when the leader of the group of the attached vehicle is inside detection area.

//fires when player's group leader is in trigger area tr triggerAttachVehicle [player]; tr setTriggerActivation ["LEADER", "PRESENT", true]; tr setTriggerStatements ["this", "hint str thisList", ""];

STATIC

This type is used to monitor static attached object, like a map building for example. Unfortunately scripting solution is broken and neither triggerAttachObject nor triggerAttachVehicle do anything. But if you need a solution to monitor some static building and activate a trigger when the building is destroyed, there is a relatively simple workaround:

//fires when obj1 (Radar building on Stratis) is destroyed if (isServer) then { obj1 = nearestObject [[4358.67,3893.71], "Land_Radar_F"]; _tr = createTrigger ["EmptyDetector", [0,0,0], false]; _tr setTriggerStatements [ "!alive obj1", "['BOOM!','hint'] call BIS_fnc_MP; deleteVehicle thisTrigger", "" ]; };

The code uses local trigger that could be set on the server only. When building is destroyed, hint message is sent to every client.

Enjoy,
KK