Jump to content
Sign in to follow this  
greywolf907

Help with primary objective completion.

Recommended Posts

So I have My co op test mission as is it has 6 random objectives and a secondary drop the tower objective that spawn in at the random location where I placed the markers. The primary objective is to clear out all enemy within the area and the task should complete but after killing all units it doesn't flip, the secondary objective works just fine though. Here is the script hope someone can tell me what to adjust to make it work thanks.

/* //////////////////////////////////////////////

Author: J.Shock

File: JSHK_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: ["mrkName",200,5,3,2,2,1,EAST] execVM "JSHK_patrols.sqf";

*///////////////////////////////////////////////

private ["_configGrps","_AOmarker","_radius","_numPatrols","_units","_center"];

_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) + (_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) + (_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) + (_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,50,_radius,5,0,0.5,0,[],[]] call BIS_fnc_findSafePos;

_veh = createVehicle [_rndVeh,_rndPos,[],0,"FLY"];

createVehicleCrew _veh;

[(group _veh),(_AOmarker),(random(50)+100)] 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

I haven't forgotten about you :p, just haven't had time this weekend to really sit down and code it all out, most of the stuff I've posted in the past days was from my phone :), so just give me a few more days and I should have it together (hopefully).

Share this post


Link to post
Share on other sites

Yeah not trying to go around you just figured you are busy thought maybe someone could help and not bug you with it. You know how when you have a project that is right on the verge of working the way you want except for one little thing holding you up that drive me nuts so I have to keep fooling with it until its fixed. Thanks man How do you spot all these posts you must live on BI forums ey :)

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  

×