Coastal convoy problem

Coastal convoy problem

« posted: Apr 05, 2022, 11:12 AM »
I use the vanillia mission, I just edit the convoy path and change classnames for vehicles but I have this error:

Quote
10:20:23 Error in expression <0;
};

_vehicle = createVehicle [_type, _position, [], 0, "FLY"];
_vehicle setVa>
10:20:23   Error position: <_position, [], 0, "FLY"];
_vehicle setVa>
10:20:23   Error Undefined variable in expression: _position
10:20:23 File mpmissions\__cur_mp.cup_chernarus_A3\server\missions\occupationMissions\mission_Coastal_Convoy.sqf..., line 60

in mission file:

Quote
_setupObjects =
{
   private ["_starts", "_startDirs", "_waypoints"];
   call compile preprocessFileLineNumbers format ["mapConfig\convoys\%1.sqf", _missionLocation];

   _vehChoices =
   [
      ["pook_PBR_GUNBOAT_GUE", "pook_PBR_GUNBOAT_GUE"],
      ["pook_SOCR_M2_INDFOR", "pook_SOCR_M2_INDFOR"],
      ["pook_SOCR_H_M2_CDF_IND", "pook_SOCR_H_M2_CDF_IND"]
   ];

   if (missionDifficultyHard) then
   {
      (_vehChoices select 0) set [1, "CUP_O_Mi8_CHDKZ"];
      (_vehChoices select 1) set [1, "CUP_O_UH1H_SLA"];
      (_vehChoices select 2) set [1, "CUP_O_UH1H_SLA"];
   };

   _convoyVeh = _vehChoices call BIS_fnc_selectRandom;

   _veh1 = _convoyVeh select 0;
   _veh2 = _convoyVeh select 1;
   _veh3 = _convoyVeh select 0;

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

      _type = _this select 0;
      _position = _this select 1;
      _direction = _this select 2;
      _variant = _type param [1,"",[""]];

      if (_type isEqualType []) then
      {
         _type = _type select 0;
      };

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

      if (_variant != "") then
      {
         _vehicle setVariable ["A3W_vehicleVariant", _variant, true];
      };

      [_vehicle] call vehicleSetup;


I really don't undertstand what can be wrong ... :(

Re: Coastal convoy problem

« Reply #1 posted: Apr 05, 2022, 11:34 AM »
Maybe this:

Quote
_convoyVeh = _vehChoices call BIS_fnc_selectRandom;

   _veh1 = _convoyVeh select 0;
   _veh2 = _convoyVeh select 1;
   _veh3 = _convoyVeh select 0;


Could be this ? :

Quote
_convoyVeh = _vehChoices call BIS_fnc_selectRandom;

   _veh1 = _convoyVeh select 0;
   _veh2 = _convoyVeh select 1;
   _veh3 = _convoyVeh select 2;

Re: Coastal convoy problem

« Reply #2 posted: Apr 05, 2022, 06:00 PM »
this line mean missions listed are desactivated?

Quote
MainMissions = [MainMissions, [["A3W_heliPatrolMissions", ["mission_Coastal_Convoy", "mission_HostileHeliFormation"]], ["A3W_underWaterMissions", ["mission_ArmedDiversquad"]]]] call removeDisabledMissions;
  • Offline LeonZ
  • github.com/LeonZ2019/Lucky-s-Wasteland-Server
  • First Blood
  • ***
  • Posts: 71

Re: Coastal convoy problem

« Reply #3 posted: Apr 05, 2022, 08:36 PM »
Show the whole mission file, the little info is missing
LeonZ#1848 on Discord

Re: Coastal convoy problem

« Reply #4 posted: Apr 05, 2022, 08:50 PM »
i found the problem:

here:
Quote
[
      ["pook_PBR_GUNBOAT_GUE", "pook_PBR_GUNBOAT_GUE"],
      ["pook_SOCR_M2_INDFOR", "pook_SOCR_M2_INDFOR"],
      ["pook_SOCR_H_M2_CDF_IND", "pook_SOCR_H_M2_CDF_IND"]
   ];

it seems he waiting a chopper at the second choice, so i put choppers here and it's ok now

Quote
_vehChoices =
   [
      ["pook_PBR_GUNBOAT_GUE", "CUP_O_Mi8_CHDKZ"],
      ["pook_SOCR_M2_INDFOR", "CUP_O_UH1H_SLA"],
      ["pook_SOCR_H_M2_CDF_IND", "CUP_O_UH1H_SLA"]
   ];

Re: Coastal convoy problem

« Reply #5 posted: Apr 06, 2022, 11:50 AM »
Help!!! Error with _position again ...

Quote
10:20:23 Error in expression <0;
};

_vehicle = createVehicle [_type, _position, [], 0, "FLY"];
_vehicle setVa>
10:20:23   Error position: <_position, [], 0, "FLY"];
_vehicle setVa>
10:20:23   Error Undefined variable in expression: _position
10:20:23 File mpmissions\__cur_mp.cup_chernarus_A3\server\missions\occupationMissions\mission_Coastal_Convoy.sqf..., line 60


I only change/add this:

Quote
switch (true) do
      {
         case (_type isKindOf "pook_PBR_GUNBOAT_GUE"):
         {
            // these choppers have 2 turrets so we need 2 gunners
            _soldier = [_aiGroup, _position] call createRandomSoldier;
            _soldier moveInTurret [_vehicle, [1]];

            _soldier = [_aiGroup, _position] call createRandomSoldier;
            _soldier moveInTurret [_vehicle, [2]];
            
            _soldier = [_aiGroup, _position] call createRandomSoldier;
            _soldier moveInTurret [_vehicle, [3]];
         };
         
         case (_type isKindOf "pook_SOCR_M2_INDFOR"):
         {
            // these choppers have 2 turrets so we need 2 gunners
            _soldier = [_aiGroup, _position] call createRandomSoldier;
            _soldier moveInTurret [_vehicle, [1]];

            _soldier = [_aiGroup, _position] call createRandomSoldier;
            _soldier moveInTurret [_vehicle, [2]];
            
            _soldier = [_aiGroup, _position] call createRandomSoldier;
            _soldier moveInTurret [_vehicle, [3]];
            
            _soldier = [_aiGroup, _position] call createRandomSoldier;
            _soldier moveInTurret [_vehicle, [4]];
         };
         
         case (_type isKindOf "pook_SOCR_H_M2_CDF_IND"):
         {
            // these choppers have 2 turrets so we need 2 gunners
            _soldier = [_aiGroup, _position] call createRandomSoldier;
            _soldier moveInTurret [_vehicle, [1]];

            _soldier = [_aiGroup, _position] call createRandomSoldier;
            _soldier moveInTurret [_vehicle, [2]];
            
            _soldier = [_aiGroup, _position] call createRandomSoldier;
            _soldier moveInTurret [_vehicle, [3]];
            
            _soldier = [_aiGroup, _position] call createRandomSoldier;
            _soldier moveInTurret [_vehicle, [4]];
         };

         case (_type isKindOf "CUP_O_UH1H_SLA"):
         {
            // these choppers have 2 turrets so we need 2 gunners
            _soldier = [_aiGroup, _position] call createRandomSoldier;
            _soldier moveInTurret [_vehicle, [1]];

            _soldier = [_aiGroup, _position] call createRandomSoldier;
            _soldier moveInTurret [_vehicle, [2]];
         };
         
         case (_type isKindOf "CUP_O_Mi8_CHDKZ"):
         {
            // these choppers have 2 turrets so we need 2 gunners
            _soldier = [_aiGroup, _position] call createRandomSoldier;
            _soldier moveInTurret [_vehicle, [1]];

            _soldier = [_aiGroup, _position] call createRandomSoldier;
            _soldier moveInTurret [_vehicle, [2]];
         };
  • Offline LeonZ
  • github.com/LeonZ2019/Lucky-s-Wasteland-Server
  • First Blood
  • ***
  • Posts: 71

Re: Coastal convoy problem

« Reply #6 posted: Apr 06, 2022, 02:29 PM »
alright, problem is from your new convoy path which is located at "mapConfig\convoys\CoastalConvoy_x.sqf" check if missing _starts array
LeonZ#1848 on Discord

Re: Coastal convoy problem

« Reply #7 posted: Apr 06, 2022, 03:06 PM »
ok I see and fix it, you're right, i put only one start position and only one direction...

with 3 start and direction positions it works fine ;)

Thanks for help!!!