The Murk Spawn script is used to create simple trigger based spawning of AI units. By spawning AI units via trigger in the middle of a mission, we can reduce the amount of active AI at any one time. Providing enhanced performance for the server and clients.
By using the various options in the script we can simulate reinforcements and quick reaction forces, waves of enemy attacks, or just increase the amount of AI the players will encounter in the mission.
The script itself will cache all of the units and waypoints that are a part of the group that has been selected for the murk spawn. This cache is a lot less taxing on the system compared to having the AI active. The cached group and all of its waypoints are then created when the assigned trigger is activated.
It is key to understand that not all information is copied from units because of some functionality limitations in the ArmA engine. This includes properties such as the Init field of each unit. Because of this it's quite tricky doing executing scripts and functions on AI when they are “Murk Spawned”.
However, the waypoints that are cached and then created on activation are able to carry activation inits. This allows us to use the BSO Murk Loadout script to apply loadouts, vehicle configs, textures and any other activations we require against the group, after they have been “Murk Spawned”.
Murk Spawn Basics
There are three components required for the murk spawn system with the Beowulf Mission Framework.
- The Murk Spawn initialisation for the Group Leader
- The Murk Spawn Trigger
- The Sync link between the Group Leader and the Trigger
The initialisation given to the Group Leader will dictate what the Murk Spawn system will do with your unit. The basic call below is used to spawn the group once when the trigger is activated.
You are able to use other properties in the Murk Spawn script to have repeat spawnings of units. WARNING: Be careful with repeating waves! In particular, having a wave spawn several times over, without waiting for the death of the previous unit could quickly generate too many AI active at one time if not used properly.
Check out the murk_spawn.sqf script itself for the other options available. It's located in the BSO folder of the framework.
nul = [this,"once"] execVM "bso\murk_spawn.sqf";
Paste the above line into your Group Leader’s Initialisation field, and make any adjustments to the params you require.
NOTE 1. If your group contains a vehicle. Such as an APC transport. You should place the init on the vehicle itself after making the vehicle the group leader. Although not required, this seems to create the best results.
NOTE 2. Murk Spawner doesn’t seem to handle multi-vehicle groups anymore…. Nor does ArmA in general… If you want multiple vehicles to be spawned its easier to have several groups of single vehicles, although a pain.
Murk Spawn Trigger
The trigger for your Murk Spawned units can be configured just like a normal trigger condition. You can have it activate it however you like. The most common being when a faction enter an area or an object is destroyed.
To make it spawn your Murk Spawn units, we need to set the onActivation field as below.
Trigger_1 setVariable ["murk_spawn",true,true];
The first part of this init line is the name of the trigger itself. You need to change this to the name of your trigger.
Note. Reports from some that it works by using “thisTrigger” instead of naming the trigger. I haven't tried it YET.
The final component is a simple sync between the group and trigger.
Right click on the Group Leader, highlight “Connect To…” then click “Sync to”. Now Left Click on your murk spawn trigger.
Murk Spawn Advanced
The Murk Spawner system handles multiple groups being spawned against a single trigger. By syncing each individual group’s leader to the trigger, and setting the init. You can compose large attacks of various groups.
You can also have several triggers in your mission. Just remember to give the trigger a unique name, and then update the init accordingly.
You can use the murk spawner as much as you like in your missions. However, always bear in mind the amount of AI unit you plan to have active at any one time.
The biggest limitation of the Murk Spawn script is the inability to place inits lines in the units you are spawning. This stops you giving the units your own loadouts or applying other scripts.
However, you can use the activation field of waypoint to apply inits to the group leader. This allows things like defence scripts to be executed when the unit hits the waypoint.
The parameter “this” in a waypoint is the Group Leader. So any script you want to use against the group leader (for example the CBA Defence Script) can be used in any waypoint activation.
Expanding on the Waypoint Activation, we can use this function to apply loadouts and other properties to the Murk Spawned units.