Money Mission issue

Money Mission issue

« posted: Jul 03, 2015, 02:57 PM »
EDITED: My money missions aren't paying out as they should. They pay the amount for the lower shipment. (i.e. Heavy Shipment pays 125,000 that is slated for Large Shipment)
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
[
"Small Money Shipment", // Marker text
50000, // 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
["B_Heli_Light_01_armed_F"] // veh 3
],
[ // 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
["B_Heli_Light_01_armed_F"] // veh 3
],
[ // 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
["B_Heli_Light_01_armed_F"] //veh 3
]
]
],
// Medium
[
"Medium Money Shipment", // Marker text
75000, // 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
["B_Heli_Light_01_armed_F"], // heli 1
["O_Heli_Light_02_F"] // heli 2
],
[ // 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
["B_Heli_Light_01_armed_F"], // heli 1
["O_Heli_Light_02_F"] // heli 2
],
[ // 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
["B_Heli_Light_01_armed_F"], // heli 1
["O_Heli_Light_02_F"] // heli 2
]
]
],
// Hard
[
"Large Money Shipment", // Marker text
125000, // 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
["B_Heli_Light_01_armed_F"],
["O_Heli_Light_02_F"],
["B_Heli_Attack_01_F"]
],
[ // 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
["B_Heli_Light_01_armed_F"],
["O_Heli_Light_02_F"],
["B_Heli_Attack_01_F"]
],
[ // 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
["B_Heli_Light_01_armed_F"],
["O_Heli_Light_02_F"],
["B_Heli_Attack_01_F"]
]
]
],
// 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
["O_Heli_Light_02_F"],
["O_Heli_Light_02_F"],
["B_Heli_Attack_01_F"],
["B_Heli_Attack_01_F"]
],
[ // 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
["O_Heli_Light_02_F"],
["O_Heli_Light_02_F"],
["B_Heli_Attack_01_F"],
["B_Heli_Attack_01_F"]
],
[ // 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
["O_Heli_Light_02_F"],
["O_Heli_Light_02_F"],
["B_Heli_Attack_01_F"],
["B_Heli_Attack_01_F"]
]
]
],
[
"Suicidal Money Shipment", // Marker text
500000, // Money
[
[ // NATO convoy
["O_MBT_02_cannon_F"],
["O_MBT_02_cannon_F"],
["O_MBT_02_cannon_F"],
["O_MBT_02_cannon_F"],
["I_MBT_03_cannon_F"],
["I_MBT_03_cannon_F"],
["O_APC_Tracked_02_AA_F"],
["O_APC_Tracked_02_AA_F"],
["O_Heli_Attack_02_F"],
["O_Heli_Attack_02_F"],
["O_Heli_Attack_02_F"],
["B_Heli_Attack_01_F"],
["B_Heli_Attack_01_F"],
["B_Heli_Attack_01_F"],
["B_Heli_Attack_01_F"]
]
]
]
]
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, [], 200, "FLY"];
_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 "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 "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;
  • Offline LouD
  • Silent but deadly ;)
  • Moderator
  • Veteran
  • ******
  • Posts: 1415

Re: Money Mission issue

« Reply #1 posted: Jul 03, 2015, 03:26 PM »
Err the large money shipment pays 125.000 so thats correct. So whats the problem please?

Re: Money Mission issue

« Reply #2 posted: Jul 03, 2015, 03:44 PM »
Sorry. Heavy paid out 125,000 instead of 250,000

Re: Money Mission issue

« Reply #3 posted: Jul 07, 2015, 06:48 AM »
The Suicidal Shipment isnt running for some reason also