Author: norrin
Author Website:

Requirements: No addons required

Version: 1.0

Short description:

Date: 2009-07-26 14:45

Comments: (0)


AI vehicle respawn move via waypoints

AI vehicle respawn that moves to WP script.

1. Copy AIvcl_respawn_WP folder to your mission directory
2. Create a manned AI vehicle that will respawn in the editor
3. in the init line of the vehicle put:
nul = [this, 3, 10, "WS1","WP_scripts\WP1.sqf"] execVM "AIvcl_respawn_WP\AIvcl_respawn_WP_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
"WS1" - is the marker postion where you want the AI units to respawn
"WP_scripts\WP1.sqf" - is the name of path and the script that will add the waypoints.

In the test mission I have put the waypoint script in the directory called WP_scripts and the script that adds the waypoints is called "WP1.sqf"

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

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

_waypoint1 = _group addwaypoint[getmarkerpos"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.

* Each respawning AI vehicle needs to have the above code put in its init line.
* The respawning AI vehicles are created as the same type and their skill is set to the same level as set in the editor

Also in the test mission the player is setCaptive true so the enemy units will not shoot him.

Forum topic:
- forums
- BI forums

Enable javascript to be able to download from Armaholic please!

Tags: No tags