Hey all,
This may be more of a Rev or veteran A3W/Arma coder question I'm working on a mission. I can't seem to get this to work. I'm trying to call "_moneyAmount" from MoneyMissions to a bit for a success exec that me and another guy have been working on. But my problem is, I cannot seem to get the variable "_moneyAmount" to pass outside of the scope of "_setupVars" Function.
If anyone can help me out, it would be great.
The Function:
(I can get _moneyAmount to return a proper value from within the scope)
_setupVars =
{
_MoneyShipment = selectRandom
[
// Easy
[
"Small Smuggler Shipment", // Marker text
60000, 80000, 100000, // Money
[
[ // NATO convoy
["B_MRAP_01_hmg_F", "B_MRAP_01_gmg_F", "O_T_LSV_02_armed_F"], // Veh 1
["B_MRAP_01_hmg_F", "B_MRAP_01_gmg_F", "O_T_LSV_02_armed_F"] // Veh 2
],
[ // CSAT convoy
["O_MRAP_02_hmg_F", "O_MRAP_02_gmg_F", "B_T_LSV_01_armed_F"], // Veh 1
["O_MRAP_02_hmg_F", "O_MRAP_02_gmg_F", "B_T_LSV_01_armed_F"] // Veh 2
],
[ // AAF convoy
["I_MRAP_03_hmg_F", "I_MRAP_03_gmg_F", "I_LT_01_cannon_F"], // Veh 1
["I_MRAP_03_hmg_F", "I_MRAP_03_gmg_F", "I_LT_01_AT_F"] // Veh 2
]
]
],
// Medium
[
"Medium Smuggler Shipment", // Marker text
100000, 120000, 140000, // 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_v2_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", "I_LT_01_cannon_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", "I_LT_01_AT_F"] // Veh 3
]
]
],
// Hard
[
"Large Smuggler Shipment", // Marker text
140000, 160000, 180000, // Money
[
[ // NATO convoy
["B_APC_Wheeled_01_cannon_F", "B_APC_Tracked_01_rcws_F", "B_APC_Tracked_01_AA_F", "B_AFV_Wheeled_01_up_cannon_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_v2_F", "O_APC_Tracked_02_cannon_F", "O_APC_Tracked_02_AA_F"], // Veh 1
["O_MBT_02_cannon_F", "O_MBT_04_cannon_F"], // Veh 2
["O_APC_Wheeled_02_rcws_v2_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 Smugglers Shipment", // Marker text
180000, 200000, 220000,// 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_v2_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", "O_MBT_04_command_F"], // Veh 2
["O_APC_Wheeled_02_rcws_v2_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_v2_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
]
]
]
];
_missionType = _MoneyShipment select 0;
_moneyAmount = floor (random [_moneyShipment select 1, _moneyShipment select 2, _moneyShipment select 3]);
_convoys = _MoneyShipment select 4;
_vehChoices = selectRandom _convoys;
_moneyText = format ["$%1", [_moneyAmount] call fn_numbersText];
_vehClasses = [];
{ _vehClasses pushBack selectRandom _x } forEach _vehChoices;
};
Outside of the Scope:
_missionMoneyTotal = _moneyAmount;
I noticed in your default wasteland rev has:
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];
};
Which is set outside of the scope. But when I try to do it myself... it either says undefined variable in expression _moneyAmount
or the code get le broken everywhere.