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:
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.
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.
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.
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.
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:
The code uses local trigger that could be set on the server only. When building is destroyed, hint message is sent to every client.