mirror of
https://github.com/Defent/DMS_Exile.git
synced 2024-08-30 16:52:12 +00:00
mI gramur Iz gUd (new mission, function, and features)
* **NEW CONFIG VALUES**: |DMS_MarkerText_ShowMissionPrefix| |DMS_MarkerText_MissionPrefix| |DMS_MarkerText_ShowAICount| |DMS_MarkerText_AIName| * New function: DMS_fnc_SpawnPersistentVehicle. It will spawn inaccessible vehicles by default and convert VALID pincode inputs to the proper format. * New mission: "Car Thieves" (thieves.sqf). It uses the new DMS_fnc_SpawnPersistentVehicle. When the mission is completed successfully, the code is displayed in the completion message. * You can now add a "prefix" to the marker text of each mission. * You can now display the number of remaining AI in the marker text (it should update about every 15 seconds). * Rearranged the missions in the config to look prettier. Don't judge. * Added the "Zamak", "Tempest", and "HEMMT" to "DMS_TransportTrucks" array. Removed "Exile_Car_Van_Black" * "dynamicTextRequest" messages will now appear at the top of the screen, so it shouldn't distract/block stuff in focus. * Fixed some spelling, improved some grammar (will require mission updates, it's really minor though).
This commit is contained in:
parent
8562289765
commit
829943bf65
@ -62,6 +62,7 @@ class CfgFunctions
|
||||
class SpawnBanditMission {};
|
||||
class SpawnCrate {};
|
||||
class SpawnMinefield {};
|
||||
class SpawnPersistentVehicle {};
|
||||
class SpawnNonPersistentVehicle {};
|
||||
class TargetsKilled {};
|
||||
};
|
||||
|
@ -25,6 +25,10 @@ DMS_DEBUG = false;
|
||||
DMS_AI_KillPercent = 100; // The percent amount of AI that need to be killed for "killPercent" mission requirement (NOT IMPLEMENTED)
|
||||
|
||||
/*Mission Marker settings*/
|
||||
DMS_MarkerText_ShowMissionPrefix = true; // Whether or not to place a prefix before the mission marker text. Enable this if your players get confused by the marker names :P
|
||||
DMS_MarkerText_MissionPrefix = "Mission:"; // The text displayed before the mission name in the mission marker.
|
||||
DMS_MarkerText_ShowAICount = true; // Whether or not to display the number of remaining AI in the marker name.
|
||||
DMS_MarkerText_AIName = "Units"; // What the AI will be called in the map marker. For example, the marker text can show: "Car Dealer (3 Units remaining)"
|
||||
DMS_MarkerPosRandomization = false; // Randomize the position of the circle marker of a mission
|
||||
DMS_MarkerPosRandomRadius = [25,100]; // Minimum/Maximum distance that the circle marker position will be randomized | Default: 0 meters to 200 meters
|
||||
DMS_RandomMarkerBrush = "Cross"; // See: https://community.bistudio.com/wiki/setMarkerBrush
|
||||
@ -94,21 +98,22 @@ DMS_DEBUG = false;
|
||||
/*Mission notification settings*/
|
||||
|
||||
DMS_BanditMissionTypes = [ // List of missions with spawn chances. If they add up to 100%, they represent the percentage chance each one will spawn
|
||||
["bandits",25],
|
||||
["bauhaus",25],
|
||||
["beertransport",15],
|
||||
["behindenemylines",10],
|
||||
["blackhawkdown",45],
|
||||
["cardealer",25],
|
||||
["construction",35],
|
||||
["donthasslethehoff",30],
|
||||
["foodtransport",25],
|
||||
["guntransport",20],
|
||||
["bandits",25],
|
||||
["bauhaus",25],
|
||||
["cardealer",25],
|
||||
["humanitarian",25],
|
||||
["lost_battalion",10],
|
||||
["mercenaries",20],
|
||||
["roguenavyseals",15],
|
||||
["foodtransport",25],
|
||||
["walmart",20],
|
||||
["mercenaries",20],
|
||||
["guntransport",20],
|
||||
["beertransport",15],
|
||||
["roguenavyseals",15],
|
||||
["thieves",10],
|
||||
["lost_battalion",10],
|
||||
["behindenemylines",10],
|
||||
["mercbase",5]
|
||||
];
|
||||
|
||||
@ -591,7 +596,9 @@ DMS_DEBUG = false;
|
||||
|
||||
DMS_TransportTrucks = [ // List of transport trucks that can spawn
|
||||
"Exile_Car_Van_Guerilla01",
|
||||
"Exile_Car_Van_Black"
|
||||
"Exile_Car_Zamak",
|
||||
"Exile_Car_Tempest",
|
||||
"Exile_Car_HEMMT"
|
||||
];
|
||||
|
||||
DMS_RefuelTrucks = [ // List of refuel trucks that can spawn
|
||||
|
@ -27,6 +27,20 @@ if(DMS_StaticMission) then
|
||||
if (DMS_DynamicMission) then
|
||||
{
|
||||
DMS_AttemptsUntilThrottle = DMS_AttemptsUntilThrottle + 1;
|
||||
|
||||
DMS_CLIENT_fnc_spawnDynamicText =
|
||||
{
|
||||
[
|
||||
_this,
|
||||
0,
|
||||
safeZoneY,
|
||||
10,
|
||||
1
|
||||
] spawn BIS_fnc_dynamicText;
|
||||
};
|
||||
|
||||
publicVariable "DMS_CLIENT_fnc_spawnDynamicText";
|
||||
|
||||
call compileFinal preprocessFileLineNumbers "\x\addons\dms\missions\mission_init.sqf";
|
||||
execFSM "\x\addons\dms\FSM\missions.fsm";
|
||||
};
|
||||
|
@ -71,7 +71,7 @@ _msgStart = ['#FFFF00',"A heavily armed bandit group has been spotted, take them
|
||||
_msgWIN = ['#0080ff',"Convicts have successfully taken care of the bandit group!"];
|
||||
|
||||
// Define Mission Lose message
|
||||
_msgLOSE = ['#FF0000',"The bandits have taken their vehicle and drove off, no loot today!"];
|
||||
_msgLOSE = ['#FF0000',"The bandits have driven off, no loot today!"];
|
||||
|
||||
// Define mission name (for map markers, mission messages, and logging)
|
||||
_missionName = "Armed Bandits";
|
||||
|
@ -76,13 +76,13 @@ _missionObjs =
|
||||
];
|
||||
|
||||
|
||||
_msgStart = ['#FFFF00',"A Bauhaus truck has crashed and lost all its building supplies, get there quickly!"];
|
||||
_msgStart = ['#FFFF00',"A Bauhaus truck has crashed and lost all its building supplies! Get there quickly!"];
|
||||
|
||||
// Define Mission Win message
|
||||
_msgWIN = ['#0080ff',"Convicts have successfully claimed the crashed Bauhaus truck!"];
|
||||
|
||||
// Define Mission Lose message
|
||||
_msgLOSE = ['#FF0000',"The Bauhaus truck has been repaired and escaped!"];
|
||||
_msgLOSE = ['#FF0000',"The crew have repaired the Bauhaus truck and escaped!"];
|
||||
|
||||
// Define mission name (for map marker and logging)
|
||||
_missionName = "Bauhaus Truck";
|
||||
|
@ -75,7 +75,7 @@ _msgStart = ['#FFFF00',"A transport truck carrying beer and guns is being robbed
|
||||
_msgWIN = ['#0080ff',"Convicts have successfully claimed all of the beer and guns. 'Murica."];
|
||||
|
||||
// Define Mission Lose message
|
||||
_msgLOSE = ['#FF0000',"The robbers have taken off with all the beer and all the guns, what a travesty!"];
|
||||
_msgLOSE = ['#FF0000',"The robbers have taken off with all the beer and all the guns! What a travesty!"];
|
||||
|
||||
// Define mission name (for map marker and logging)
|
||||
_missionName = "Beer N' Guns Truck";
|
||||
|
@ -80,10 +80,10 @@ _missionObjs =
|
||||
];
|
||||
|
||||
// Define Mission Start message
|
||||
_msgStart = ['#FFFF00',"A local car dealership is being robbed by bandits, stop them!"];
|
||||
_msgStart = ['#FFFF00',"A local car dealership is being robbed by bandits. Stop them!"];
|
||||
|
||||
// Define Mission Win message
|
||||
_msgWIN = ['#0080ff',"Convicts have secured the local dealership and removed the bandits!"];
|
||||
_msgWIN = ['#0080ff',"Convicts have secured the local dealership and eliminated the bandits!"];
|
||||
|
||||
// Define Mission Lose message
|
||||
_msgLOSE = ['#FF0000',"The bandits have escaped with the cars and left nothing but a trail of smoke behind!"];
|
||||
|
@ -71,7 +71,7 @@ _missionObjs =
|
||||
];
|
||||
|
||||
// Define Mission Start message
|
||||
_msgStart = ['#FFFF00',"A group of mercenaries have set up a construction site, clear them out!"];
|
||||
_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!"];
|
||||
|
@ -83,13 +83,13 @@ _missionObjs =
|
||||
];
|
||||
|
||||
// Define Mission Start message
|
||||
_msgStart = ['#FFFF00',"KITT has been kidnapped, secure the position and reclaim KITT!"];
|
||||
_msgStart = ['#FFFF00',"KITT has been kidnapped! Secure the position and reclaim KITT!"];
|
||||
|
||||
// Define Mission Win message
|
||||
_msgWIN = ['#0080ff',"Convicts secured KITT, that will show the bandits not to Hassle the Hoff!"];
|
||||
_msgWIN = ['#0080ff',"Convicts secured KITT; that will show the bandits not to Hassle the Hoff!"];
|
||||
|
||||
// Define Mission Lose message
|
||||
_msgLOSE = ['#FF0000',"KITT was never secured and has now been dismantled by the bandits, what a grim fate."];
|
||||
_msgLOSE = ['#FF0000',"KITT was never secured and has now been dismantled by the bandits... What a grim fate."];
|
||||
|
||||
// Define mission name (for map marker and logging)
|
||||
_missionName = "KITT's Location";
|
||||
|
@ -69,10 +69,10 @@ _missionObjs =
|
||||
];
|
||||
|
||||
// Define Mission Start message
|
||||
_msgStart = ['#FFFF00',"A food supply truck has been sized by ruthless bandits, stop them!"];
|
||||
_msgStart = ['#FFFF00',"A food supply truck has been sized by ruthless bandits. Stop them!"];
|
||||
|
||||
// Define Mission Win message
|
||||
_msgWIN = ['#0080ff',"Convicts have successfully claimed the food supplies for themselves!"];
|
||||
_msgWIN = ['#0080ff',"Convicts have successfully claimed the food supplies!"];
|
||||
|
||||
// Define Mission Lose message
|
||||
_msgLOSE = ['#FF0000',"The bandits have taken the food supplies and escaped!"];
|
||||
|
@ -69,13 +69,13 @@ _missionObjs =
|
||||
];
|
||||
|
||||
// Define Mission Start message
|
||||
_msgStart = ['#FFFF00',"A gun transport truck has crashed, secure the crash site and the guns!"];
|
||||
_msgStart = ['#FFFF00',"A gun transport truck has crashed. Secure the crash site!"];
|
||||
|
||||
// Define Mission Win message
|
||||
_msgWIN = ['#0080ff',"Convicts have successfully secured the area and claimed the guns for their own!"];
|
||||
|
||||
// Define Mission Lose message
|
||||
_msgLOSE = ['#FF0000',"The transport truck has been repaired and escaped the area!"];
|
||||
_msgLOSE = ['#FF0000',"The transport truck has been repaired and driven off!"];
|
||||
|
||||
// Define mission name (for map marker and logging)
|
||||
_missionName = "Gun Transport";
|
||||
|
@ -69,7 +69,7 @@ _missionObjs =
|
||||
];
|
||||
|
||||
// Define Mission Start message
|
||||
_msgStart = ['#FFFF00',"A truck carrying humanitarian supplies has been sized by bandits, stop them!"];
|
||||
_msgStart = ['#FFFF00',"A truck carrying humanitarian supplies has been sized by bandits. Stop them!"];
|
||||
|
||||
// Define Mission Win message
|
||||
_msgWIN = ['#0080ff',"Convicts have successfully claimed the humanitarian supplies for themselves!"];
|
||||
|
@ -69,13 +69,13 @@ _missionObjs =
|
||||
];
|
||||
|
||||
// Define Mission Start message
|
||||
_msgStart = ['#FFFF00',"A group of deranged doctors have set up a field hospital, sieze it for your own!"];
|
||||
_msgStart = ['#FFFF00',"A group of deranged doctors have set up a field hospital. Seize it for your own!"];
|
||||
|
||||
// Define Mission Win message
|
||||
_msgWIN = ['#0080ff',"Convicts have claimed the medical supplies for their own!"];
|
||||
|
||||
// Define Mission Lose message
|
||||
_msgLOSE = ['#FF0000',"Hawkeye has ran off with the medical supplies, everything is gone!"];
|
||||
_msgLOSE = ['#FF0000',"Hawkeye has ran off with the medical supplies! Everything is gone!"];
|
||||
|
||||
// Define mission name (for map marker and logging)
|
||||
_missionName = "Deranged Doctors";
|
||||
|
@ -70,7 +70,7 @@ _missionObjs =
|
||||
_msgStart = ['#FFFF00',"A group of mercenaries has been spotted. Kill them and take their equipment!"];
|
||||
|
||||
// Define Mission Win message
|
||||
_msgWIN = ['#0080ff',"Convicts have successfully eliminated the mercenaries"];
|
||||
_msgWIN = ['#0080ff',"Convicts have successfully eliminated the mercenaries!"];
|
||||
|
||||
// Define Mission Lose message
|
||||
_msgLOSE = ['#FF0000',"The mercenaries have escaped and they took all their loot with them!"];
|
||||
|
@ -67,10 +67,10 @@ _missionObjs =
|
||||
];
|
||||
|
||||
// Define Mission Start message
|
||||
_msgStart = ['#FFFF00',"A squad of professional Navy Seals team is performing gorilla warfare in convict land, deal with them!"];
|
||||
_msgStart = ['#FFFF00',"A squad of professional Navy Seals is performing gorilla warfare in convict land. Deal with them!"];
|
||||
|
||||
// Define Mission Win message
|
||||
_msgWIN = ['#0080ff',"Convicts have successfully taken care of the Navy Seals, you must be the top of your class!"];
|
||||
_msgWIN = ['#0080ff',"Convicts have successfully taken care of the Navy Seals. You must be the top of your class!"];
|
||||
|
||||
// Define Mission Lose message
|
||||
_msgLOSE = ['#FF0000',"The Navy Seals have escaped and are now planning their next raid!"];
|
||||
|
149
@ExileServer/addons/a3_dms/missions/bandit/thieves.sqf
Normal file
149
@ExileServer/addons/a3_dms/missions/bandit/thieves.sqf
Normal file
@ -0,0 +1,149 @@
|
||||
/*
|
||||
Sample mission (duplicate for testing purposes)
|
||||
*/
|
||||
|
||||
// For logging purposes
|
||||
_num = DMS_MissionCount;
|
||||
|
||||
|
||||
// Set mission side (only "bandit" is supported for now)
|
||||
_side = "bandit";
|
||||
|
||||
|
||||
// find position
|
||||
_pos =
|
||||
[
|
||||
15,DMS_WaterNearBlacklist,DMS_MaxSurfaceNormal,DMS_SpawnZoneNearBlacklist,DMS_TraderZoneNearBlacklist,DMS_MissionNearBlacklist,DMS_PlayerNearBlacklist,DMS_ThrottleBlacklists
|
||||
]call DMS_fnc_findSafePos;
|
||||
|
||||
|
||||
// Set general mission difficulty
|
||||
_difficulty = "easy";
|
||||
|
||||
|
||||
// Create AI
|
||||
// TODO: Spawn AI only when players are nearby
|
||||
_AICount = 3 + (round (random 1));
|
||||
|
||||
_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;
|
||||
|
||||
|
||||
_class = (DMS_MilitaryVehicles+DMS_TransportTrucks) call BIS_fnc_SelectRandom;
|
||||
|
||||
//DMS_fnc_SpawnPersistentVehicle will automatically turn the pincode into a string and format it.
|
||||
_pinCode = round (random 9999);
|
||||
|
||||
_vehicle = [_class,_pos,_pinCode] call DMS_fnc_SpawnPersistentVehicle;
|
||||
|
||||
|
||||
|
||||
// Define mission-spawned AI Units
|
||||
_missionAIUnits =
|
||||
[
|
||||
_group // We only spawned the single group for this mission
|
||||
];
|
||||
|
||||
// Define mission-spawned objects
|
||||
_missionObjs =
|
||||
[
|
||||
[], // No spawned buildings
|
||||
[_vehicle],
|
||||
[]
|
||||
];
|
||||
|
||||
// Define Mission Start message
|
||||
_msgStart = ['#FFFF00',format ["A band of thieves are attempting to break into a %1. Eliminate them and you might get the car for yourself!",getText (configFile >> "CfgVehicles" >> _class >> "displayName")]];
|
||||
|
||||
// Define Mission Win message
|
||||
_msgWIN = ['#0080ff',format ["Convicts have eliminated the thieves! Looks like the thieves managed to figure out that the code was %1...",_pinCode]];
|
||||
|
||||
// Define Mission Lose message
|
||||
_msgLOSE = ['#FF0000',"The thieves cracked the code and drove off!"];
|
||||
|
||||
// Define mission name (for map markers, mission messages, and logging)
|
||||
_missionName = "Car Thieves";
|
||||
|
||||
// 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,
|
||||
true
|
||||
],
|
||||
[
|
||||
"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
|
||||
{
|
||||
diag_log format ["DMS_DEBUG MISSION: (%1) :: Mission #%2 started at %3 with %4 AI units and %5 difficulty at time %6",_missionName,_num,_pos,_AICount,_difficulty,_time];
|
||||
};
|
@ -72,13 +72,13 @@ _missionObjs =
|
||||
];
|
||||
|
||||
// Define Mission Start message
|
||||
_msgStart = ['#FFFF00',"A local Walmart shop is being raided, stop the raiders and take the loot!"];
|
||||
_msgStart = ['#FFFF00',"A local Walmart shop is being raided. Stop the raiders and take the loot!"];
|
||||
|
||||
// Define Mission Win message
|
||||
_msgWIN = ['#0080ff',"Convicts have done a good deed and stopped the raiders!"];
|
||||
|
||||
// Define Mission Lose message
|
||||
_msgLOSE = ['#FF0000',"The raiders has looted everything from Walmart and escaped!"];
|
||||
_msgLOSE = ['#FF0000',"The raiders have looted everything from Walmart and escaped!"];
|
||||
|
||||
// Define mission name (for map marker and logging)
|
||||
_missionName = "Walmart Riot";
|
||||
|
@ -188,6 +188,11 @@ try
|
||||
DMS_Mission_Arr pushBack _arr;
|
||||
_added = true;
|
||||
|
||||
if (DMS_MarkerText_ShowAICount) then
|
||||
{
|
||||
_markerDot setMarkerText (format ["%1 (%2 %3 remaining)",markerText _markerDot,count _units,DMS_MarkerText_AIName]);
|
||||
};
|
||||
|
||||
if (DMS_DEBUG) then
|
||||
{
|
||||
diag_log format ["DMS_DEBUG AddMissionToMonitor :: Added |%1| to DMS_Mission_Arr!",_arr];
|
||||
|
@ -57,16 +57,15 @@ if ((typeName _message) != "STRING") then
|
||||
|
||||
case "dynamictextrequest":
|
||||
{
|
||||
//Unfortunately that doesn't work, so I have to do some funky stuff...
|
||||
//[_x, [format ["%1<br/>%2",toUpper _missionName,_message], 0, DMS_dynamicText_Size, DMS_dynamicText_Color]] call ExileServer_system_network_send_broadcast;
|
||||
|
||||
(format
|
||||
[
|
||||
format ['<t color="%1" size="1" >%2</t><br/><t color="%3" size="%4" >%5</t>',_titleColor,_missionName,DMS_dynamicText_Color,DMS_dynamicText_Size,_message],
|
||||
0,
|
||||
0,
|
||||
10,
|
||||
1
|
||||
] remoteExec ["BIS_fnc_dynamicText", -2];
|
||||
'<t color="%1" size="1" >%2</t><br/><t color="%3" size="%4" >%5</t>',
|
||||
_titleColor,
|
||||
_missionName,
|
||||
DMS_dynamicText_Color,
|
||||
DMS_dynamicText_Size,_message
|
||||
])
|
||||
remoteExecCall ["DMS_CLIENT_fnc_spawnDynamicText", -2];
|
||||
};
|
||||
|
||||
default { diag_log format ["DMS ERROR :: Unsupported Notification Type in DMS_PlayerNotificationTypes: %1 | Calling parameters: %2",_x,_this]; };
|
||||
|
@ -66,6 +66,12 @@ _dot setMarkerType "mil_dot";
|
||||
_dot setMarkerText _text;
|
||||
|
||||
missionNamespace setVariable [format ["%1_pos",_dot], _pos];
|
||||
missionNamespace setVariable [format ["%1_text",_dot], _text];
|
||||
|
||||
if (DMS_MarkerText_ShowMissionPrefix) then
|
||||
{
|
||||
_dot setMarkerText (format ["%1 %2",DMS_MarkerText_MissionPrefix,_text]);
|
||||
};
|
||||
|
||||
if (_randomMarker) then
|
||||
{
|
||||
|
@ -66,10 +66,28 @@ private ["_pos", "_success", "_timeStarted", "_timeUntilFail", "_units", "_build
|
||||
_arr = DMS_Mission_Arr deleteAt _forEachIndex;
|
||||
|
||||
{
|
||||
_x lock 1;
|
||||
_x allowDamage true;
|
||||
_x enableRopeAttach true;
|
||||
_x enableSimulationGlobal true;
|
||||
|
||||
if (_x getVariable ["ExileIsPersistent", false]) then
|
||||
{
|
||||
_x lock 0;
|
||||
_x setVariable ["ExileIsLocked",0];
|
||||
|
||||
_x setVariable ["ExileLastLockToggleAt", time];
|
||||
_x setVariable ["ExileAccessDenied", false];
|
||||
_x setVariable ["ExileAccessDeniedExpiresAt", 0];
|
||||
|
||||
// NOW we save the vehicle in the database, since we know we're not deleting this vehicle.
|
||||
_x call ExileServer_object_vehicle_database_insert;
|
||||
_x call ExileServer_object_vehicle_database_update;
|
||||
}
|
||||
else
|
||||
{
|
||||
_x lock 1;
|
||||
};
|
||||
|
||||
_x call ExileServer_system_simulationMonitor_addVehicle;
|
||||
} forEach _vehs;
|
||||
|
||||
@ -90,6 +108,9 @@ private ["_pos", "_success", "_timeStarted", "_timeUntilFail", "_units", "_build
|
||||
throw format ["Mission (%1) Success at %2 with message %3.",_missionName,_pos,_msgWIN];
|
||||
};
|
||||
|
||||
if ((diag_tickTime-_timeStarted)>_timeUntilFail) then
|
||||
{
|
||||
// Check to see if the timeout should be extended before ending the mission.
|
||||
if (DMS_MissionTimeoutReset && {[_pos,DMS_MissionTimeoutResetRange] call DMS_fnc_IsPlayerNearby}) then
|
||||
{
|
||||
_x set [2,[diag_tickTime,_timeUntilFail]];
|
||||
@ -97,8 +118,7 @@ private ["_pos", "_success", "_timeStarted", "_timeUntilFail", "_units", "_build
|
||||
throw format ["Mission Timeout Extended at %1 with timeout after %2 seconds. Position: %3",diag_tickTime,_timeUntilFail,_pos];
|
||||
};
|
||||
|
||||
if ((diag_tickTime-_timeStarted)>_timeUntilFail) then
|
||||
{
|
||||
|
||||
//Nobody is nearby so just cleanup objects from here
|
||||
_cleanupList = (_units+_buildings+_vehs);
|
||||
|
||||
@ -125,6 +145,21 @@ private ["_pos", "_success", "_timeStarted", "_timeUntilFail", "_units", "_build
|
||||
|
||||
throw format ["Mission (%1) Fail at %2 with message %3.",_missionName,_pos,_msgLose];
|
||||
};
|
||||
|
||||
if (DMS_MarkerText_ShowAICount) then
|
||||
{
|
||||
private ["_dot", "_text"];
|
||||
|
||||
_dot = _markers select 0;
|
||||
_text = missionNamespace getVariable [format ["%1_text",_dot],_missionName];
|
||||
|
||||
if (DMS_MarkerText_ShowMissionPrefix) then
|
||||
{
|
||||
_text = format ["%1 %2",DMS_MarkerText_MissionPrefix,_text];
|
||||
};
|
||||
|
||||
_dot setMarkerText (format ["%1 (%2 %3 remaining)",_text,{alive _x} count _units,DMS_MarkerText_AIName]);
|
||||
};
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
@ -12,11 +12,12 @@
|
||||
] call DMS_fnc_RemoveMarkers;
|
||||
*/
|
||||
|
||||
private ["_markerDot","_markerCircle","_status"];
|
||||
private ["_markerDot", "_markerCircle", "_status", "_text"];
|
||||
|
||||
_markerDot = _this select 0 select 0;
|
||||
_markerCircle = _this select 0 select 1;
|
||||
_status = _this select 1;
|
||||
_text = missionNamespace getVariable [format ["%1_text",_markerDot],markerText _markerDot];
|
||||
|
||||
|
||||
if (DMS_DEBUG) then
|
||||
@ -27,6 +28,7 @@ if (DMS_DEBUG) then
|
||||
|
||||
deleteMarker _markerCircle;
|
||||
missionNamespace setVariable [format ["%1_pos",_markerDot], nil];
|
||||
missionNamespace setVariable [format ["%1_text",_markerDot], nil];
|
||||
|
||||
if (_status == "win") then
|
||||
{
|
||||
@ -34,7 +36,7 @@ if (_status == "win") then
|
||||
{
|
||||
deleteMarker _markerDot;
|
||||
};
|
||||
_markerDot setMarkerText ("COMPLETED: "+markerText _markerDot);
|
||||
_markerDot setMarkerText ("COMPLETED: "+_text);
|
||||
_markerDot setMarkerColor DMS_MissionMarkerWinDotColor;
|
||||
//_markerDot spawn {sleep DMS_MissionMarkerWinDotTime;deleteMarker _this;};
|
||||
[DMS_MissionMarkerWinDotTime, {deleteMarker _this;}, _markerDot, false] call ExileServer_system_thread_addTask;
|
||||
@ -49,7 +51,7 @@ else
|
||||
{
|
||||
deleteMarker _markerDot;
|
||||
};
|
||||
_markerDot setMarkerText ("FAILED: "+markerText _markerDot);
|
||||
_markerDot setMarkerText ("FAILED: "+_text);
|
||||
_markerDot setMarkerColor DMS_MissionMarkerLoseDotColor;
|
||||
//_markerDot spawn {sleep DMS_MissionMarkerLoseDotTime;deleteMarker _this;};
|
||||
[DMS_MissionMarkerLoseDotTime, {deleteMarker _this;}, _markerDot, false] call ExileServer_system_thread_addTask;
|
||||
|
103
@ExileServer/addons/a3_dms/scripts/fn_SpawnPersistentVehicle.sqf
Normal file
103
@ExileServer/addons/a3_dms/scripts/fn_SpawnPersistentVehicle.sqf
Normal file
@ -0,0 +1,103 @@
|
||||
/*
|
||||
DMS_fnc_SpawnPersistentVehicle
|
||||
Created by eraser1
|
||||
|
||||
Usage:
|
||||
[
|
||||
_vehicleClass, // STRING: Vehicle classname to spawn.
|
||||
_pos, // ARRAY (positionATL or position2d): Where the vehicle will be spawned (strict)
|
||||
_pinCode // STRING or NUMBER: String has to be 4 digits. Number has to be between 0-9999, and will be automatically formatted.
|
||||
] call DMS_fnc_SpawnPersistentVehicle;
|
||||
|
||||
Returns the created vehicle object.
|
||||
*/
|
||||
|
||||
|
||||
private ["_vehicleClass", "_pos", "_pinCode", "_vehObj"];
|
||||
|
||||
_OK = params
|
||||
[
|
||||
["_vehicleClass","",[""]],
|
||||
["_pos",[],[[]],[2,3]],
|
||||
["_pinCode","",[0,""]]
|
||||
];
|
||||
|
||||
_vehObj = objNull;
|
||||
|
||||
try
|
||||
{
|
||||
if (!_OK) then
|
||||
{
|
||||
throw (format ["invalid parameters: %1",_this]);
|
||||
};
|
||||
|
||||
|
||||
if ((count _pos) isEqualTo 2) then
|
||||
{
|
||||
_pos set [2,0];
|
||||
};
|
||||
|
||||
|
||||
if ((typeName _pinCode)=="SCALAR") then
|
||||
{
|
||||
if (_pinCode<0 || {_pinCode>9999}) then
|
||||
{
|
||||
throw (format ["invalid SCALAR _pinCode value (must be between 0 and 9999): %1",_pinCode]);
|
||||
};
|
||||
|
||||
switch (true) do
|
||||
{
|
||||
case (_pinCode<10):
|
||||
{
|
||||
_pinCode = format ["000%1",_pinCode];
|
||||
};
|
||||
|
||||
case (_pinCode<100):
|
||||
{
|
||||
_pinCode = format ["00%1",_pinCode];
|
||||
};
|
||||
|
||||
case (_pinCode<1000):
|
||||
{
|
||||
_pinCode = format ["0%1",_pinCode];
|
||||
};
|
||||
|
||||
default
|
||||
{
|
||||
_pinCode = str _pinCode;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
if ((count _pinCode)!=4) then
|
||||
{
|
||||
throw (format ["invalid STRING _pinCode value (must be 4 digits): %1",_pinCode]);
|
||||
};
|
||||
|
||||
// Create and set the vehicle
|
||||
_vehObj = [_vehicleClass,_pos] call DMS_fnc_SpawnNonPersistentVehicle;
|
||||
_vehObj setPosATL _pos;
|
||||
|
||||
// Set up EHs
|
||||
_vehObj addEventHandler ["GetOut", { _this call ExileServer_object_vehicle_event_onGetOut}];
|
||||
_vehObj addMPEventHandler ["MPKilled", { _this call ExileServer_object_vehicle_event_onMPKilled}];
|
||||
|
||||
// Set up vars
|
||||
_vehObj setVariable ["ExileIsPersistent", true];
|
||||
_vehObj setVariable ["ExileAccessCode", _pinCode];
|
||||
_vehObj setVariable ["ExileOwnerUID", "76561198027700602"]; // That is my (eraser1's) PUID. Just so you don't think I'm trying to be sneaky...
|
||||
|
||||
// Deny access until specified to do so.
|
||||
_vehObj setVariable ["ExileIsLocked",-1];
|
||||
_vehObj setVariable ["ExileLastLockToggleAt", time];
|
||||
_vehObj setVariable ["ExileAccessDenied", true];
|
||||
_vehObj setVariable ["ExileAccessDeniedExpiresAt", 999999];
|
||||
}
|
||||
catch
|
||||
{
|
||||
diag_log format ["DMS ERROR :: Calling DMS_fnc_SpawnPersistentVehicle with %1!",_exception];
|
||||
};
|
||||
|
||||
|
||||
|
||||
_vehObj
|
Binary file not shown.
17
README.md
17
README.md
@ -52,6 +52,23 @@ if (!hasInterface && !isServer) then
|
||||
|
||||
|
||||
## Changelog:
|
||||
#### October 4, 2015 (10:30 PM CST-America):
|
||||
* **NEW CONFIG VALUES**:
|
||||
|
||||
|DMS_MarkerText_ShowMissionPrefix|
|
||||
|DMS_MarkerText_MissionPrefix|
|
||||
|DMS_MarkerText_ShowAICount|
|
||||
|DMS_MarkerText_AIName|
|
||||
* New function: DMS_fnc_SpawnPersistentVehicle. It will spawn inaccessible vehicles by default and convert VALID pincode inputs to the proper format.
|
||||
* New mission: "Car Thieves" (thieves.sqf). It uses the new DMS_fnc_SpawnPersistentVehicle. When the mission is completed successfully, the code is displayed in the completion message.
|
||||
* You can now add a "prefix" to the marker text of each mission.
|
||||
* You can now display the number of remaining AI in the marker text (it should update about every 15 seconds).
|
||||
* Rearranged the missions in the config to look prettier. Don't judge.
|
||||
* Added the "Zamak", "Tempest", and "HEMMT" to "DMS_TransportTrucks" array. Removed "Exile_Car_Van_Black"
|
||||
* "dynamicTextRequest" messages will now appear at the top of the screen, so it shouldn't distract/block stuff in focus.
|
||||
* Fixed some spelling, improved some grammar (will require mission updates, it's really minor though).
|
||||
|
||||
|
||||
#### October 3, 2015 (10:30 PM CST-America):
|
||||
* **You must update all of your mission files; the mission message system as well as the calling parameters for DMS_fnc_FindSafePos have been overhauled and will be incompatible with previous versions.**
|
||||
* NEW CONFIG VALUES:
|
||||
|
Loading…
Reference in New Issue
Block a user