mirror of
https://github.com/Defent/DMS_Exile.git
synced 2024-08-30 16:52:12 +00:00
7a074042b1
* CONFIG VALUES: Changed "DMS_MissionTypes" to "DMS_BanditMissionTypes" * Renamed some variables to "future-proof" them * Placed all current missions under "bandit" subfolder to for easier future integration. * Created function "DMS_fnc_SpawnBanditMission" to handle bandit mission spawning (makes it easier to spawn missions via admin console). * Attached vehicle eventhandlers to DMS-spawned non-persistent vehicles. * Fixed the "lock" option appearing on DMS-spawned vehicles.
46 lines
1.2 KiB
Plaintext
46 lines
1.2 KiB
Plaintext
/*
|
|
DMS_fnc_SpawnBanditMission
|
|
Created by eraser1
|
|
|
|
Usage:
|
|
[
|
|
_missionType,
|
|
_parameters
|
|
] call DMS_fnc_SpawnBanditMission;
|
|
|
|
Simply spawns a mission with the given mission type and passes parameters to it. Returns nothing
|
|
*/
|
|
|
|
|
|
private ["_OK", "_missionType", "_parameters"];
|
|
|
|
|
|
_missionType = param [0, DMS_BanditMissionTypesArray call BIS_fnc_selectRandom, [""]];
|
|
|
|
if !(_missionType in DMS_BanditMissionTypesArray) then
|
|
{
|
|
diag_log format ["DMS ERROR :: Calling DMS_fnc_SpawnBanditMission for a mission that isn't in DMS_BanditMissionTypesArray! Parameters: %1",_this];
|
|
}
|
|
else
|
|
{
|
|
_parameters = [];
|
|
|
|
if ((count _this)>1) then
|
|
{
|
|
_parameters = _this select 1;
|
|
};
|
|
|
|
DMS_MissionCount = DMS_MissionCount + 1;
|
|
DMS_RunningBMissionCount = DMS_RunningBMissionCount + 1;
|
|
DMS_BMissionDelay = DMS_TimeBetweenMissions call DMS_fnc_SelectRandomVal;
|
|
|
|
_parameters call compile preprocessFileLineNumbers (format ["\x\addons\DMS\missions\bandit\%1.sqf",_missionType]);
|
|
|
|
DMS_BMissionLastStart = diag_tickTime;
|
|
|
|
|
|
if (DMS_DEBUG) then
|
|
{
|
|
diag_log format ["DMS_DEBUG SelectMission :: Spawned mission %1 with parameters (%2) | DMS_BMissionDelay set to %3 seconds",str _missionType,_parameters,DMS_BMissionDelay];
|
|
};
|
|
}; |