Jump to content
greywolf907

Random tasks\objectives

Recommended Posts

Ok, here's what I got, and just for your information the tasks will not be created until after the patrol function has completed, so the game may seem to do nothing for a while, depending on the amount of enemies you spawn with the script, I can integrate a "loading" system if you want me to, so there is something that indicates if the mission is ready or not. The clear task will complete with four enemies left in the AO.

In your mission folder, unzip the following, and place the "JSHK_fncs" folder in your main mission directory:

https://www.dropbox.com/s/vrpihtu9re870l1/JSHK_fncs.7z?dl=0

In your description.ext file place the following:

class CfgFunctions
{
#include "JSHK_fncs\cfgFunctions.hpp"
};

And the new example task creation script (with new clear area check, and new patrol function call):

//example objective0Create.sqf
//call line being: [(getMarkerPos _rndLoc)] execVM "objective0Create.sqf";

_centerPos = (_this select 0);

_units = [_centerPos,200,5,3,2,2,1,EAST] call JSHK_fnc_patrols;//<<<<<new call line

_clearTask =
[
   "ClearID",
   true,
   ["Clear the area by any means necessary.","Primary: Clear Area","Clear Area"],
   _centerPos,
   "AUTOASSIGNED",
   6,
   true,
   true
] call BIS_fnc_setTask;

_tower = createVehicle ["Land_TTowerBig_2_F", _centerPos, [], 0, "NONE"];
_towerTask = 
[
  "RadioTowerID",
  true,
  ["Destroy the tower by any means necessary.","Secondary: Destroy Tower","Destroy Tower"],
  getPos _tower,
  "AUTOASSIGNED",
  5,
  true,
  true
] call BIS_fnc_setTask; 


_clearTaskLoop = [_units,_clearTask] spawn//<<<<<<new stuff here
{
waitUntil {{alive _x} count (_this select 0) < 5};
[(_this select 1),"Succeeded"] call BIS_fnc_taskSetState;
};

_towerCompleted = [_tower,_towerTask] spawn 
{
   waitUntil {!alive (_this select 0)}; 
   [(_this select 1),"Succeeded"] call BIS_fnc_taskSetState;
};

waitUntil {scriptDone _clearTaskLoop && {scriptDone _towerCompleted}};

0 = [] execVM "objectiveInit.sqf"; 

Edited by JShock

Share this post


Link to post
Share on other sites

K after testing through 2 AO'S everything works as intended couple probs though if someone JIP'S in after you start the mission it then assigns a new AO task location so how to make it JIP compatible? Is there a way to get the destroyed armor, chopper, vehicles, and tower to despawn after the AO task completes so that it doesn't just jumble up the server? As of now on that mission I have 6 objective markers when we completed the first town it spawned the next task at the same town then after killing everything again to make sure it would choose a new location it flipped to another objective like it should So is there some way to make it not pic the same objective twice to avoid that issue? I figure this script will just keep going forever and never have a ending which is fine for what I intended it for but say you did want to have the mission end after all objective complete how could that be achieved? Aside from a few wrinkles it played real nice and smooth thanks again for all the help JShock :)

Share this post


Link to post
Share on other sites

Hey JShock is the call line the same for this type of objective?? Sry have to wait and test after work. But definitely will.

if (!isServer) exitWith {}; // Server only

// set false the side1 so side finder will not execute this mission again
side1 = false;

sleep 200;

// find center of AO...looking for gamelogic location which created before in editor
_sidepos = [city1, city2, city3, city4, city5, city6, city7, city8, city9, city10] call BIS_fnc_selectRandom;

// add marker on AO/target
_marker = createMarker ["side_area", _sidepos];
_marker setMarkerType "hd_destroy";
_marker setMarkerColor "ColorRed";
_marker setMarkerText " Destroy jet";
_marker setMarkerSize [1,1];

// spawn target
jet = createVehicle ["vehicle_name", _sidepos, [], 0, "CAN_COLLIDE"]; 
jet lock true;
jet setdir random(360);

// Add task
//Task ID-Task name-Task description and some other options
["Task1","Destroy jet","Seek and destroy Jet",true,["Destroy jet",getmarkerpos "side_area"]] call SHK_Taskmaster_add ;

// spawn enemy

[_sidepos,300,5,5,5,5,3,2,2,1,EAST] call JSHK_fnc_patrols;

// WAIT UNTIL objective destroy
   waitUntil { (!alive jet) };

// task complete hint
["Task1","succeeded"] call SHK_Taskmaster_upd;

// delete AO marker and target
deleteMarker "side_area";
sleep 10;
deletevehicle jet;

// remove mans/vehicles/air/static "optional"
sleep 30;
{if (!(isplayer _x)) then {deleteVehicle _x;};} foreach nearestobjects [_sidepos,[
   "air","StaticWeapon","Landvehicle"
   ],2000]; 
sleep 10;
{if (!(isplayer _x)) then {deleteVehicle _x;};} foreach nearestobjects [_sidepos,[
   "man"
   ],2000]; 

sleep 5;

// go for next side mission
if (isserver) then { null=[]execVM "side_finder.sqf"; };

if(true)exitWith{};  

Share this post


Link to post
Share on other sites

Yeah, and again, check your syntax, this time it's a call to function (example line in the fn_patrols.sqf file).

---------- Post added at 10:06 ---------- Previous post was at 09:13 ----------

K after testing through 2 AO'S everything works as intended couple probs though if someone JIP'S in after you start the mission it then assigns a new AO task location so how to make it JIP compatible? Is there a way to get the destroyed armor, chopper, vehicles, and tower to despawn after the AO task completes so that it doesn't just jumble up the server? As of now on that mission I have 6 objective markers when we completed the first town it spawned the next task at the same town then after killing everything again to make sure it would choose a new location it flipped to another objective like it should So is there some way to make it not pic the same objective twice to avoid that issue? I figure this script will just keep going forever and never have a ending which is fine for what I intended it for but say you did want to have the mission end after all objective complete how could that be achieved? Aside from a few wrinkles it played real nice and smooth thanks again for all the help JShock :)

The following is for the end mission once all locations have been exhausted.

You will need to create a file named "initServer.sqf", in which you will put the following (remove the execution of "objectiveInit.sqf" from the init.sqf):

//initServer.sqf

glb_objectiveLocations = ["mrk1","mrk2","mrk3","mrk4","mrk5","mrk6"];//replace with your marker names

[] execVM "objectiveInit.sqf";

And the new code in the objectiveInit.sqf:

//objectiveInit.sqf

_objType = floor(random(7));

if (count glb_objectiveLocations > 0) then
{
_rndLoc = glb_objectiveLocations call BIS_fnc_selectRandom;
switch (_objType) do
{
	case 0: {[(getMarkerPos _rndLoc)] execVM "objective0Create.sqf"; glb_objectiveLocations = glb_objectiveLocations - [_rndLoc];};
	case 1: {[(getMarkerPos _rndLoc)] execVM "objective1Create.sqf"; glb_objectiveLocations = glb_objectiveLocations - [_rndLoc];};
	case 2: {[(getMarkerPos _rndLoc)] execVM "objective2Create.sqf"; glb_objectiveLocations = glb_objectiveLocations - [_rndLoc];};
	case 3: {[(getMarkerPos _rndLoc)] execVM "objective3Create.sqf"; glb_objectiveLocations = glb_objectiveLocations - [_rndLoc];};
	case 4: {[(getMarkerPos _rndLoc)] execVM "objective4Create.sqf"; glb_objectiveLocations = glb_objectiveLocations - [_rndLoc];};
	case 5: {[(getMarkerPos _rndLoc)] execVM "objective5Create.sqf"; glb_objectiveLocations = glb_objectiveLocations - [_rndLoc];};
	default {diag_log "Objective not defined"};
};
}
else
{
["Won"] call BIS_fnc_endMissionServer;
};

Now for deleting the old AO stuff, you will need to create a file name "fn_deleteOldAO.sqf" and place it in the JSHK_fncs folder, in that file put:

//fn_deleteOldAO.sqf
//example call: [_units] spawn JSHK_fnc_deleteOldAO;

private "_units";

_units = (_this select 0);

if (count _units < 1) exitWith {};

{
   { 
       if (isNull _x) then 
	{ 
		_units = _units - [_x];
	} 
	else 
	{ 
		deleteVehicle _x;
	}; 
   } forEach (_units select _forEachIndex); 

sleep 0.2;
} forEach _units;

And at the end of each of your objective#Create files, use the example call line above, and it should delete all the old units (as long as you use the return from JSHK_fnc_patrols), like so:

//example objective0Create.sqf
//call line being: [(getMarkerPos _rndLoc)] execVM "objective0Create.sqf";

_centerPos = (_this select 0);

_units = [_centerPos,200,5,3,2,2,1,EAST] call JSHK_fnc_patrols;//******Return of function is all spawned units, which is placed in the variable "_units"

_clearTask =
[
   "ClearID",
   true,
   ["Clear the area by any means necessary.","Primary: Clear Area","Clear Area"],
   _centerPos,
   "AUTOASSIGNED",
   6,
   true,
   true
] call BIS_fnc_setTask;

_tower = createVehicle ["Land_TTowerBig_2_F", _centerPos, [], 0, "NONE"];
_towerTask = 
[
  "RadioTowerID",
  true,
  ["Destroy the tower by any means necessary.","Secondary: Destroy Tower","Destroy Tower"],
  getPos _tower,
  "AUTOASSIGNED",
  5,
  true,
  true
] call BIS_fnc_setTask; 


_clearTaskLoop = [_units,_clearTask] spawn//<<<<<<new stuff here
{
   waitUntil {{alive _x} count (_this select 0) < 5};
   [(_this select 1),"Succeeded"] call BIS_fnc_taskSetState;
};

_towerCompleted = [_tower,_towerTask] spawn 
{
   waitUntil {!alive (_this select 0)}; 
   [(_this select 1),"Succeeded"] call BIS_fnc_taskSetState;
};

waitUntil {scriptDone _clearTaskLoop && {scriptDone _towerCompleted}};

[_units] spawn JSHK_fnc_deleteOldAO;//***********Variable "_units" is passed into the delete function, which will filter through and delete all currently alive units.

0 = [] execVM "objectiveInit.sqf";  

In the JSHK_fncs folder open the cfgFunctions.hpp file (w/ normal text editor), and replace all of it with the following:

class JSHK_patrols
{
tag = "JSHK";
class Patrol
{
	file = "JSHK_fncs";
	class patrols {};
	class deleteOldAO {};
};
};

Edited by JShock

Share this post


Link to post
Share on other sites

Ok done testing it now.

---------- Post added at 10:27 AM ---------- Previous post was at 08:34 AM ----------

Alright I cleared out the first AO tower as well they both showed as succeeded but no next task ever activated? Should this line_objType = floor(random(7)); in the objectiveInit.sqf be 7 or 6 Or do you always put one number more than the objectives?

Share this post


Link to post
Share on other sites

Ah, yea, my mistake it is supposed to be 6, was thinking "six" total objectives so put seven there, not looking at the 0-5 :p.

Share this post


Link to post
Share on other sites

Yea because if the random number was >6 it would floor to 6, and the switch statement would default, sending "Objective not defined" to the rpt file, so essentially not doing anything.

So now it should be any number >5 will floor to 5, executing the last objective case.

Edited by JShock

Share this post


Link to post
Share on other sites

K yup tested with Zeus cleared objective and it flipped nice. I will keep testing seems all good at this point just have to add more objectives and polish up couple things then it will be ready for release. I will keep you up to date if I come across anything else your the man JShock thanks!

Share this post


Link to post
Share on other sites

Hey JShock do I still need the JSHK_patrols.sqf since we now have the fn_patrols.sqf? Also what line would I change to have the chopper patrol a larger area in the AO is it this one _rndPos = [_AOmarker,50,_radius,5,0,0.5,0,[],[]] call BIS_fnc_findSafePos; Because it still just sits in the middle of the AO until you shoot at it which makes it easy to drop with a rocket.

Share this post


Link to post
Share on other sites

Yes you can delete JSHK_patrols.sqf, and try replacing the air patrols portion of fn_patrols with:

if (_numAirPatrols > 0) then
{
   for "_i" from 1 to (_numAirPatrols) step 1 do 
   {
       _rndVeh = _airUnits call BIS_fnc_selectRandom;
	_rndPos = [[[_AOmarker, _radius],[]],["water","out"],[],{}] call BIS_fnc_randomPos;
       _veh = createVehicle [_rndVeh,_rndPos,[],0,"FLY"];
       createVehicleCrew _veh;
       [(group _veh),(_AOmarker),350] call BIS_fnc_taskPatrol;
       {_units pushBack _x} forEach (crew _veh pushBack _veh);
       sleep 0.05;
   };
};

Share this post


Link to post
Share on other sites

K I will give that a try.

---------- Post added at 03:44 PM ---------- Previous post was at 03:39 PM ----------

Got a error with line 110 {_units pushBack _x} forEach (crew _veh pushBack _veh);

Share this post


Link to post
Share on other sites

Oh, must have grabbed this from an older version :p, replace the current line with the following two:

{_units pushBack _x} forEach (crew _veh);
_units pushBack _veh;

Edited by JShock

Share this post


Link to post
Share on other sites

Hey JShock after some heavy test runs everything is working gd the chopper is now a death machine and all the AO'S flip after completing the 2 tasks. The destroyed towers and vehicles however still do not despawn I did everything as instructed even double checked to make sure I didn't miss anything so not sure whatsup with it?

---------- Post added at 10:52 PM ---------- Previous post was at 09:55 PM ----------

K adjusted the deadbody removal script I use to delete all the vehicles so I just need a way for the tower to disappear after the AO is dropped.

Share this post


Link to post
Share on other sites

Sry to keep posting this but getting spam here and no units spawn. Any ideas to fix? these dump A3 functions, also, should I make a new thread about this? or is this related to JShock functions?

7:20:27 Error in expression <N";
};
};


private ["_wp"];
_wp = _grp addWaypoint [_pos, 0];
_wp setWaypointTy>
7:20:27   Error position: <addWaypoint [_pos, 0];
_wp setWaypointTy>
7:20:27   Error 0 elements provided, 3 expected
7:20:27 File A3\functions_f\spawning\fn_taskPatrol.sqf, line 61

7:20:58 Error in expression <ivate ["_list", "_units"];
_list = _pos nearObjects ["StaticWeapon", 100];
_unit>
7:20:58   Error position: <nearObjects ["StaticWeapon", 100];
_unit>
7:20:58   Error 0 elements provided, 3 expected
7:20:58 File A3\functions_f\spawning\fn_taskDefend.sqf, line 31
7:20:58 Error in expression <cWeapons;


private ["_wp"];
_wp = _grp addWaypoint [_pos, 10];
_wp setWaypointT>
7:20:58   Error position: <addWaypoint [_pos, 10];
_wp setWaypointT>
7:20:58   Error 0 elements provided, 3 expected
7:20:58 File A3\functions_f\spawning\fn_taskDefend.sqf, line 64

Share this post


Link to post
Share on other sites
K adjusted the deadbody removal script I use to delete all the vehicles so I just need a way for the tower to disappear after the AO is dropped.

Ok, try this after the tower is created:

_units pushBack _tower;

If that doesn't work try replacing "_towerCompleted" with the following (not sure if it will work, worth a shot):

_towerCompleted = [_tower,_towerTask,_clearTask] spawn 
{
[(_this select 0),(_this select 2)] spawn 
{
	waitUntil {[(_this select 1)] call BIS_fnc_taskState isEqualTo "Succeeded"};
	deleteVehicle (_this select 0);
};
   waitUntil {!alive (_this select 0)}; 
   [(_this select 1),"Succeeded"] call BIS_fnc_taskSetState;
};

And if that doesn't work, revert the "_towerCompleted" stuff, and under the line that creates the tower put:

_tower addEventHandler 
[
"Killed",
{
	[] spawn
	{
		waitUntil {["ClearID"] call BIS_fnc_taskState isEqualTo "Succeeded"};
		deleteVehicle _x;
	};
}
];

Let's hope one of those works :).

---------- Post added at 11:35 ---------- Previous post was at 11:32 ----------

Sry to keep posting this but getting spam here and no units spawn. Any ideas to fix? these dump A3 functions, also, should I make a new thread about this? or is this related to JShock functions?

I'm working on a combined system of functions and stuff (mainly due to all the stuff that has come up on this thread, will release when it's ready), and I ran into the same error, and fixed it, but instead of playing a game of 20 questions, could you send me a PM with a zip of all those files (I think you may have a while ago, but I would prefer to ensure most recent iterations of the code).

Share this post


Link to post
Share on other sites

Tried them all tested ingame negative on those man. What about the fn_deleteOldAO if you could figure out why that did not work than it should solve the tower problem right? The other thing it would help with is getting rid of the vehicles that are just damaged because the script I'm using only deletes destroyed vehicles. Another question I have is how does the patrol script handle the spawn of the units and their waypoints do they just randomly choose the paths they follow is there a set amount of generated waypoints for each AO that they share? Because it seems as though some of the vehicles tend to follow the same paths and run to each other.

Share this post


Link to post
Share on other sites
Tried them all tested ingame negative on those man. What about the fn_deleteOldAO if you could figure out why that did not work than it should solve the tower problem right? The other thing it would help with is getting rid of the vehicles that are just damaged because the script I'm using only deletes destroyed vehicles.

When in doubt be lazy, replace all of fn_deleteOldAO with:

//fn_deleteOldAO.sqf
//example call: [_units] spawn JSHK_fnc_deleteOldAO;

private "_units";

_units = (_this select 0);

{
   {
	if (!isNull _x) then
	{
		deleteVehicle _x;
	};
	sleep 0.02;
   } forEach (_units select _forEachIndex); 
} forEach _units;
{
deleteVehicle _x;
sleep 0.02;
} forEach (allDead + allDeadMen);

And for the other vehicles, try the following replacement for the patrol function:

/* //////////////////////////////////////////////
Author: J.Shock

File: fn_patrols.sqf

Description: Creates randomly positioned and sized patrols throughout a defined radius of an AO
            using a marker as the center position.

Parameters: 
       1- Center position: (array) (default: empty array)
       2- Radius to spawn units: (integer) (default: 300)
       3- Number of foot patrol groups: (integer) (default: 5)
       4- Number of vehicle patrol groups: (integer) (default: 3)
       5- Number of mechanized patrol groups: (integer) (default: 2)
       6- Number of armor patrol groups: (integer) (default: 2)
       7- Number of air patrol groups: (integer) (default: 1)
       8- Side: (side) (default: EAST)

Return: Spawned units.

Example Call line: _units = ["mrkName",200,5,3,2,2,1,EAST] call JSHK_fnc_patrols;

*///////////////////////////////////////////////
private [
		"_AOmarker","_radius","_numFootPatrols","_numVehPatrols","_center",
		"_numArmorPatrols","_numMechPatrols","_numAirPatrols","_side","_footUnits",
		"_vehUnits","_armorUnits","_mechUnits","_airUnits","_units"
	];

_AOmarker = [_this, 0, [], [[]]] call BIS_fnc_param;
_radius = [_this, 1, 300, [0]] call BIS_fnc_param;
_numFootPatrols = [_this, 2, 5, [0]] call BIS_fnc_param;
_numVehPatrols = [_this, 3, 3, [0]] call BIS_fnc_param;
_numArmorPatrols = [_this, 4, 2, [0]] call BIS_fnc_param;
_numMechPatrols = [_this, 5, 2, [0]] call BIS_fnc_param;
_numAirPatrols = [_this, 6, 1, [0]] call BIS_fnc_param;
_side = [_this, 7, EAST, [WEST]] call BIS_fnc_param;

_footUnits = ["OIA_InfSentry", "OIA_InfTeam", "OIA_InfTeam_AT", "OIA_InfTeam_AA"];
_vehUnits = ["O_MRAP_02_hmg_F","O_MRAP_02_gmg_F"];
_armorUnits = ["O_MBT_02_cannon_F"];
_mechUnits = ["O_APC_Wheeled_02_rcws_F","O_APC_Tracked_02_cannon_F"];
_airUnits = ["O_Heli_Attack_02_black_F"];

_center = createCenter _side;

_units = [];

if (_numFootPatrols > 0) then
{
   for "_i" from 1 to (_numFootPatrols) step 1 do 
   {
       _configGrp = _footUnits call BIS_fnc_selectRandom;
       _rndPos = [[[_AOmarker, _radius], []], ["water", "out"]] call BIS_fnc_randomPos;
       _grp = [_rndPos, _center, (configfile >> "CfgGroups" >> "East" >> "OPF_F" >> "Infantry" >> (_configGrp))] call BIS_fnc_spawnGroup;
       [_grp, (_AOmarker), (random(50)+75)] call BIS_fnc_taskPatrol;
       {_units pushBack _x} forEach units _grp;
       sleep 0.05;
   };
};    

if (_numVehPatrols > 0) then
{
   for "_i" from 1 to (_numVehPatrols) step 1 do 
   {
       _rndVeh = _vehUnits call BIS_fnc_selectRandom;
       _rndPos = [_AOmarker,50,_radius,5,0,0.5,0,[],[]] call BIS_fnc_findSafePos;
       _veh = [_rndPos,random(359),_rndVeh,_center] call BIS_fnc_spawnVehicle;
       [(_veh select 2),(_AOmarker),(random(50)+100)] call BIS_fnc_taskPatrol;
       {_units pushBack _x} forEach (_veh select 1);
	_units pushBack (_veh select 0);
       sleep 0.05;
   };
};

if (_numArmorPatrols > 0) then
{
   for "_i" from 1 to (_numArmorPatrols) step 1 do 
   {
       _rndVeh = _armorUnits call BIS_fnc_selectRandom;
       _rndPos = [_AOmarker,50,_radius,5,0,0.5,0,[],[]] call BIS_fnc_findSafePos;
       _veh = [_rndPos,random(359),_rndVeh,_center] call BIS_fnc_spawnVehicle;
       [(_veh select 2),(_AOmarker),(random(50)+100)] call BIS_fnc_taskPatrol;
       {_units pushBack _x} forEach (_veh select 1);
	_units pushBack (_veh select 0);
       sleep 0.05;
   };
};

if (_numMechPatrols > 0) then
{
   for "_i" from 1 to (_numMechPatrols) step 1 do 
   {
       _rndVeh = _mechUnits call BIS_fnc_selectRandom;
       _rndPos = [_AOmarker,50,_radius,5,0,0.5,0,[],[]] call BIS_fnc_findSafePos;
       _veh = [_rndPos,random(359),_rndVeh,_center] call BIS_fnc_spawnVehicle;
       [(_veh select 2),(_AOmarker),(random(50)+100)] call BIS_fnc_taskPatrol;
       {_units pushBack _x} forEach (_veh select 1);
	_units pushBack (_veh select 0);
       sleep 0.05;
   };
};

if (_numAirPatrols > 0) then
{
   for "_i" from 1 to (_numAirPatrols) step 1 do 
   {
       _rndVeh = _airUnits call BIS_fnc_selectRandom;
       _rndPos = [[[_AOmarker, _radius],[]],["water","out"],[],{}] call BIS_fnc_randomPos;
       _veh = createVehicle [_rndVeh,_rndPos,[],0,"FLY"];
       createVehicleCrew _veh;
       [(group _veh),(_AOmarker),350] call BIS_fnc_taskPatrol;
       {_units pushBack _x} forEach (crew _veh);
       _units pushBack _veh;
       sleep 0.05;
   };
};  

_units;

Another question I have is how does the patrol script handle the spawn of the units and their waypoints do they just randomly choose the paths they follow is there a set amount of generated waypoints for each AO that they share? Because it seems as though some of the vehicles tend to follow the same paths and run to each other.

I have no control over how the vehicles get their waypoints and such, it is handled by BIS_fnc_taskPatrol, so there is the chance that the vehicles will have crossed paths, if your not really wanting this, I would look around for other patrol scripts and such that are out there to see if they provide an algorithm against that issue.

Share this post


Link to post
Share on other sites

Ahh BIS_fnc controls all of that got it. Your script works great I couldn't be happier with it I was just wondering how all that was controlled the AI is just being stupid and running into each other what else is new. I have replaced the scripts with those and will test thanks JShock :)

Share this post


Link to post
Share on other sites
Ahh BIS_fnc controls all of that got it. Your script works great I couldn't be happier with it I was just wondering how all that was controlled the AI is just being stupid and running into each other what else is new. I have replaced the scripts with those and will test thanks JShock :)

Genesis has a driver AI addon to consider. Its really nice. Look into his VCOMAI (not 100% now), but he did release his AIdriving addon separate, it looks very nice and the AI do a much better job at driving.

UPS - urban patrol script, UPSMON and SHK_patrol are good to try as well. Many members contributing to Arma. Great thing! I still think JShock should release this once he gets it tuned up to his standards.

Share this post


Link to post
Share on other sites
I still think JShock should release this once he gets it tuned up to his standards.

What I have so far is an all in one call line, so it's a bit hard to understand, so I'm going to have to document how to use it (similar to the EOS readme), the call line thus far is a smooth 58 lines of code long (but has all the functionality discussed here, plus an extra or two).

---------- Post added at 16:54 ---------- Previous post was at 16:51 ----------

Error with line 15 } forEach (_units select _forEachIndex); of fn_deleteOldAO.sqf

Try this:

//fn_deleteOldAO.sqf 
//example call: [_units] spawn JSHK_fnc_deleteOldAO; 

private "_units"; 

_units = (_this select 0); 

{ 
if (!isNull _x) then 
   { 
       deleteVehicle _x; 
   }; 
   sleep 0.02;  
} forEach _units; 
{ 
   deleteVehicle _x; 
   sleep 0.02; 
} forEach (allDead + allDeadMen); 

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

×