Author: norrin
Author Website:

Requirements: No addons required

Version: 1.0

Short description:

Date: 2009-07-05 05:42

Comments: (0)


AI respawn group and move to WP script

This script creates a respawning group of non-playable AI that moves to waypoints. The units will only respawn when the whole group is dead and then will move off as a group.

1. Copy the AI_respawn folder to your mission directory
2. Create a group of AI units that will respawn in the editor
3. in the init line of the leader of the AI group put:
nul = [this, 3, 10, "east_spawn","East_WP.sqf"] execVM "AI_respawn\AI_respawn_init.sqf";
3 - is the number of times you want the AI unit to respawn;
10 - is the delay in seconds after the unit dies that you want it to respawn in
"east_spawn" - is the marker postion wher you want the AI units to respawn
"East_WP.sqf" - is the name of the script that will give the AI units their waypoints.

In the test mission I have put the waypoint script in the mission directory it is called


It commands the units to move to WPs created at markers. In the test mission the WP markers for AI units are called:"East_WP1" and "East_WP2" and the code looks like this:
_unit = _this select 0;
_group = group _unit;

_waypoint0 = _group addwaypoint[getmarkerpos"East_WP1",0];
_waypoint0 setwaypointtype"Move"; 

_waypoint1 = _group addwaypoint[getmarkerpos"East_WP2",0];
_waypoint1 setwaypointtype"Move";
Adapt this script to your own purposes. For instance you can add additional WP markers or you could have several of these scripts in the mission so different units moveTo different positions.
The respawning AI units are created as the same type, with the same loadout as they started the mission with and their skill is set to the same level as set in the editor

Forum topic:
- forums
- BI forums

Enable javascript to be able to download from Armaholic please!

Tags: No tags