how to enable flares of missions ?

how to enable flares of missions ?

« posted: Jan 26, 2018, 05:30 PM »

I put this example below if anyone can help me with this question. Thank you




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

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

private ["_vehicleClass", "_vehicle", "_createVehicle", "_vehicles", "_leader", "_speedMode", "_waypoint", "_vehicleName", "_numWaypoints", "_box1", "_box2"];

_setupVars =
{
   _missionType = "Hostile Jet";
   _locationsArray = nil; // locations are generated on the fly from towns
};

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

   _vehicleClass = if (missionDifficultyHard) then
   {
      ["O_Plane_CAS_02_F", "B_Plane_CAS_01_F","O_Plane_CAS_02_F"] call BIS_fnc_selectRandom;
   }
   else
   {
      ["I_Plane_Fighter_03_AA_F", "I_Plane_Fighter_03_CAS_F"] call BIS_fnc_selectRandom;
   };

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

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

      _vehicle = createVehicle [_type, _position, [], 0, "FLY"];
      _vehicle setVariable ["R3F_LOG_disabled", true, true];
      [_vehicle] call vehicleSetup;

      _vehicle setDir _direction;
      _aiGroup addVehicle _vehicle;

      // add a driver/pilot to the vehicle
      _soldier = [_aiGroup, _position] call createRandomSoldierC;
      _soldier moveInDriver _vehicle;

      // remove flares because it overpowers AI
      if (_type isKindOf "Air") then
      {
         {
            if (["CMFlare", _x] call fn_findString != -1) then
            {
               _vehicle removeMagazinesTurret [_x, [-1]];
            };
         } forEach getArray (configFile >> "CfgVehicles" >> _type >> "magazines");
      };

Re: how to enable flares of missions ?

« Reply #1 posted: Jan 27, 2018, 04:20 AM »
Comment the last code block in what you posted there.

// remove flares because it overpowers AI
      if (_type isKindOf "Air") then
      {
         {
            if (["CMFlare", _x] call fn_findString != -1) then
            {
               _vehicle removeMagazinesTurret [_x, [-1]];
            };
         } forEach getArray (configFile >> "CfgVehicles" >> _type >> "magazines");
      };

This is what removes the flares.

Re: how to enable flares of missions ?

« Reply #2 posted: Jan 28, 2018, 06:05 PM »
Comment the last code block in what you posted there.

// remove flares because it overpowers AI
      if (_type isKindOf "Air") then
      {
         {
            if (["CMFlare", _x] call fn_findString != -1) then
            {
               _vehicle removeMagazinesTurret [_x, [-1]];
            };
         } forEach getArray (configFile >> "CfgVehicles" >> _type >> "magazines");
      };

This is what removes the flares.


Thanks