Creating Mission

Creating Mission

« posted: Feb 16, 2018, 12:52 AM »
I do not know if I'm correct


I want to create a mission, 5 vans and in each one 10 bots carrying values


using the same moneyshipment edition


I tried to run and it does not run, where am I going wrong?



// ******************************************************************************************
// * This project is licensed under the GNU Affero GPL v3. Copyright © 2014 A3Wasteland.com *
// ******************************************************************************************
//   @file Version: 2.1
//   @file Name: mission_Transportvalores.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 =
   [
      // Extreme
      [
         "Transporte de Valores", // Marker text
         150000, // Money
         [
            [ // Van convoy
               ["C_Van_02_transport_F"], // Veh 1
               ["C_Van_02_transport_F"], // Veh 2
               ["C_Van_02_transport_F"], // Veh 3
               ["C_Van_02_transport_F"], // Veh 4
               ["C_Van_02_transport_F"], // Veh 5               
            ]
         ]
        ]
   ]
   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];

   _veh1 = _convoyVeh select 0;
   _veh2 = _convoyVeh select 1;
   _veh3 = _convoyVeh select 2;
   _veh4 = _convoyVeh select 3;
   _veh5 = _convoyVeh select 4;
   
   _createVehicle1 =
   {
      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;
      _soldier = [_aiGroup, _position] call createRandomSoldier;
      _soldier moveInCargo [_vehicle, 0];
      _soldier = [_aiGroup, _position] call createRandomSoldier;
      _soldier moveInCargo [_vehicle, 0];
      _soldier = [_aiGroup, _position] call createRandomSoldier;
      _soldier moveInCargo [_vehicle, 0];
      _vehicle setVehicleLock "UNLOCKED";  // force vehicles to be unlocked
      _vehicle setVariable ["R3F_LOG_disabled", false, true]; // force vehicles to be unlocked
      _vehicle
    };
   
      _createVehicle2 =
   {
      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;
      _soldier = [_aiGroup, _position] call createRandomSoldier;
      _soldier moveInCargo [_vehicle, 0];
      _soldier = [_aiGroup, _position] call createRandomSoldier;
      _soldier moveInCargo [_vehicle, 0];
      _soldier = [_aiGroup, _position] call createRandomSoldier;
      _soldier moveInCargo [_vehicle, 0];
      _vehicle setVehicleLock "UNLOCKED";  // force vehicles to be unlocked
      _vehicle setVariable ["R3F_LOG_disabled", false, true]; // force vehicles to be unlocked
      _vehicle
    };
   
      _createVehicle3 =
   {
      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;
      _soldier = [_aiGroup, _position] call createRandomSoldier;
      _soldier moveInCargo [_vehicle, 0];
      _soldier = [_aiGroup, _position] call createRandomSoldier;
      _soldier moveInCargo [_vehicle, 0];
      _soldier = [_aiGroup, _position] call createRandomSoldier;
      _soldier moveInCargo [_vehicle, 0];
      _vehicle setVehicleLock "UNLOCKED";  // force vehicles to be unlocked
      _vehicle setVariable ["R3F_LOG_disabled", false, true]; // force vehicles to be unlocked
      _vehicle
    };
   
      _createVehicle4 =
   {
      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;
      _soldier = [_aiGroup, _position] call createRandomSoldier;
      _soldier moveInCargo [_vehicle, 0];
      _soldier = [_aiGroup, _position] call createRandomSoldier;
      _soldier moveInCargo [_vehicle, 0];
      _soldier = [_aiGroup, _position] call createRandomSoldier;
      _soldier moveInCargo [_vehicle, 0];
      _vehicle setVehicleLock "UNLOCKED";  // force vehicles to be unlocked
      _vehicle setVariable ["R3F_LOG_disabled", false, true]; // force vehicles to be unlocked
      _vehicle
    };
   
      _createVehicle5 =
   {
      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;
      _soldier = [_aiGroup, _position] call createRandomSoldier;
      _soldier moveInCargo [_vehicle, 0];
      _soldier = [_aiGroup, _position] call createRandomSoldier;
      _soldier moveInCargo [_vehicle, 0];
      _soldier = [_aiGroup, _position] call createRandomSoldier;
      _soldier moveInCargo [_vehicle, 0];
      _vehicle setVehicleLock "UNLOCKED";  // force vehicles to be unlocked
      _vehicle setVariable ["R3F_LOG_disabled", false, true]; // force vehicles to be unlocked
      _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 "YELLOW"; // 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 "YELLOW";
      _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 ["Prossegur transportando uma grande quantidade de valores!", 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 = "A recompensa é sua.";
};

_this call moneyMissionProcessor;

  • Offline ShineDwarf
  • First Blood
  • ***
  • Posts: 79
  • Co-Owner, Fractured Gaming

Re: Creating Mission

« Reply #1 posted: Feb 16, 2018, 01:46 AM »
This, is the basic money mission:

Code: [Select]
// ******************************************************************************************
// * 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
[
"Light Money Shipment", // Marker text
100000, // Money
[
[ // NATO convoy
["B_MRAP_01_hmg_F", "B_MRAP_01_gmg_F"], // Veh 1
["B_MRAP_01_hmg_F", "B_MRAP_01_gmg_F"] // Veh 2
],
[ // CSAT convoy
["O_MRAP_02_hmg_F", "O_MRAP_02_gmg_F"], // Veh 1
["O_MRAP_02_hmg_F", "O_MRAP_02_gmg_F"] // Veh 2
],
[ // AAF convoy
["I_MRAP_03_hmg_F", "I_MRAP_03_gmg_F"], // Veh 1
["I_MRAP_03_hmg_F", "I_MRAP_03_gmg_F"] // Veh 2
]
]
],
// Medium
[
"Medium Money Shipment", // Marker text
150000, // 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
200000, // 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
250000, // 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 "YELLOW"; // 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 "YELLOW";
_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;

Each convoy is set to be chosen as a random convoy within their own array:

i.e

Code: [Select]
[ // 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
],

Will choose one vehicle @random from each of the arrays within the "Nato Convoy" array in this case 4 vehicles total..

if you added an additional selection

Code: [Select]
[ // 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
["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 5
],

It would add a 5th vehicle, without need to edit anymore below these options.

It looks like you mashed moneymission with another convoy mission in the hopes theydd work together. It would be easier for you to set up 1-2 convoys for the system to select (like normal money mission has), and let the default code do its work after you've adjusted how many units per vehicle, mission text, etc.


Also for units. Moneymission spawns in a set of units for each vehicle without you needing to repeat the code for each, it checks how many vehicles and just spawns a set in for each so...

Code: [Select]
_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];
};
};

You only need to add additional cargo solders here. as opposed to a separate section for each vehicle, since they  will all mostly be the same vehicle. If the vehicle cant hold the amount, i believe the extra still spawn on foot.

Im no where near the best at explaining things, but hopefully that points you in a better direction.
  • Offline ShineDwarf
  • First Blood
  • ***
  • Posts: 79
  • Co-Owner, Fractured Gaming

Re: Creating Mission

« Reply #2 posted: Feb 16, 2018, 02:13 AM »
Try this:

Code: [Select]
// ******************************************************************************************
// * 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 =
[

// Medium
[
"Convoy 1", // Marker text
150000, // Money
[
[ //Convoy
["C_Van_02_transport_F", "C_Van_01_transport_white_F"], // Veh 1
["C_Van_02_transport_F", "C_Van_01_transport_white_F", "C_Van_01_transport_red_F"], // Veh 2
["C_Van_02_transport_F", "C_Van_01_transport_white_F", "C_Van_01_transport_red_F"], // Veh 3
["C_Van_02_transport_F", "C_Van_01_transport_white_F", "C_Van_01_transport_red_F"], // Veh 4
["C_Van_02_transport_F", "C_Van_01_transport_white_F"] // Veh 5

]
]
],
// Hard
[
"Convoy 2", // Marker text
200000, // Money
[
[ // Convoy
["I_Truck_02_transport_F", "C_Truck_02_transport_F"], // Veh 1
["C_Truck_02_covered_F", "I_Truck_02_covered_F"], // Veh 2
["C_Truck_02_covered_F", "I_Truck_02_covered_F"], // Veh 3
["C_Truck_02_covered_F", "I_Truck_02_covered_F"], // Veh 4
["I_Truck_02_transport_F", "C_Truck_02_transport_F"] // Veh 5
]
]
]

]
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];

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

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

_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 "YELLOW"; // 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 "YELLOW";
_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;

You'll have to ensure the name is right, and update your mission text, but that should choose between the 2 convoys listed each time the mission spawns, then select a vehicle for each line of that convoy.

you'll also need to adjust the amount of soldiers which spawn to your liking.

If it doesnt work, sorry in advance. I'm at work and only have notepad available atm to use. It should give you a better outline though than what you started with

Re: Creating Mission

« Reply #3 posted: Feb 17, 2018, 07:27 PM »
the mission does not start
  • Offline ShineDwarf
  • First Blood
  • ***
  • Posts: 79
  • Co-Owner, Fractured Gaming

Re: Creating Mission

« Reply #4 posted: Feb 17, 2018, 11:19 PM »
Whats the error from your rpt log?

Re: Creating Mission

« Reply #5 posted: Feb 19, 2018, 05:24 PM »
Whats the error from your rpt log?





It does not generate a RPT error.
  • Offline ShineDwarf
  • First Blood
  • ***
  • Posts: 79
  • Co-Owner, Fractured Gaming

Re: Creating Mission

« Reply #6 posted: Feb 20, 2018, 07:33 PM »
Did you name it properly in setupMissionArrays.sqf? I had no issues loading it on our test server.

Re: Creating Mission

« Reply #7 posted: Feb 20, 2018, 08:33 PM »
Did you name it properly in setupMissionArrays.sqf? I had no issues loading it on our test server.


Yes, I did.
  • Offline ShineDwarf
  • First Blood
  • ***
  • Posts: 79
  • Co-Owner, Fractured Gaming

Re: Creating Mission

« Reply #8 posted: Feb 20, 2018, 09:52 PM »
Youll have to post your server rpt logs then. My code spawned 5 vehicles each loaded with troops.

Other then you not having landconvoypaths set. Or not waiting long enough for that specific mission im not sure what it would be

Re: Creating Mission

« Reply #9 posted: Feb 22, 2018, 11:02 PM »
Youll have to post your server rpt logs then. My code spawned 5 vehicles each loaded with troops.

Other then you not having landconvoypaths set. Or not waiting long enough for that specific mission im not sure what it would be



I left yours and I did not change anything and it is not generating RPT

remembering that I need to change the name of the mission, because I already have a mission of moneyshipment