There are three parameters. (last two of them are optional)
1- name of the group
2- pop-up ability (true or false)
3- Third parameter is a nested array.
First element in the array is the name of the static weapon the group must support (when the gunner got killed, the closest unit in the group will take his place)
Second element is the name of the trigger that covers the units that must support the static weapon. Positions of the units are fixed anyway.
You can run the script in an init, trigger, script. In the demo I start the script in the groupleader init. I don't define a group name, I use group this.
If you want to run it in a script, trigger,... whatever you have to define and use the groupname.
Examples:
[group this, true] exec "trenches\outpost.sqs"
In this case the script starts in the init of a groupleader, because groupname is not defined. The group will pop-up once a while (default) but they won't support any static weapon.
[mygrp, false] exec "trenches\outpost.sqs"
Name of the group is mygrp and they will kneel all the time and no weapon support.
[wgrp3, true,[MGbunker,MGbunkertrig]] exec "trenches\outpost.sqs"
Name of the group is Wgrp3, they pop-up and they support a static weapon named MGbunker. There also a trigger named MGbunkertrig covering all the unit that should support the weapon. You don't have to cover all the units in the group, units outside the triggerarea don't support static weapons.
When you place a group behind the trenches, just put them in the desired position/direction, but don't forget to set "none" in the special dropdown menu in the units init. (for each unit).
Can this be done via scripting btw? I know you can when you create units, but I'm not sure you can when you place the units on the map... It's in the readme btw