Mission with error in convoy

Mission with error in convoy

« posted: Sep 30, 2018, 10:32 PM »
Can someone get me a question?

I put the mission to spawn in the landconvoypaths and it continues appearing in places close to the city


How do I change this to spawn in landconvoy points?



// ******************************************************************************************
// * This project is licensed under the GNU Affero GPL v3. Copyright © 2014 A3Wasteland.com *
// ******************************************************************************************
//   @file Name: mission_artyPatrol.sqf
//   @file Author: myth

if (!isServer) exitwith {};
#include "patrolMissionDefines.sqf";

private ["_convoyVeh","_veh1","_veh2","_veh3","_veh4","_veh5","_veh6","_veh7","_veh8","_veh9","_veh10","_createVehicle1","_createVehicle2","_createVehicle3","_vehicles", "_leader", "_speedMode", "_waypoint", "_vehicleName", "_numWaypoints",
   "_box1", "_box2", "_box3", "_box4", "_box5", "_box6", "_box7", "_box8", "_box9", "_smoke1", "_boxesArray", "_cashpile", "_cashamount", "_cash"];
 
_setupVars =
{
   _missionType = "Arty Patrol";
_locationsArray = LandConvoyPaths;
};

_setupObjects =
{
   _town = (call cityList) call BIS_fnc_selectRandom;
   _missionPos = markerPos (_town select 0);

   _convoyVeh = ["I_LT_01_AT_F","I_LT_01_AA_F","I_MBT_03_cannon_F","O_APC_Tracked_02_AA_F","I_MBT_03_cannon_F","B_AFV_Wheeled_01_cannon_F","O_T_MBT_04_cannon_F"];

   _veh1 = _convoyVeh select 0;
   _veh2 = _convoyVeh select 1;
   _veh3 = _convoyVeh select 2;
   _veh4 = _convoyVeh select 3;
   _veh5 = _convoyVeh select 4;

   _createVehicle = {
      private ["_type","_position","_direction","_vehicle","_soldier"];

      _type = _this select 0;
      _position = _this select 1;
      _direction = _this select 2;

      _vehicle = createVehicle [_type, _position, [], 0, "None"];
      _vehicle setVehicleReportRemoteTargets true;
      _vehicle setVehicleReceiveRemoteTargets true;
      _vehicle setVehicleRadar 1;
      _vehicle confirmSensorTarget [west, true];
      _vehicle confirmSensorTarget [east, true];
      _vehicle confirmSensorTarget [resistance, true];
      [_vehicle] call vehicleSetup;

      _vehicle setDir _direction;
      _aiGroup addVehicle _vehicle;

      _soldier = [_aiGroup, _position] call createRandomSoldier;
      _soldier moveInDriver _vehicle;
        _soldier triggerDynamicSimulation true;
      _soldier = [_aiGroup, _position] call createRandomSoldier;
      _soldier moveInCommander _vehicle;
      _soldier = [_aiGroup, _position] call createRandomSoldier;
      _soldier moveInGunner _vehicle;

      //_vehicle setVehicleLock "UNLOCKED";  // force vehicles to be unlocked
      //_vehicle setVariable ["R3F_LOG_disabled", false, true]; // force vehicles to be unlocked
      _vehicle setVariable ["R3F_LOG_disabled", true, true]; // force vehicles to be locked
      [_vehicle, _aiGroup] spawn checkMissionVehicleLock; // force vehicles to be locked

      _vehicle
   };

   _aiGroup = createGroup CIVILIAN;

   //_pos = getMarkerPos (_town select 0);
   _rad = _town select 0;
   _vehiclePosArray = [_missionPos,_rad,_rad + 50,5,0,0,0] call findSafePos;
   /*_vPos1 = _vehiclePosArray select 0;
   _vPos2 = _vehiclePosArray select 1;
   _vPos3 = _vehiclePosArray select 2;
   _vehiclePos1 = [_vPos1 + 5, _vPos2 + 5, _vPos3];
   _vehiclePos2 = [_vPos1 + 10, _vPos2 + 10, _vPos3];
   _vehiclePos3 = [_vPos1 + 15, _vPos2 + 15, _vPos3];
 -   _vehiclePos4 = [_vPos1 + 20, _vPos2 + 20, _vPos3];*/

   _vehicles =
   [
      [_veh1, _vehiclePosArray, 0] call _createVehicle,
      [_veh2, _vehiclePosArray, 0] call _createVehicle,
      [_veh3, _vehiclePosArray, 0] call _createVehicle,
      [_veh4, _vehiclePosArray, 0] call _createVehicle,
      [_veh5, _vehiclePosArray, 0] call _createVehicle
   ];

   _leader = effectiveCommander (_vehicles select 0);
   _aiGroup selectLeader _leader;
   _leader setRank "LIEUTENANT";

   _aiGroup setCombatMode "RED"; // units will defend themselves
   _aiGroup setBehaviour "COMBAT"; // units feel safe until they spot an enemy or get into contact
   _aiGroup setFormation "FILE";

   _speedMode = if (missionDifficultyHard) then { "NORMAL" } else { "LIMITED" };
   _aiGroup setSpeedMode _speedMode;

   {
      _waypoint = _aiGroup addWaypoint [markerPos (_x select 0), 0];
      _waypoint setWaypointType "MOVE";
      _waypoint setWaypointCompletionRadius 50;
      _waypoint setWaypointCombatMode "RED";
      _waypoint setWaypointBehaviour "COMBAT"; // safe is the best behaviour to make AI follow roads, as soon as they spot an enemy or go into combat they WILL leave the road for cover though!
      _waypoint setWaypointFormation "FILE";
      _waypoint setWaypointSpeed _speedMode;
   } forEach ((call cityList) call BIS_fnc_arrayShuffle);

   _missionPos = getPosATL leader _aiGroup;

   _missionPicture = getText (configFile >> "CfgVehicles" >> _veh2 >> "picture");
   _vehicleName = getText (configFile >> "CfgVehicles" >> _veh2 >> "displayName");
   _vehicleName2 = getText (configFile >> "CfgVehicles" >> _veh3 >> "displayName");
   _vehicleName3 = getText (configFile >> "CfgVehicles" >> _veh4 >> "displayName");

   _missionHintText = format ["Um comboio contendo pelo menos <t color='%4'>%1</t>, um <t color='%4'>%2</t> e um <t color='%4'>%3</t> esta patrulhando o Mapa! Pare a patrulha e capture as mercadorias e dinheiro!", _vehicleName, _vehicleName2, _vehicleName3, patrolMissionColor];

   _numWaypoints = count waypoints _aiGroup;
};

_waitUntilMarkerPos = {getPosATL _leader};
_waitUntilExec = nil;
_waitUntilCondition = {currentWaypoint _aiGroup >= _numWaypoints};

_failedExec =
{
   // Mission failed
   { deleteVehicle _x };
};

// _vehicles are automatically deleted or unlocked in missionProcessor depending on the outcome
_drop_item =
{
   private["_item", "_pos"];
   _item = _this select 0;
   _pos = _this select 1;

   if (isNil "_item" || {typeName _item != typeName [] || {count(_item) != 2}}) exitWith {};
   if (isNil "_pos" || {typeName _pos != typeName [] || {count(_pos) != 3}}) exitWith {};

   private["_id", "_class"];
   _id = _item select 0;
   _class = _item select 1;

   private["_obj"];
   _obj = createVehicle [_class, _pos, [], 5, "None"];
   _obj setPos ([_pos, [[2 + random 3,0,0], random 360] call BIS_fnc_rotateVector2D] call BIS_fnc_vectorAdd);
   _obj setVariable ["mf_item_id", _id, true];
};

_successExec =
{
   // Mission completed

   /*for "_x" from 1 to 10 do
   {
      _cash = "Land_Money_F" createVehicle markerPos _marker;
      _cash setPos ((markerPos _marker) vectorAdd ([[2 + random 2,0,0], random 360] call BIS_fnc_rotateVector2D));
      _cash setDir random 360;
      _cash setVariable["cmoney",15000,true];
      _cash setVariable["owner","world",true];
   };*/

   _box1 = "Box_NATO_Support_F" createVehicle getMarkerPos _marker;
    [_box1,"Ammo_Drop"] call randomCrateLoadOut;
      _box1 setVariable ["moveable", true, true];
   _box1 allowDamage false;

   _box2 = "Box_NATO_Wps_F" createVehicle getMarkerPos _marker;
    [_box2,"mission_USSpecial"] call randomCrateLoadOut;
      _box2 setVariable ["moveable", true, true];
   _box2 allowDamage false;

   _box3 = "Box_NATO_Support_F" createVehicle getMarkerPos _marker;
    [_box3,"mission_snipers"] call randomCrateLoadOut;
      _box3 setVariable ["moveable", true, true];
   _box3 allowDamage false;

   _successHintMessage = "Very Goob";
};

_this call patrolMissionsProcessor;