Creating a Simple Mission – Part 4

Spawning Random Groups

One of the functions (BIS_fnc_spawnGroup) BIS has provided allows you to spawn a random group or any group listed under the group (F2) function.

For my mission I’d like to spawn a random OPFOR  group of 12 units and have them patrol the town. I put a game logic where I wanted the group to spawn and typed the following in the init:

[position this, EAST, 12] call BIS_fnc_spawnGroup

What the script should do is spawn a random group of 12 Eastern units at the position of the game logic. Unfortunately however, this did not work. No matter what I tried, I could not get BIS_fnc_spawnGroup to work from the init line of a game logic. What I ended up doing was adding a waypoint to the game logic and placing the same code in the “on activation” field of the waypoint. This did work, but I’m not sure why.

Next: Random patrols