Money shipment

  • Offline TRI$
  • Fresh Spawn
  • *
  • Posts: 2

Money shipment

« posted: Feb 18, 2023, 02:17 AM »
i'm trying to change the vehicles that spawn with in the mission, but for example i change

["B_MRAP_01_hmg_F", "B_MRAP_01_gmg_F"], // Veh 1
["B_MRAP_01_hmg_F", "B_MRAP_01_gmg_F"] // Veh 2

to

["B_Truck_01_box_F", "B_Truck_01_box_F"], // Veh 1
["B_Truck_01_box_F", "B_Truck_01_box_F"] // Veh 2

it wont start the mission,
is there another file where i need to change what vehicles can spawn in a mission?

Re: Money shipment

« Reply #1 posted: Feb 18, 2023, 06:19 AM »
No.
Maybe show the complete mission code?
  • Offline TRI$
  • Fresh Spawn
  • *
  • Posts: 2

Re: Money shipment

« Reply #2 posted: Feb 18, 2023, 12:55 PM »
No.
Maybe show the complete mission code?


// ******************************************************************************************
// * This project is licensed under the GNU Affero GPL v3. Copyright © 2014 A3Wasteland.com *
// ******************************************************************************************
//   @file Version: 2.1
//   @file Name: mission_MoneyShipment.sqf
//   @file Author: JoSchaap / routes by Del1te - (original idea by Sanjo), AgentRev
//   @file Created: 31/08/2013 18:19

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

private ["_MoneyShipment", "_moneyAmount", "_convoys", "_vehChoices", "_moneyText", "_vehClasses", "_createVehicle", "_vehicles", "_veh2", "_leader", "_speedMode", "_waypoint", "_vehicleName", "_numWaypoints", "_cash"];

_setupVars =
{
   _locationsArray = LandConvoyPaths;

   // Money Shipments settings
   // Difficulties : Min = 1, Max = infinite
   // Convoys per difficulty : Min = 1, Max = infinite
   // Vehicles per convoy : Min = 1, Max = infinite
   // Choices per vehicle : Min = 1, Max = infinite
   _MoneyShipment =
   [
      // Easy
      [
         "Small Money Shipment", // Marker text
         250000, // Money
         [
            [ // NATO convoy
               ["C_Hatchback_01_sport_F", "C_SUV_01_F"], // Veh 1
               ["C_SUV_01_F", "C_Hatchback_01_sport_F"] // Veh 2
            ],
            [ // CSAT convoy
               ["C_Hatchback_01_sport_F", "C_SUV_01_F"], // Veh 1
               ["C_SUV_01_F", "C_Hatchback_01_sport_F"] // Veh 2
            ],
            [ // AAF convoy
               ["C_Hatchback_01_sport_F", "C_SUV_01_F"], // Veh 1
               ["C_SUV_01_F", "C_Hatchback_01_sport_F"] // Veh 2
            ]
         ]
      ],
      // Medium
      [
         "Medium Money Shipment", // Marker text
         500000, // Money
         [
            [ // NATO convoy
               ["B_MRAP_01_hmg_F", "B_MRAP_01_gmg_F"], // Veh 1
               ["B_APC_Wheeled_01_cannon_F", "B_APC_Tracked_01_rcws_F", "B_APC_Tracked_01_AA_F"], // Veh 2
               ["B_MRAP_01_hmg_F", "B_MRAP_01_gmg_F"] // Veh 3
            ],
            [ // CSAT convoy
               ["O_MRAP_02_hmg_F", "O_MRAP_02_gmg_F"], // Veh 1
               ["O_APC_Wheeled_02_rcws_F", "O_APC_Tracked_02_cannon_F", "O_APC_Tracked_02_AA_F"], // Veh 2
               ["O_MRAP_02_hmg_F", "O_MRAP_02_gmg_F"] // Veh 3
            ],
            [ // AAF convoy
               ["I_MRAP_03_hmg_F", "I_MRAP_03_gmg_F"], // Veh 1
               ["I_APC_Wheeled_03_cannon_F", "I_APC_tracked_03_cannon_F"], // Veh 2
               ["I_MRAP_03_hmg_F", "I_MRAP_03_gmg_F"] // Veh 3
            ]
         ]
      ],
      // Hard
      [
         "Large Money Shipment", // Marker text
         750000, // Money
         [
            [ // NATO convoy
               ["B_APC_Wheeled_01_cannon_F", "B_APC_Tracked_01_rcws_F", "B_APC_Tracked_01_AA_F"], // Veh 1
               ["B_MBT_01_cannon_F", "B_MBT_01_TUSK_F"], // Veh 2
               ["B_APC_Wheeled_01_cannon_F", "B_APC_Tracked_01_rcws_F", "B_APC_Tracked_01_AA_F"] // Veh 3
            ],
            [ // CSAT convoy
               ["O_APC_Wheeled_02_rcws_F", "O_APC_Tracked_02_cannon_F", "O_APC_Tracked_02_AA_F"], // Veh 1
               ["O_MBT_02_cannon_F"], // Veh 2
               ["O_APC_Wheeled_02_rcws_F", "O_APC_Tracked_02_cannon_F", "O_APC_Tracked_02_AA_F"] // Veh 3
            ],
            [ // AAF convoy
               ["I_APC_Wheeled_03_cannon_F", "I_APC_tracked_03_cannon_F"], // Veh 1
               ["I_MBT_03_cannon_F"], // Veh 2
               ["I_APC_Wheeled_03_cannon_F", "I_APC_tracked_03_cannon_F"] // Veh 3
            ]
         ]
      ],
      // Extreme
      [
         "Heavy Money Shipment", // Marker text
         1000000, // Money
         [
            [ // NATO convoy
               ["B_APC_Wheeled_01_cannon_F", "B_APC_Tracked_01_rcws_F", "B_APC_Tracked_01_AA_F", "B_MBT_01_cannon_F", "B_MBT_01_TUSK_F"], // Veh 1
               ["B_APC_Tracked_01_AA_F", "B_MBT_01_cannon_F", "B_MBT_01_TUSK_F"], // Veh 2
               ["B_APC_Wheeled_01_cannon_F", "B_APC_Tracked_01_rcws_F", "B_APC_Tracked_01_AA_F", "B_MBT_01_cannon_F", "B_MBT_01_TUSK_F"], // Veh 3
               ["B_APC_Wheeled_01_cannon_F", "B_APC_Tracked_01_rcws_F", "B_APC_Tracked_01_AA_F", "B_MBT_01_cannon_F", "B_MBT_01_TUSK_F"] // Veh 4
            ],
            [ // CSAT convoy
               ["O_APC_Wheeled_02_rcws_F", "O_APC_Tracked_02_cannon_F", "O_APC_Tracked_02_AA_F", "O_MBT_02_cannon_F"], // Veh 1
               ["O_APC_Tracked_02_AA_F", "O_MBT_02_cannon_F"], // Veh 2
               ["O_APC_Wheeled_02_rcws_F", "O_APC_Tracked_02_cannon_F", "O_APC_Tracked_02_AA_F", "O_MBT_02_cannon_F"], // Veh 3
               ["O_APC_Wheeled_02_rcws_F", "O_APC_Tracked_02_cannon_F", "O_APC_Tracked_02_AA_F", "O_MBT_02_cannon_F"] // Veh 4
            ],
            [ // AAF convoy
               ["I_APC_Wheeled_03_cannon_F", "I_APC_tracked_03_cannon_F", "I_MBT_03_cannon_F"], // Veh 1
               ["I_APC_tracked_03_cannon_F", "I_MBT_03_cannon_F"], // Veh 2
               ["I_APC_Wheeled_03_cannon_F", "I_APC_tracked_03_cannon_F", "I_MBT_03_cannon_F"], // Veh 3
               ["I_APC_Wheeled_03_cannon_F", "I_APC_tracked_03_cannon_F", "I_MBT_03_cannon_F"] // Veh 4
            ]
         ]
      ]
   ]
   call BIS_fnc_selectRandom;

   _missionType = _MoneyShipment select 0;
   _moneyAmount = _MoneyShipment select 1;
   _convoys = _MoneyShipment select 2;
   _vehChoices = _convoys call BIS_fnc_selectRandom;

   _moneyText = format ["$%1", [_moneyAmount] call fn_numbersText];

   _vehClasses = [];
   { _vehClasses pushBack (_x call BIS_fnc_selectRandom) } forEach _vehChoices;
};

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

   _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 setVariable ["R3F_LOG_disabled", true, true];
      [_vehicle] call vehicleSetup;

      _vehicle setDir _direction;
      _aiGroup addVehicle _vehicle;

      _soldier = [_aiGroup, _position] call createRandomSoldier;
      _soldier moveInDriver _vehicle;

      _soldier = [_aiGroup, _position] call createRandomSoldier;
      _soldier moveInCargo [_vehicle, 0];

      if !(_type isKindOf "Truck_F") then
      {
         _soldier = [_aiGroup, _position] call createRandomSoldier;
         _soldier moveInGunner _vehicle;

         _soldier = [_aiGroup, _position] call createRandomSoldier;

         if (_vehicle emptyPositions "commander" > 0) then
         {
            _soldier moveInCommander _vehicle;
         }
         else
         {
            _soldier moveInCargo [_vehicle, 1];
         };
      };

      [_vehicle, _aiGroup] spawn checkMissionVehicleLock;

      _vehicle
   };

   _aiGroup = createGroup CIVILIAN;

   _vehicles = [];
   {
      _vehicles pushBack ([_x, _starts select 0, _startdirs select 0, _aiGroup] call _createVehicle);
   } forEach _vehClasses;

   _veh2 = _vehClasses select (1 min (count _vehClasses - 1));

   _leader = effectiveCommander (_vehicles select 0);
   _aiGroup selectLeader _leader;

   _aiGroup setCombatMode "GREEN"; // units will defend themselves
   _aiGroup setBehaviour "SAFE"; // units feel safe until they spot an enemy or get into contact
   _aiGroup setFormation "STAG COLUMN";

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

   _aiGroup setSpeedMode _speedMode;

   {
      _waypoint = _aiGroup addWaypoint [_x, 0];
      _waypoint setWaypointType "MOVE";
      _waypoint setWaypointCompletionRadius 25;
      _waypoint setWaypointCombatMode "GREEN";
      _waypoint setWaypointBehaviour "SAFE"; // 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 "STAG COLUMN";
      _waypoint setWaypointSpeed _speedMode;
   } forEach _waypoints;

   _missionPos = getPosATL leader _aiGroup;

   _missionPicture = getText (configFile >> "CfgVehicles" >> _veh2 >> "picture");
   _vehicleName = getText (configFile >> "cfgVehicles" >> _veh2 >> "displayName");

   _missionHintText = format ["A convoy transporting <t color='%1'>%2</t> escorted by a <t color='%1'>%3</t> is en route to an unknown location.<br/>Stop them!", moneyMissionColor, _moneyText, _vehicleName];

   _numWaypoints = count waypoints _aiGroup;
};

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

_failedExec = nil;

// _vehicles are automatically deleted or unlocked in missionProcessor depending on the outcome

_successExec =
{
   // Mission completed

   for "_i" from 1 to 10 do
   {
      _cash = createVehicle ["Land_Money_F", _lastPos, [], 5, "None"];
      _cash setPos ([_lastPos, [[2 + random 3,0,0], random 360] call BIS_fnc_rotateVector2D] call BIS_fnc_vectorAdd);
      _cash setDir random 360;
      _cash setVariable ["cmoney", _moneyAmount / 10, true];
      _cash setVariable ["owner", "world", true];
   };

   _successHintMessage = "The convoy has been stopped, the money and vehicles are now yours to take.";
};

_this call moneyMissionProcessor;

Re: Money shipment

« Reply #3 posted: Feb 18, 2023, 02:33 PM »
Hm, have u changed this part?

yours:

Code: [Select]
if !(_type isKindOf "Truck_F") then
      {
         _soldier = [_aiGroup, _position] call createRandomSoldier;
         _soldier moveInGunner _vehicle;

         _soldier = [_aiGroup, _position] call createRandomSoldier;

         if (_vehicle emptyPositions "commander" > 0) then
         {
            _soldier moveInCommander _vehicle;
         }
         else
         {
            _soldier moveInCargo [_vehicle, 1];
         };
      };

      [_vehicle, _aiGroup] spawn checkMissionVehicleLock;

      _vehicle
   };

original

Code: [Select]
if !(_type isKindOf "LT_01_base_F") then
{
_soldier = [_aiGroup, _position] call createRandomSoldier;
_soldier moveInCargo [_vehicle, 0];
};

if !(_type isKindOf "Truck_F") then
{
_soldier = [_aiGroup, _position] call createRandomSoldier;
_soldier moveInGunner _vehicle;
if (_type isKindOf "LT_01_base_F") exitWith {};

_soldier = [_aiGroup, _position] call createRandomSoldier;

if (_vehicle emptyPositions "commander" > 0) then
{
_soldier moveInCommander _vehicle;
}
else
{
_soldier moveInCargo [_vehicle, 1];
};
};

[_vehicle, _aiGroup] spawn checkMissionVehicleLock;

_vehicle
};

Re: Money shipment

« Reply #4 posted: Feb 19, 2023, 09:44 AM »
Hm, have u changed this part?

yours:

Code: [Select]
if !(_type isKindOf "Truck_F") then
      {
         _soldier = [_aiGroup, _position] call createRandomSoldier;
         _soldier moveInGunner _vehicle;

         _soldier = [_aiGroup, _position] call createRandomSoldier;

         if (_vehicle emptyPositions "commander" > 0) then
         {
            _soldier moveInCommander _vehicle;
         }
         else
         {
            _soldier moveInCargo [_vehicle, 1];
         };
      };

      [_vehicle, _aiGroup] spawn checkMissionVehicleLock;

      _vehicle
   };

original

Code: [Select]
if !(_type isKindOf "LT_01_base_F") then
{
_soldier = [_aiGroup, _position] call createRandomSoldier;
_soldier moveInCargo [_vehicle, 0];
};

if !(_type isKindOf "Truck_F") then
{
_soldier = [_aiGroup, _position] call createRandomSoldier;
_soldier moveInGunner _vehicle;
if (_type isKindOf "LT_01_base_F") exitWith {};

_soldier = [_aiGroup, _position] call createRandomSoldier;

if (_vehicle emptyPositions "commander" > 0) then
{
_soldier moveInCommander _vehicle;
}
else
{
_soldier moveInCargo [_vehicle, 1];
};
};

[_vehicle, _aiGroup] spawn checkMissionVehicleLock;

_vehicle
};

probably bcz he changed vehicle which doesnt have a "gunner" seat and still saying that soldier should move into guner seat.
That could be reason why it wont start. (but i doubt it)

and "-showScriptErrors" doesnt say anthing?
it should pop up the msg with problematic line
  • Offline LeonZ
  • github.com/LeonZ2019/Lucky-s-Wasteland-Server
  • First Blood
  • ***
  • Posts: 77

Re: Money shipment

« Reply #5 posted: Feb 19, 2023, 02:45 PM »
Problem could be in line 113 and 114, try change from this code
Code: [Select]
   ]
   call BIS_fnc_selectRandom;

change to this code
Code: [Select]
   ] call BIS_fnc_selectRandom;
LeonZ#1848 on Discord