Defent

DMS - Defent's Mission System

3369 posts in this topic

hello all anyone able to give me any pointers im trying to add a new mission to DMS on Esseker 
construction site objects

Quote

 


[
	["Land_CncWall4_F", [11242, 814.974, 158.401], [-0.81899, 0.573808, 0], [0, 0, 1], true],
	["Land_CncWall4_F", [11239.1, 810.685, 158.441], [-0.81899, 0.573808, 0], [0, 0, 1], true],
	["Land_CncWall4_F", [11236.1, 806.464, 158.475], [-0.81899, 0.573808, 0], [0, 0, 1], true],
	["Land_CncWall4_F", [11233.1, 802.222, 158.519], [-0.81899, 0.573808, 0], [0, 0, 1], true],
	["Land_CncWall4_F", [11230.1, 797.951, 158.577], [-0.81899, 0.573808, 0], [0, 0, 1], true],
	["Land_CncWall4_F", [11248, 823.51, 158.312], [-0.81899, 0.573808, 0], [0, 0, 1], true],
	["Land_CncWall4_F", [11245, 819.238, 158.358], [-0.81899, 0.573808, 0], [0, 0, 1], true],
	["Land_CncWall4_F", [11198.3, 884.923, 153.198], [-0.0584411, -0.998291, 0], [0, 0, 1], true],
	["Land_CncWall4_F", [11203.5, 884.66, 153.284], [-0.0584411, -0.998291, 0], [0, 0, 1], true],
	["Land_CncWall4_F", [11208.7, 884.338, 153.531], [-0.0584411, -0.998291, 0], [0, 0, 1], true],
	["Land_CncWall4_F", [11213.8, 884.02, 153.719], [-0.0584411, -0.998291, 0], [0, 0, 1], true],
	["Land_CncWall4_F", [11219, 883.725, 153.943], [-0.0584411, -0.998291, 0], [0, 0, 1], true],
	["Land_CncWall4_F", [11187.9, 885.518, 153.331], [-0.0584411, -0.998291, 0], [0, 0, 1], true],
	["Land_CncWall4_F", [11193.1, 885.237, 153.209], [-0.0584411, -0.998291, 0], [0, 0, 1], true],
	["Land_CncWall4_F", [11078.1, 790.936, 173.909], [0.563179, 0.826335, 0], [0, 0, 1], true],
	["Land_CncWall4_F", [11073.8, 793.834, 173.968], [0.563179, 0.826335, 0], [0, 0, 1], true],
	["Land_CncWall4_F", [11069.5, 796.762, 173.964], [0.563179, 0.826335, 0], [0, 0, 1], true],
	["Land_CncWall4_F", [11065.2, 799.698, 173.954], [0.563179, 0.826335, 0], [0, 0, 1], true],
	["Land_CncWall4_F", [11060.9, 802.621, 173.939], [0.563179, 0.826335, 0], [0, 0, 1], true],
	["Land_CncWall4_F", [11183.6, 884.236, 153.553], [0.609896, -0.792482, 0], [0, 0, 1], true],
	["Land_CncWall4_F", [11231.6, 875.664, 155.021], [-0.614096, -0.789232, 0], [0, 0, 1], true],
	["Land_CncWall4_F", [11235.8, 872.498, 155.427], [-0.614096, -0.789232, 0], [0, 0, 1], true],
	["Land_CncWall4_F", [11239.8, 869.309, 155.827], [-0.614096, -0.789232, 0], [0, 0, 1], true],
	["Land_CncWall4_F", [11243.9, 866.109, 156.229], [-0.614096, -0.789232, 0], [0, 0, 1], true],
	["Land_CncWall4_F", [11248, 862.92, 156.628], [-0.614096, -0.789232, 0], [0, 0, 1], true],
	["Land_CncWall4_F", [11223.4, 882.047, 154.237], [-0.614096, -0.789232, 0], [0, 0, 1], true],
	["Land_CncWall4_F", [11227.5, 878.872, 154.621], [-0.614096, -0.789232, 0], [0, 0, 1], true],
	["Land_CncWall4_F", [11249.8, 848.702, 157.568], [-0.999888, 0.0149993, 0], [0, 0, 1], true],
	["Land_CncWall4_F", [11249.7, 843.495, 157.784], [-0.999888, 0.0149993, 0], [0, 0, 1], true],
	["Land_CncWall4_F", [11249.6, 838.327, 157.96], [-0.999888, 0.0149993, 0], [0, 0, 1], true],
	["Land_CncWall4_F", [11249.5, 833.137, 158.111], [-0.999888, 0.0149993, 0], [0, 0, 1], true],
	["Land_CncWall4_F", [11249.5, 827.931, 158.25], [-0.999888, 0.0149993, 0], [0, 0, 1], true],
	["Land_CncWall4_F", [11249.9, 859.114, 156.979], [-0.999888, 0.0149993, 0], [0, 0, 1], true],
	["Land_CncWall4_F", [11249.8, 853.914, 157.303], [-0.999888, 0.0149993, 0], [0, 0, 1], true],
	["Land_CncWall4_F", [11098.3, 762.313, 175.195], [0.563179, 0.826335, 0], [0, 0, 1], true],
	["Land_CncWall4_F", [11094, 765.211, 175.253], [0.563179, 0.826335, 0], [0, 0, 1], true],
	["Land_CncWall4_F", [11089.7, 768.139, 175.25], [0.563179, 0.826335, 0], [0, 0, 1], true],
	["Land_CncWall4_F", [11085.4, 771.074, 175.239], [0.563179, 0.826335, 0], [0, 0, 1], true],
	["Land_CncWall4_F", [11081.1, 773.998, 175.225], [0.563179, 0.826335, 0], [0, 0, 1], true],
	["Land_CncWall4_F", [11106.9, 756.46, 175.226], [0.563179, 0.826335, 0], [0, 0, 1], true],
	["Land_CncWall4_F", [11102.6, 759.369, 175.226], [0.563179, 0.826335, 0], [0, 0, 1], true],
	["Land_CncWall4_F", [11170.2, 864.976, 154.795], [0.836126, -0.548537, 0], [0, 0, 1], true],
	["Land_CncWall4_F", [11173.1, 869.353, 154.465], [0.836126, -0.548537, 0], [0, 0, 1], true],
	["Land_CncWall4_F", [11175.7, 873.883, 154.202], [0.907717, -0.419584, 0], [0, 0, 1], true],
	["Land_CncWall4_F", [11164.5, 856.262, 155.529], [0.836126, -0.548537, 0], [0, 0, 1], true],
	["Land_CncWall4_F", [11167.4, 860.622, 155.216], [0.836126, -0.548537, 0], [0, 0, 1], true],
	["Land_CncWall4_F", [11216.1, 796.395, 158.392], [0.0279354, 0.99961, 0], [0, 0, 1], true],
	["Land_CncWall4_F", [11210.9, 796.499, 158.274], [0.0279354, 0.99961, 0], [0, 0, 1], true],
	["Land_CncWall4_F", [11205.7, 796.663, 158.155], [0.0279354, 0.99961, 0], [0, 0, 1], true],
	["Land_CncWall4_F", [11200.5, 796.823, 158.056], [0.0279354, 0.99961, 0], [0, 0, 1], true],
	["Land_CncWall4_F", [11195.3, 796.959, 158.018], [0.0279354, 0.99961, 0], [0, 0, 1], true],
	["Land_CncWall4_F", [11226.5, 796.118, 158.558], [0.0279354, 0.99961, 0], [0, 0, 1], true],
	["Land_CncWall4_F", [11221.3, 796.24, 158.485], [0.0279354, 0.99961, 0], [0, 0, 1], true],
	["Land_CncWall4_F", [11182.5, 804.632, 157.722], [0.589714, 0.807612, 0], [0, 0, 1], true],
	["Land_CncWall4_F", [11178.3, 807.67, 157.619], [0.589714, 0.807612, 0], [0, 0, 1], true],
	["Land_CncWall4_F", [11174.1, 810.734, 157.514], [0.589714, 0.807612, 0], [0, 0, 1], true],
	["Land_CncWall4_F", [11169.9, 813.807, 157.426], [0.589714, 0.807612, 0], [0, 0, 1], true],
	["Land_CncWall4_F", [11165.7, 816.87, 157.354], [0.589714, 0.807612, 0], [0, 0, 1], true],
	["Land_CncWall4_F", [11190.9, 798.504, 157.95], [0.589714, 0.807612, 0], [0, 0, 1], true],
	["Land_CncWall4_F", [11186.7, 801.551, 157.833], [0.589714, 0.807612, 0], [0, 0, 1], true],
	["Land_CncWall4_F", [11163.6, 831.029, 156.678], [0.999879, 0.0155346, 0], [0, 0, 1], true],
	["Land_CncWall4_F", [11163.4, 836.234, 156.47], [0.999879, 0.0155346, 0], [0, 0, 1], true],
	["Land_CncWall4_F", [11163.4, 841.402, 156.114], [0.999879, 0.0155346, 0], [0, 0, 1], true],
	["Land_CncWall4_F", [11163.3, 846.593, 155.907], [0.999879, 0.0155346, 0], [0, 0, 1], true],
	["Land_CncWall4_F", [11163.2, 851.799, 155.809], [0.999879, 0.0155346, 0], [0, 0, 1], true],
	["Land_CncWall4_F", [11163.7, 820.617, 157.197], [0.999879, 0.0155346, 0], [0, 0, 1], true],
	["Land_CncWall4_F", [11163.6, 825.816, 156.945], [0.999879, 0.0155346, 0], [0, 0, 1], true],
	["Land_Cargo_Tower_V2_F", [11233.2, 820.862, 168.826], [0.686045, 0.72756, 0], [0, 0, 1], true],
	["Land_BarGate_F", [11177.9, 880.515, 156.097], [0.797309, -0.603571, 0], [0, 0, 1], true],
	["Land_MedicalTent_01_white_IDAP_med_closed_F", [11239.3, 852.728, 156.491], [-0.998856, 0.0478147, 0], [0, 0, 1], true],
	["Land_MedicalTent_01_white_IDAP_med_closed_F", [11238.1, 842.704, 156.929], [-0.998856, 0.0478147, 0], [0, 0, 1], true],
	["Land_tent_east", [11222.6, 811.303, 157.942], [-0.647515, -0.762052, 0], [0, 0, 1], true],
	["Land_Cargo_HQ_V1_F", [11194.6, 811.287, 159.885], [0, 1, 0], [0, 0, 1], true],
	["Land_Cargo_House_V2_F", [11225.3, 871.82, 153.911], [0.631868, 0.775076, 0], [0, 0, 1], true],
	["Land_Cargo_House_V2_F", [11233.4, 866.279, 154.674], [0.631868, 0.775076, 0], [0, 0, 1], true],
	["Land_Cargo_House_V2_F", [11215.7, 878.262, 152.699], [0.03573, 0.999361, 0], [0, 0, 1], true],
	["Land_Cargo_House_V2_F", [11206.2, 878.641, 152.66], [0.0623591, 0.998054, 0], [0, 0, 1], true],
	["Land_Cargo_Tower_V2_F", [11177.6, 860.791, 166.04], [-0.490303, -0.871552, 0], [0, 0, 1], true],
	["Land_MobileCrane_01_F", [11190.8, 837.779, 177.65], [0.114167, -0.993462, 0], [0, 0, 1], true],
	["Land_A_CraneCon", [11229.1, 834.613, 173.784], [-0.29642, -0.955058, 0], [0, 0, 1], true],
	["Land_SM_01_shed_unfinished_F", [11207.4, 838.875, 156.512], [-0.999264, 0.0383541, 0], [0, 0, 1], true]
];

 

construction site mission

Quote

 


/*
	"construction site" static mission for Esseker.
	Created by eraser1
	Credits to "William" for creating the base.
*/

// For logging purposes
_num = DMS_MissionCount;


// Set mission side (only "bandit" is supported for now)
_side = "bandit";

_pos = [11206.302,839.043,0];

if ([_pos,DMS_StaticMinPlayerDistance] call DMS_fnc_IsPlayerNearby) exitWith {"delay"};


// Set general mission difficulty
_difficulty = "hardcore";


// Define spawn locations for AI Soldiers. These will be used for the initial spawning of AI as well as reinforcements.
// The center spawn location is added 3 times so at least 3 AI will spawn initially at the center location, and so that future reinforcements are more likely to spawn at the center.
_AISoldierSpawnLocations =
[
	[11223.4, 840.669, 154.922],
	[11220.8, 836.041, 155.028],
	[11215.8, 835.111, 154.818],
	[11217.4, 841.594, 154.548],
	[11214.2, 839.734, 154.477],
	[11221.3, 847.251, 154.444],
	[11210.4, 840.335, 154.248],
	[11221.1, 851.318, 154.197],
	[11215.3, 845.949, 154.179],
	[11218.3, 848.734, 154.19], 
	[11214.7, 847.707, 154.049],
	[11219.1, 844.227, 154.491],
	[11212.6, 806.284, 156.098],
	[11205.7, 803.681, 156.029],
	[11207.6, 810.326, 155.723],
	[11215.1, 812.955, 155.865],
	[11211, 812.624, 155.726], 
	[11174.9, 826.317, 154.886],
	[11182.3, 825.701, 154.787],
	[11194.2, 846.135, 154.33], 
	[11190.1, 859.826, 153.91], 
	[11178.6, 851.936, 154.207],
	[11182.9, 843.207, 153.813],
	[11193.6, 834.485, 154.133],
	[11214.3, 874.014, 152.553],
	[11211.8, 865.86, 152.881], 
	[11195.7, 873.787, 152.021],
	[11185.9, 874.873, 152.045],
	[11184.4, 868.558, 152.468],
	[11190.9, 866.091, 152.538],
	[11200.4, 865.738, 152.47], 
	[11204.1, 872.29, 152.24], 
	[11242.5, 834.841, 156.045],
	[11241.3, 828.17, 156.227],
	[11233, 831.534, 155.801], 
	[11235, 836.108, 155.696] 
];

// Create AI
_AICount = 30 + (round (random 5));


_group =
[
	_AISoldierSpawnLocations+[_pos,_pos,_pos],			// Pass the regular spawn locations as well as the center pos 3x
	_AICount,
	_difficulty,
	"random",
	_side
] call DMS_fnc_SpawnAIGroup_MultiPos;


_staticGuns =
[
	[
		[11182.474,886.155,311.760],
		[11173.611,875.817,319.441]
	],
	_group,
	"assault",
	_difficulty,
	"bandit",
	"random"
] call DMS_fnc_SpawnAIStaticMG;



// Define the classnames and locations where the crates can spawn (at least 2, since we're spawning 2 crates)
_crateClasses_and_Positions =
[
	[[11207.9, 	841.049, 155.116],	"I_CargoNet_01_ammo_F"],
	[[11200.2, 	842.549, 155.116],	"I_CargoNet_01_ammo_F"],
	[[11200.3, 	843.964, 155.116],	"I_CargoNet_01_ammo_F"],
	[[11200.2, 	841.141, 155.116],	"I_CargoNet_01_ammo_F"],
	[[11208, 	843.521, 155.116],	"I_CargoNet_01_ammo_F"],
	[[11207.9, 	842.171, 155.116],	"I_CargoNet_01_ammo_F"]
	
];

{
	deleteVehicle (nearestObject _x);		// Make sure to remove any previous crates.
} forEach _crateClasses_and_Positions;

// Shuffle the list
_crateClasses_and_Positions = _crateClasses_and_Positions call ExileClient_util_array_shuffle;


// Create Crates
_crate0 = [_crateClasses_and_Positions select 0 select 1, _crateClasses_and_Positions select 0 select 0] call DMS_fnc_SpawnCrate;
_crate1 = [_crateClasses_and_Positions select 1 select 1, _crateClasses_and_Positions select 1 select 0] call DMS_fnc_SpawnCrate;

// Disable smoke on the crates so that the players have to search for them >:D
{
	_x setVariable ["DMS_AllowSmoke", false];
} forEach [_crate0,_crate1];

/*
// Don't think an armed AI vehicle fit the idea behind the mission. You're welcome to uncomment this if you want.
_veh =
[
	[
		[_pos,100,random 360] call DMS_fnc_SelectOffsetPos,
		_pos
	],
	_group,
	"assault",
	_difficulty,
	_side
] call DMS_fnc_SpawnAIVehicle;
*/


// Define mission-spawned AI Units
_missionAIUnits =
[
	_group 		// We only spawned the single group for this mission
];

// Define the group reinforcements
_groupReinforcementsInfo =
[
	[
		_group,			// pass the group
		[
			[
				-1,		// Let's limit number of units instead...
				0
			],
			[
				100,	// Maximum 100 units can be given as reinforcements.
				0
			]
		],
		[
			240,		// About a 4 minute delay between reinforcements.
			diag_tickTime
		],
		_AISoldierSpawnLocations,
		"random",
		_difficulty,
		_side,
		"reinforce",
		[
			10,			// Reinforcements will only trigger if there's fewer than 10 members left in the group
			7			// 7 reinforcement units per wave.
		]
	]
];

// Define mission-spawned objects and loot values
_missionObjs =
[
	_staticGuns,			// static gun(s). Note, we don't add the base itself because it already spawns on server start.
	[],
	[[_crate0,[50,100,2]],[_crate1,[3,150,15]]]
];

// Define Mission Start message
_msgStart = ['#FFFF00', "A large group of mercenaries are setting up a new base!! They were seen stockpiling multiple crates..."];

// Define Mission Win message
_msgWIN = ['#0080ff',"Convicts have successfully rooted out the mercenaries and claimed the caches for themselves!"];

// Define Mission Lose message
_msgLOSE = ['#FF0000',"The mercenaries got spooked and left..."];

// Define mission name (for map marker and logging)
_missionName = "Construction Site";

// Create Markers
_markers =
[
	_pos,
	_missionName,
	_difficulty
] call DMS_fnc_CreateMarker;

_circle = _markers select 1;
_circle setMarkerDir 20;
_circle setMarkerSize [150,50];


_time = diag_tickTime;

// Parse and add mission info to missions monitor
_added =
[
	_pos,
	[
		[
			"kill",
			_group
		],
		[
			"playerNear",
			[_pos,100]
		]
	],
	_groupReinforcementsInfo,
	[
		_time,
		DMS_StaticMissionTimeOut call DMS_fnc_SelectRandomVal
	],
	_missionAIUnits,
	_missionObjs,
	[_missionName,_msgWIN,_msgLOSE],
	_markers,
	_side,
	_difficulty,
	[]
] call DMS_fnc_AddMissionToMonitor_Static;

// Check to see if it was added correctly, otherwise delete the stuff
if !(_added) exitWith
{
	diag_log format ["DMS ERROR :: Attempt to set up mission %1 with invalid parameters for DMS_fnc_AddMissionToMonitor_Static! Deleting mission objects and resetting DMS_MissionCount.",_missionName];

	_cleanup = [];
	{
		_cleanup pushBack _x;
	} forEach _missionAIUnits;

	_cleanup pushBack ((_missionObjs select 0)+(_missionObjs select 1));

	{
		_cleanup pushBack (_x select 0);
	} foreach (_missionObjs select 2);

	_cleanup call DMS_fnc_CleanUp;


	// Delete the markers directly
	{deleteMarker _x;} forEach _markers;


	// Reset the mission count
	DMS_MissionCount = DMS_MissionCount - 1;
};


// Notify players
[_missionName,_msgStart] call DMS_fnc_BroadcastMissionStatus;



if (DMS_DEBUG) then
{
	(format ["MISSION: (%1) :: Mission #%2 started at %3 with %4 AI units and %5 difficulty at time %6",_missionName,_num,_pos,_AICount,_difficulty,_time]) call DMS_fnc_DebugLog;
};

 

config.sqf mission configs

Quote

 



	DMS_StaticMissionTypes =			[									// List of STATIC missions with spawn chances.
											["Construction_Site",1]			//<--Construction Site by Dave
										];

	DMS_SpecialMissions =				[									// List of special missions with restrictions. Each element must be defined as [mission<STRING>, minPlayers<SCALAR>, maxPlayers<SCALAR>, timesPerRestart<SCALAR>, _timeBetween<SCALAR>].
											//["specops",15,60,2,900]		//<-- Example for a mission named "specops.sqf" that must be placed in the "special" folder. It will only spawn when there are at least 15 players, less than 60 players, it will only spawn up to twice per restart, and at least 900 seconds must pass before another instance of the mission can spawn.
										];

	DMS_BasesToImportOnServerStart = 	[									// List of static bases to import on server startup (spawned post-init). This will reduce the amount of work the server has to do when it actually spawns static missions, and players won't be surprised when a base suddenly pops up. You can also include any other M3E-exported bases to spawn here.
											"Construction_Site_objects"		//<--Construction Site objects by Dave
 										];

	DMS_BanditMissionsOnServerStart =	[
											//"construction"		//<-- Example
										];

	DMS_StaticMissionsOnServerStart =	[								// List of STATIC missions with spawn chances.
											//"saltflats"			//<--Example
											//"slums"				//<--Example
											//"occupation"			//<--Example
											//"sectorB"												//<--Example for Taviana
											"Construction_Site"
										];

 


the error i get when booting up the server with the new mission 

Quote

 8:07:58 Error in expression <select 1;
 
if (_x select 4) then
{
_obj setDir (_x select 2);
_obj setPosATL _po>
 8:07:58   Error position: <setDir (_x select 2);
_obj setPosATL _po>
 8:07:58   Error setdir: Type Array, expected Number
 8:07:58 File \x\addons\dms\scripts\fn_ImportFromM3E_Static.sqf [DMS_fnc_ImportFromM3E_Static], line 55

 

Edited by TheJ3wishTurban

Share this post


Link to post
Share on other sites
Advertisement

I am seeing this consistently in my logs, I have no idea what it means or how to fix....

 

17:06:56 Error in expression < 2);
_obj setPosATL _pos;
}
else
{
_obj setPosATL _pos;
_obj setVectorDirAndUp (>
17:06:56   Error position: <setPosATL _pos;
_obj setVectorDirAndUp (>
17:06:56   Error 1 elements provided, 3 expected
17:06:56 File \x\addons\dms\scripts\fn_ImportFromM3E_Static.sqf [DMS_fnc_ImportFromM3E_Static], line 60
17:06:56 Error in expression < 2);
_obj setPosATL _pos;
}
else
{
_obj setPosATL _pos;
_obj setVectorDirAndUp (>
17:06:56   Error position: <setPosATL _pos;
_obj setVectorDirAndUp (>
17:06:56   Error 1 elements provided, 3 expected
17:06:56 File \x\addons\dms\scripts\fn_ImportFromM3E_Static.sqf [DMS_fnc_ImportFromM3E_Static], line 60
17:06:56 Error in expression < 2);
_obj setPosATL _pos;
}
else
{
_obj setPosATL _pos;
_obj setVectorDirAndUp (>
17:06:56   Error position: <setPosATL _pos;
_obj setVectorDirAndUp (>
17:06:56   Error 1 elements provided, 3 expected

 

Share this post


Link to post
Share on other sites

I am using the Construction.sqf on Altis but it only offers a non persistant vehicle and i would like to know how to change it into a persistant vehicle with a pin code at the end of the bandit mission.

Share this post


Link to post
Share on other sites
Spoiler

/*
    Sample mission
*/

private ["_num", "_group", "_pos", "_side", "_OK", "_difficulty", "_AICount", "_type", "_launcher", "_crate", "_wreck1", "_wreck2", "_wreck3", "_vehClass", "_pinCode", "_vehicle", "_crate_loot_values", "_missionAIUnits", "_missionObjs", "_msgStart", "_msgWIN", "_msgLOSE", "_missionName", "_markers", "_time", "_added", "_cleanup"];

// For logging purposes
_num = DMS_MissionCount;


// Set mission side
_side = "bandit";


// This part is unnecessary, but exists just as an example to format the parameters for "DMS_fnc_MissionParams" if you want to explicitly define the calling parameters for DMS_fnc_FindSafePos.
// It also allows anybody to modify the default calling parameters easily.
if ((isNil "_this") || {_this isEqualTo [] || {!(_this isEqualType [])}}) then
{
    _this =
    [
        [15,DMS_WaterNearBlacklist,DMS_MinSurfaceNormal,DMS_SpawnZoneNearBlacklist,DMS_TraderZoneNearBlacklist,DMS_MissionNearBlacklist,DMS_PlayerNearBlacklist,DMS_TerritoryNearBlacklist,DMS_ThrottleBlacklists],
        [
            []
        ],
        _this
    ];
};

// Check calling parameters for manually defined mission position.
// You can define "_extraParams" to specify the vehicle classname to spawn, either as _classname or [_classname]
_OK = (_this call DMS_fnc_MissionParams) params
[
    ["_pos",[],[[]],[3]],
    ["_extraParams",[]]
];

if !(_OK) exitWith
{
    diag_log format ["DMS ERROR :: Called MISSION construction.sqf with invalid parameters: %1",_this];
};


// Set general mission difficulty
_difficulty = "hardcore";


// Create AI
_AICount = 5 + (round (random 2));

_group =
[
    _pos,                    // Position of AI
    _AICount,                // Number of AI
    "hardcore",                // "random","hardcore","difficult","moderate", or "easy"
    "random",                 // "random","assault","MG","sniper" or "unarmed" OR [_type,_launcher]
    _side                     // "bandit","hero", etc.
] call DMS_fnc_SpawnAIGroup;


// Create Crate
_crate = ["Box_NATO_Wps_F",[(_pos select 0)+2,(_pos select 1)-1,0]] call DMS_fnc_SpawnCrate;

_wreck1 = createVehicle ["Land_CinderBlocks_F",[(_pos select 0) - 10, (_pos select 1),-0.1],[], 0, "CAN_COLLIDE"];
_wreck2 = createVehicle ["Land_Bricks_V1_F",[(_pos select 0) - 5, (_pos select 1),-3.3],[], 0, "CAN_COLLIDE"];
_wreck3 = createVehicle ["Land_Bricks_V1_F",[(_pos select 0) - 13, (_pos select 1),-1],[], 0, "CAN_COLLIDE"];

// Check to see if a special vehicle class is defined in "_extraParams", and make sure it's valid, otherwise use the default (Offroad Armed)
_vehClass =
    if (_extraParams isEqualTo []) then
    {
        "Exile_Car_Zamak"
    }
    else
    {
        if ((typeName _extraParams)=="STRING") then
        {
            _extraParams
        }
        else
        {
            if (((typeName _extraParams)=="ARRAY") && {(typeName (_extraParams select 0))=="STRING"}) then
            {
                _extraParams select 0
            }
            else
            {
                "Exile_Car_Zamak"
            };
        };
    };
 //    try putting _pincode at top in section where it says private plus see where the win message has put lock code
_pinCode = 1000 + round (random 8999);
_vehicle = [_vehClass, _pos getPos [30, random 360], _pinCode] call DMS_fnc_SpawnPersistentVehicle;

 


// Set crate loot values
_crate_loot_values =
[
    3,        // Weapons
    [25,DMS_BoxBuildingSupplies],        // Items
    2         // Backpacks
];


// Define mission-spawned AI Units
_missionAIUnits =
[
    _group         // We only spawned the single group for this mission
];

// Define mission-spawned objects and loot values
_missionObjs =
[
    [_wreck1,_wreck2,_wreck3],            // No spawned buildings
    [_vehicle],
    [[_crate,_crate_loot_values]]
];

// Define Mission Start message
_msgStart = ['#FFFF00',"A group of mercenaries have set up a construction site. Clear them out!"];

// Define Mission Win message
_msgWIN = ['#0080ff',"Convicts have successfully demolished the construction site!, entry code %1...",_pinCode];

// Define Mission Lose message
_msgLOSE = ['#FF0000',"The mercenaries have dismantled their construction site and escaped!"];


// Define mission name (for map marker and logging)
_missionName = "Construction Site";

// Create Markers
_markers =
[
    _pos,
    _missionName,
    _difficulty
] call DMS_fnc_CreateMarker;

// Record time here (for logging purposes, otherwise you could just put "diag_tickTime" into the "DMS_AddMissionToMonitor" parameters directly)
_time = diag_tickTime;

// Parse and add mission info to missions monitor
_added =
[
    _pos,
    [
        [
            "kill",
            _group
        ],
        [
            "playerNear",
            [_pos,DMS_playerNearRadius]
        ]
    ],
    [
        _time,
        (DMS_MissionTimeOut select 0) + random((DMS_MissionTimeOut select 1) - (DMS_MissionTimeOut select 0))
    ],
    _missionAIUnits,
    _missionObjs,
    [_missionName,_msgWIN,_msgLOSE],
    _markers,
    _side,
    _difficulty,
    []
] call DMS_fnc_AddMissionToMonitor;

// Check to see if it was added correctly, otherwise delete the stuff
if !(_added) exitWith
{
    diag_log format ["DMS ERROR :: Attempt to set up mission %1 with invalid parameters for DMS_AddMissionToMonitor! Deleting mission objects and resetting DMS_MissionCount.",_missionName];

    // Delete AI units and the crate. I could do it in one line but I just made a little function that should work for every mission (provided you defined everything correctly)
    _cleanup = [];
    {
        _cleanup pushBack _x;
    } forEach _missionAIUnits;

    _cleanup pushBack ((_missionObjs select 0)+(_missionObjs select 1));

    {
        _cleanup pushBack (_x select 0);
    } foreach (_missionObjs select 2);

    _cleanup call DMS_fnc_CleanUp;


    // Delete the markers directly
    {deleteMarker _x;} forEach _markers;


    // Reset the mission count
    DMS_MissionCount = DMS_MissionCount - 1;
};


// Notify players
[_missionName,_msgStart] call DMS_fnc_BroadcastMissionStatus;

 

if (DMS_DEBUG) then
{
    (format ["MISSION: (%1) :: Mission #%2 started at %3 with %4 AI units and %5 difficulty at time %6",_missionName,_num,_pos,_AICount,_difficulty,_time]) call DMS_fnc_DebugLog;
};

 

the mission will not start because there is an error on line 125

_msgWIN = ['#0080ff',"Convicts have successfully demolished the construction site!, entry code %1...",_pinCode];

the mission is usually for a non persistant vehicle and @kuplion told me to add

_pinCode = 1000 + round (random 8999);
_vehicle = [_vehClass, _pos getPos [30, random 360], _pinCode] call DMS_fnc_SpawnPersistentVehicle;

i also edited line 125 to give a pin code on winning. and i also added "_pinCode", to the first script line as shown

Share this post


Link to post
Share on other sites

Can anyone help me add some other AI vehicles to DMS bandit missions? I would like to see 1 or 2 armed vehicles on a mission.
I have this in one of Neds files and assume if may be able to add a vehicle class like DMS_ArmedVehicles from DMS but no idea where or how to place it.
 

// Check calling parameters for manually defined mission position.
// You can define "_extraParams" to specify the vehicle classname to spawn, either as _vehClass or [_vehClass]
_OK = (_this call DMS_fnc_MissionParams) params
[
	["_pos",[],[[]],[3],[],[],[]],
	["_extraParams",[]]
];

UPDATE: Found the answer here - Thanks anyway :D

 

Edited by MrNeal

Share this post


Link to post
Share on other sites

Hello,

Has anyone tried adding DMS_fnc_SpawnHeliReinforcement to the dynamic missions? I tried this out and it works but i cannot figure out how to correctly define the helis so when the missions time out they delete properly. I have tried many different ways but they all result in the same outcome either all the ai delete and the heli crashes to the ground or all the ai delete and the heli freezes in the air.

My rpt has 1 or both of the following errors,

2814. "DMS ERROR :: Calling DMS_fnc_CleanUp with an invalid parameter: 0 | Type: SCALAR"
2815. "DMS ERROR :: Calling DMS_fnc_CleanUp with an invalid parameter: 1 | Type: SCALAR"

here is an example of one of my missions.

any help would be greatly appreciated.  This one has me pulling my hair out.

Spoiler

/*
    Medical Mission Mission with new difficulty selection system
    Hardcore now gives persistent vehicle
    easy/mod/difficult/hardcore - reworked by [CiC]red_ned http://cic-gaming.co.uk
    based on work by Defent and eraser1
*/

private ["_num", "_side", "_pos", "_OK", "_difficulty", "_AICount", "_group", "_type", "_launcher", /*"_hel1", "_hel2",*/ "_staticGuns", "_crate1", "_vehicle", "_pinCode", "_class", "_veh1", "_veh2", "_veh3", "_veh4", "_veh5", "_veh6", "_crate_loot_values1", "_missionAIUnits", "_missionObjs", "_msgStart", "_msgWIN", "_msgLOSE", "_missionName", "_markers", "_time", "_added", "_cleanup", "_baseObjs", "_crate_weapons", "_crate_weapon_list", "_crate_items", "_crate_item_list", "_crate_backpacks", "_PossibleDifficulty"];

// For logging purposes
_num = DMS_MissionCount;


// Set mission side (only "bandit" is supported for now)
_side = "bandit";


// This part is unnecessary, but exists just as an example to format the parameters for "DMS_fnc_MissionParams" if you want to explicitly define the calling parameters for DMS_fnc_FindSafePos.
// It also allows anybody to modify the default calling parameters easily.
if ((isNil "_this") || {_this isEqualTo [] || {!(_this isEqualType [])}}) then
{
    _this =
    [
        [5,DMS_WaterNearBlacklist,DMS_MinSurfaceNormal,DMS_SpawnZoneNearBlacklist,DMS_TraderZoneNearBlacklist,DMS_MissionNearBlacklist,DMS_PlayerNearBlacklist,DMS_TerritoryNearBlacklist,DMS_ThrottleBlacklists],
        [
            []
        ],
        _this
    ];
};

// Check calling parameters for manually defined mission position.
// You can define "_extraParams" to specify the vehicle classname to spawn, either as _vehClass or [_vehClass]
_OK = (_this call DMS_fnc_MissionParams) params
[
    ["_pos",[],[[]],[3],[],[],[]],
    ["_extraParams",[]]
];

if !(_OK) exitWith
{
    diag_log format ["DMS ERROR :: Called MISSION paul_garage.sqf with invalid parameters: %1",_this];
};


//create possible difficulty add more of one difficulty to weight it towards that
_PossibleDifficulty        =     [

                                "hardcore"
                            ];
//choose difficulty and set value
_difficulty = selectRandom _PossibleDifficulty;

switch (_difficulty) do
{
    case "easy":
    {
        _AICount = (4 + (round (random 2)));
        _crate_weapons         = (10 + (round (random 1)));
        _crate_items         = (3 + (round (random 3)));
        _crate_backpacks     = (1 + (round (random 1)));
    };

    case "moderate":
    {
        _AICount = (5 + (round (random 1)));
        _crate_weapons         = (15 + (round (random 1)));
        _crate_items         = (8 + (round (random 3)));
        _crate_backpacks     = (2 + (round (random 1)));
    };

    case "difficult":
    {
        _AICount = (5 + (round (random 1)));
        _crate_weapons         = (20 + (round (random 1)));
        _crate_items         = (12 + (round (random 3)));
        _crate_backpacks     = (3 + (round (random 1)));
    };

    //case "hardcore":
    default
    {
        _AICount = (25 + (round (random 5)));
        _crate_weapons         = (20 + (round (random 5)));
        _crate_items         = (30 + (round (random 5)));
        _crate_backpacks     = (2 + (round (random 1)));
    };
};

//_msgStart = ['#FFFF00',format["A field hospital is under attack! Go kill the %1 attackers",_difficulty]];
_msgStart = ['#FFFF00',"Soldiers are repairing a Marshall at their garage. Wipe them out and take the Marshall!"];

 

_group =
[
    _pos,                    // Position of AI
    _AICount,                // Number of AI
    "hardcore",            // "random","hardcore","difficult","moderate", or "easy"
    "random",                 // "random","assault","MG","sniper" or "unarmed" OR [_type,_launcher]
    _side                     // "bandit","hero", etc.
] call DMS_fnc_SpawnAIGroup;

 //add vehicle patrol
 _veh1 =
    [
        [
            [(_pos select 0) +50,(_pos select 1)-50,0]

     ],
     _group,
     "random",
     "hardcore",
     _side
    ] call DMS_fnc_SpawnAIVehicle;
    
    _veh2 =
    [
        [

            [(_pos select 0) -50,(_pos select 1)+50,0]

     ],
     _group,
     "random",
     "hardcore",
     _side
    ] call DMS_fnc_SpawnAIVehicle;
    
    _veh3 =
    [
        [
            [(_pos select 0) -50,(_pos select 1)-50,0]
            
     ],
     _group,
     "random",
     "hardcore",
     _side
    ] call DMS_fnc_SpawnAIVehicle;
    
    _veh4 =
    [
        [

            [(_pos select 0) +50,(_pos select 1)+50,0]
     ],
     _group,
     "random",
     "hardcore",
     _side
    ] call DMS_fnc_SpawnAIVehicle;
    
//add helicopter reinforcement

//_hel2
_veh5 =

[

    _group,
    "random",       //ai class
    "hardcore",     //ai difficulity
    "bandit",       //ai side
    _pos,           //ai drop from heli point
    false,          //eject heli gunners
    6,              //number of ai to drop
    true           //heli stays and fights
    
    
] call DMS_fnc_SpawnHeliReinforcement;

//_hel2
_veh6 =

[

    _group,
    "random",       //ai class
    "hardcore",     //ai difficulity
    "bandit",       //ai side
    _pos,           //ai drop from heli point
    false,          //eject heli gunners
    4,              //number of ai to drop
    true,           //heli stays and fights
    "RHS_Mi24Vt_vvsc"
    
] call DMS_fnc_SpawnHeliReinforcement;


 //add static guns
 
 _staticGuns =
 [
     [
         // make statically positioned relative to centre point and randomise a little
         [(_pos select 0) -(40-(random 2)),(_pos select 1)+(40+(random 2)),0],
         [(_pos select 0) -(40+(random 2)),(_pos select 1)-(40+(random 2)),0],
        [(_pos select 0) +(40-(random 2)),(_pos select 1)+(40-(random 2)),0],
         [(_pos select 0) +(40+(random 2)),(_pos select 1)-(40-(random 2)),0],
        [(_pos select 0) +(5+(random .1)),(_pos select 1)+(2+(random .1)),0] //garage ai gun
     ],
     _group,
     "random",
     "hardcore",
     "bandit"
 ] call DMS_fnc_SpawnAIStaticMG;


// Create Buildings - use seperate file as found in the mercbase mission
_baseObjs =
[
    "paul_garage",
    _pos
] call DMS_fnc_ImportFromM3E;


// If hardcore give pincoded vehicle, if not give non persistent
if (_difficulty isEqualTo "hardcore") then {
                                                _pinCode = (1000 +(round (random 8999)));
                                                _vehicle = ["B_APC_Wheeled_01_cannon_F",[(_pos select 0) -20, (_pos select 1) -20],_pinCode] call DMS_fnc_SpawnPersistentVehicle;
                                                _msgWIN = ['#0080ff',format ["Convicts killed the soldiers, entry code of the Marshall is %1...",_pinCode]];
                                            } else
                                            {
                                                _vehicle = ["O_MBT_02_cannon_F",[(_pos select 0) -20, (_pos select 1) -20,0],[], 0, "CAN_COLLIDE"] call DMS_fnc_SpawnNonPersistentVehicle;
                                                _msgWIN = ['#0080ff',"Convicts killed the soldiers and are stealing the HMMWV Avenger!"];
                                            };

// Create Crate type
_crate1 = ["I_CargoNet_01_ammo_F",[(_pos select 0)-5,(_pos select 1)-1,0]] call DMS_fnc_SpawnCrate;


_crate_loot_values1 =
[
    _crate_weapons,            // Weapons
    _crate_items,            // Items + selection list
    _crate_backpacks         // Backpacks
];


// Define mission-spawned AI Units
_missionAIUnits =
[
    _group         // We only spawned the single group for this mission
];

// Define mission-spawned objects and loot values
_missionObjs =
[
    //_baseObjs+[_veh1]+[_veh2]+[_veh3]+[_veh4]+[_hel1]+[_hel2]+[_staticGuns],// FAIL BUT NOT HORRIBLY heli frozen in sky
    //_baseObjs,_veh1,_veh2,_veh3,_veh4,_hel1,_hel2,_staticGuns, // TOTAL FAILURE WILL NOT SPAWN
    //_baseObjs+[_veh1,_veh2,_veh3,_veh4,_hel1,_hel2]+_staticGuns, //FAILURE BUT BEST YET no frozen heli but ai delete heli falls to ground and blows up.
    //_baseObjs+_staticGuns+[_veh1]+[_veh2]+[_veh3]+[_veh4]+[_hel1]+[_hel2], //same result as above
    //[_veh1,_veh2,_veh3,_veh4,_hel1,_hel2]+_baseObjs+_staticGuns,  //fail frozen heli
    //_baseObjs+_staticGuns+[_veh1,_veh2,_veh3,_veh4,_hel1,_hel2],  //same result as above
    //[_veh1,_veh2,_veh3,_veh4]+[_hel1,_hel2]+_baseObjs+_staticGuns,  // fail frozen heli
    [_veh1,_veh2,_veh3,_veh4,_veh5,_veh6]+_baseObjs+_staticGuns,     // fail ai delete heli falls to ground and blows up.
    [_vehicle],                            //this is prize vehicle
    [[_crate1,_crate_loot_values1]]        //this is prize crate
];

// define start messages in difficulty choice

// Define Mission Win message defined in persistent choice


// Define Mission Lose message
_msgLOSE = ['#FF0000',"The Marshall has been repaired and the soldiers left the area."];

// Define mission name (for map marker and logging)
_missionName = "Soldier Garage";

// Create Markers - same for all levels
_markers =
[
    _pos,
    _missionName,
    _difficulty
] call DMS_fnc_CreateMarker;

// Record time here (for logging purposes, otherwise you could just put "diag_tickTime" into the "DMS_AddMissionToMonitor" parameters directly)
_time = diag_tickTime;

// Parse and add mission info to missions monitor
_added =
[
    _pos,
    [
        [
            "kill",
            _group
        ],
        [
            "playerNear",
            [_pos,DMS_playerNearRadius]
        ]
    ],
    [
        _time,
        (DMS_MissionTimeOut select 0) + random((DMS_MissionTimeOut select 1) - (DMS_MissionTimeOut select 0))
    ],
    _missionAIUnits,
    _missionObjs,
    [_missionName,_msgWIN,_msgLOSE],
    _markers,
    _side,
    _difficulty,
    []
] call DMS_fnc_AddMissionToMonitor;

// Check to see if it was added correctly, otherwise delete the stuff
if !(_added) exitWith
{
    diag_log format ["DMS ERROR :: Attempt to set up mission %1 with invalid parameters for DMS_AddMissionToMonitor! Deleting mission objects and resetting DMS_MissionCount.",_missionName];

    // Delete AI units and the crate. I could do it in one line but I just made a little function that should work for every mission (provided you defined everything correctly)
    _cleanup = [];
    {
        _cleanup pushBack _x;
    } forEach _missionAIUnits;

    _cleanup pushBack ((_missionObjs select 0)+(_missionObjs select 1));

    {
        _cleanup pushBack (_x select 0);
    } foreach (_missionObjs select 2);

    _cleanup call DMS_fnc_CleanUp;


    // Delete the markers directly
    {deleteMarker _x;} forEach _markers;


    // Reset the mission count
    DMS_MissionCount = DMS_MissionCount - 1;
};


// Notify players
[_missionName,_msgStart] call DMS_fnc_BroadcastMissionStatus;

 

if (DMS_DEBUG) then
{
    (format ["MISSION: (%1) :: Mission #%2 started at %3 with %4 AI units and %5 difficulty at time %6",_missionName,_num,_pos,_AICount,_difficulty,_time]) call DMS_fnc_DebugLog;
};

 

 

Share this post


Link to post
Share on other sites

Question if this is still active,  but I want to add different vics to spawn everytime I do I get this error.

 Error in expression <	

 

"B_LSV_01_AT_F",

"B_LSV_01_armed_F",

];

 

DMS_TransportTrucks =				[							

"E>

14:39:38   Error position: <];

 

DMS_TransportTrucks =				[							

"E>

14:39:38   Error Missing [

14:39:38 File x\addons\dms\config.sqf, line 1129

14:39:38 Error in expression <	

But this is the actual code! What am I doing wrong?

	DMS_ArmedVehicles =					[							// List of armed vehicles that can spawn
											#ifdef USE_APEX_VEHICLES
											"B_T_LSV_01_armed_F",
											"O_T_LSV_02_armed_F",
											#endif
											"I_LT_01_cannon_F",
											"I_LT_01_AT_F"
										];

	DMS_MilitaryVehicles =				[							// List of (unarmed) military vehicles that can spawn
											#ifdef USE_APEX_VEHICLES
											"B_T_LSV_01_unarmed_F",
											"O_T_LSV_02_unarmed_F",
											#endif
											"B_LSV_01_AT_F",
											"B_LSV_01_armed_F"
										];

	DMS_TransportTrucks =				[							// List of transport trucks that can spawn
											"Exile_Car_Van_Guerilla01",
											"Exile_Car_Zamak",
											"Exile_Car_Tempest",
											"Exile_Car_HEMMT",
											"Exile_Car_Ural_Open_Military",
											"Exile_Car_Ural_Covered_Military"
										];

 

Share this post


Link to post
Share on other sites
Advertisement

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.