Jump to content
Sign in to follow this  
JackSouth19

ARMA 3: How to Get Respawned AI to Proceed to Objective Automatically

Recommended Posts

Hi , i am currently new to ARMA 3 and i have a question to ask.

 

My question is , how do i get an AI (who has just respawned at a respawn point) to regroup with other surviving squad members (also AI) and proceed to a designated waypoint ?

I am attempting to create a small skirmish in the centre of a town.

I have set up spawn points for each faction (BLUFOR and OPFOR) on the opposites ends of the town respectively and have placed around 3 squads of soldiers for BLUFOR and OPFOR respectively and i have assigned a waypoint for them to proceed to (centre of town).

However, whenever the soldiers die , they respawn at spawn point and do not move to the waypoint. What can i do to fix this ? 

 

Thanks for the assistance guys. I am pretty new to ARMA 3 and i have tried to looking that up online but most of the guides involve the use of a trigger (Someone has to go to a certain area to trigger the AI to respawn.) 

 

Appreciate the help.

Share this post


Link to post
Share on other sites

I'm not 100% sure, but so far i know that this might do it:

https://steamcommunity.com/sharedfiles/filedetails/?id=721359761&searchtext=Vcom+AI+AI+Overhaul

Again, im not 100% sure, as i am yet to check it out.

Share this post


Link to post
Share on other sites

Sounds like you are setting up custom scenarios with the mission editor. Good on you. The best way to accomplish what you want is to write a script and link it with the scenario. To do this you will need basic understanding of your mission file folder structure. 

 

Your missions are generally contained in your  /Documents/Arma3/<yournameHere>/Missions/<your mission name> file path. 

 

1. Go ahead and make a mission. find the central town and place down a marker. Double click it and give it the name 'CENTER'. 

2. Next you will need a few spawning locations.  I suggest you place down two or three vehicles suitable for the faction; like some trucks or MRAPS.  We will use these vehicles as spawn points for the assault force. On each vehicle we will run the script which will spawn in units!  First however, we write the script. 

 

3.  the script. Create a .sqf file. Just open notepad and change the file name to  unitSpawn.sqf. Obviously, place this file in your mission folder (right into the root) 

 

Paste the following into the .sqf file and save it: 

// Spawning a continuous stream of assaulters
// by nkenny 

/*
	DESIGN
	Assign a vehicle as a spawning point. 
	While the vehicle remains alive, spawn attackers. 
	Order the attackers to move and attack the 'CENTER' marker. 
	Wait until the attackers are all dead-- then repeat. 


	ARGUMENTS 
	0, OBJECT	-- Vehicle that is used as spawning object
	1, SIDE 	--  Side of spawned unit (WEST, EAST, RESISTANCE)
	2, COUNT	--  Number of units in the spawned group 

*/


// init
_vehicle = param [0]; 
_side = param [1]; 
_count = param [2]; 

// the magic 
while {alive _vehicle} do {

// create 
_grp = [getpos _vehicle,_side,_count] call bis_fnc_spawnGroup; 

// order
_wp = _grp addWaypoint [getmarkerPos "center",100]; 
_wp setWaypointType "SAD";

// backup
_wp2 = _grp addWaypoint [getMarkerPos "center",50];
_wp2 setWaypointType "GUARD";

// wait for it! 
waitUntil {{alive _x} count units _grp < 1};
sleep 30; 

}; 

 

4. Now it is time to revist the vehicles you just placed.  Copy the following into their Init  (Initialization) fields when you double click on the vehicle. 

 

For the WEST aligned vehicles: 

0 = [this,WEST,4] execVM "unitSpawn.sqf"; 

 

For the EAST aligned vehicles: 

0 = [this,EAST,4] execVM "unitSpawn.sqf"; 

 

5. Playtest

There is always room for testing and improvement. One could add more variety (and control) to the units spawned as well as more powerful checks to prevent AI from popping into existence right in front of a player. That said. As an easy basis. It gets the job done. 

 

-k 

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×