Jump to content
chernaruski

DMS - Defent's Mission System

Recommended Posts

Hi all! I am trying to setup a position array for a static DMS mission. Here is the current code for the mission; I am not sure what to comment out and how to arrange the _pos code for the dozens of coords I have.

 

Spoiler

/*
    Sample mission
    Created by Defent and eraser1

    Called from DMS_selectMission
*/

private ["_num", "_group", "_pos", "_side", "_OK", "_difficulty", "_AICount", "_type", "_launcher", "_crate1", "_wreck", "_crate_loot_values1", "_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 =
    [
        [10,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.
// This mission doesn't use "_extraParams" in any way currently.
_OK = (_this call DMS_fnc_MissionParams) params
[
    ["_pos",[],[[]],[3]],
    ["_extraParams",[]]
];

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


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


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

_group =
[
    _pos,                    // Position of AI
    _AICount,                // Number of AI
    "random",                // "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 Crates
_crate1 = ["Box_NATO_Wps_F",_pos] call DMS_fnc_SpawnCrate;

_wreck = createVehicle ["Land_Wreck_Van_F",[(_pos select 0) - 10, (_pos select 1),-0.2],[], 0, "CAN_COLLIDE"];

// Set crate loot values
_crate_loot_values1 =
[
    8,        // Weapons
    [10,["Exile_Item_Beer"]],        // Items
    1         // 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 =
[
    [_wreck],
    [],
    [[_crate1,_crate_loot_values1]]
];

// Define Mission Start message
//_msgStart = ['#FFFF00',"A transport truck carrying beer and guns is being robbed, stop the robbers and steal the loot!"];

// Define Mission Win message
//_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!"];

// Define mission name (for map marker and logging)
//_missionName = "Beer N' Guns Truck";

// 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;
};
 

 

As always, any help is appreciated. 

Share this post


Link to post
Share on other sites

Your code shown above is not a static mission. This is a dynamic mission (bandit).

Share this post


Link to post
Share on other sites
57 minutes ago, DEH4NK said:

Your code shown above is not a static mission. This is a dynamic mission (bandit).

 

I hadn't realized that, but you are correct. I feel like I remember there being a way to make it static, though. I thought it was something like:

 

_pos = [ [12345,54321,0] , [2345,5432,0] , [76543,3245,0] ];

 

 

Share this post


Link to post
Share on other sites

True for Statik DMS Mission need the position 

_pos = [

//Ai

[12345,54321,0] ,

[2345,5432,0] ,

[76543,3245,0]

 ];

_pos = [

//hmg

[12345,54321,0] ,

[2345,5432,0] ,

[76543,3245,0],

//high posi hmg on exemple Container tower

//not the position from export you need the high from building not from map self 

[12345,54321,17] ,

[2345,5432,17] ,

[76543,3245,17]

 ];

Then need center position, position for the Box and maybe for the vehicle part from loot

Share this post


Link to post
Share on other sites

Sharing my A3DMS Missions for Arma 3 Exile. These Missions are set up to use reinforcements on both static and bandit missions. Working vehicle, helicopter, and foot soldiers when a defined number of AI in a group are killed the reinforcements will come in. The helicopter will fly around as gun ship it will not drop troops If you enable it may or may not work right has a mind of its own when doing pardrops. Take a look at the bandit mission blackHawkDown.sqf, static missions Saltflats.sqf, StoptheMayor.sqf, and Chelonisipower.sqf to see the randomization these have to offer. I run these on my server and players like the randomization because it never plays out the same and they dont get use to the same exact stuff at the missions. If you use dms you cannot use just the missions out of here it will not work you need the scripts folder and the missions folder due to the changes I had to make to 2 scripts and all bandit missions to get this all to work. Also In the blackHawkDown.sqf is specific cordinates put in each pos case and it runs of choosing a mission location off of chordinates you put in there instead of the normal bandit mission random locations. I did this because the buildings for this mission do not work well on hills. the cordinates that are there are for Altis map so if you use another map you need to get cordinates put in where you want possible spawns to be. https://github.com/Crito-VanaheimServers/Reworked-A3DMS-Missions

  • Like 2

Share this post


Link to post
Share on other sites

Updated on Github I replaced the sqf with the original version because I forgot the one provided is one I use on my server and has a bunch of RHS loot that will probably thorw errors if you are not using RHS.

Share this post


Link to post
Share on other sites

×