• 0
Uncle.Biddle

DMS Static mission kill percent not working.

Question

So I am unable to get the kill percent function to work for dms on a static mission that I have for our server. I am unsure on how to implement this function in the script for the mission. Here is what I have so far.

Spoiler

/*
    Skalisty Castle
    wernerz

NOTE: Yo this shit just works
*/

// For logging purposes
_num = DMS_MissionCount;


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

_pos = [13686.5,2874.51,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 =
[
[13339.276, 2757.524, 0],
[13418.875, 2801.5, 0],
[13500.842, 2895.169, 0],
[13441.342, 3050.217, 0],
[13274.625, 3080.125, 0],
[13138.625, 3133, 0],
[13511.25, 3339.875, 0],
[13657.522, 3204.537, 0],
[13769.162, 3061.094, 0],
[14015.24, 2966.217, 0],
[14013, 2752.5, 0],
[13745.423, 2907.166, 0],
[13682.344, 2856.94, 0],
[13676.25, 2917.125, 0],
[13659.875, 2974.25, 0]
];

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


_group =
[
    _AISoldierSpawnLocations+[_pos,_pos,_pos],
    _AICount,
    _difficulty,
    "random",
    _side
] call DMS_fnc_SpawnAIGroup_MultiPos;


_staticGuns =
[
    [
    [13598.4, 2918.24, 0],
    [13596.7, 2931.94, 0],
    [13642.2, 3053.48, 0],
    [13657.4, 3055.99, 0],
    [13782.375, 2899.375, 0],
    [13784.75, 2906.5, 0],
    [13361.5, 2826, 0],
    [13443.156, 2941.767, 0],
    [13166.463, 3354.826, 3.064],
    [13133.789, 3343.181, 3]
    ],
    _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 =
[
    [[13733.2,2907.872,0.5],"B_CargoNet_01_ammo_F"],
    [[13703.427,2858.627,0.5],"B_CargoNet_01_ammo_F"],
    [[13662.138,2985.017,0.5],"B_CargoNet_01_ammo_F"],
    [[13664,2915.375,0.5],"B_CargoNet_01_ammo_F"],
    [[13691.625,2917.375,0.5],"B_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;

_rareLootChance = [DMS_RareLootChance];

_killPercent = [DMS_AI_KillPercent];

// Disable smoke on the crates so that the players have to search for them >:D
{
    _x setVariable ["DMS_AllowSmoke", true];
} 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 =
[
    [
        [13699.7,2976.9,0]
    ],
    _group,
    "assault",
    _difficulty,
    _side,
    "CUP_B_MH60S_FFV_USMC"
] call DMS_fnc_SpawnAIVehicle;


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


// 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,5]],[_crate1,[10,150,5]]]
];

// Define Mission Start message
_msgStart = ['#FFFF00', "Shit son!!! A group of mercenaries have setup base at Skalisty Castle and are fucking the shit out of you mom."];

// Define Mission Win message
_msgWIN = ['#0080ff',"A group of mama's boys have rescued there mothers and taken some loot!"];

// Define Mission Lose message
_msgLOSE = ['#FF0000',"Seems like the mercenaries got bored and left the castle, taking your mom with them..."];

// Define mission name (for map marker and logging)
_missionName = "Skalisty Castle";

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

(_markers select 1) setMarkerSize [50,50];

// 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]
        ]
    ],
    _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;
};

 

Edited by Uncle.Biddle

Share this post


Link to post
Share on other sites

6 answers to this question

  • 0
14 hours ago, Uncle.Biddle said:

// Parse and add mission info to missions monitor
_added =
[
    _pos,
    [
        [
            "kill",
            _group
        ],

I think "kill" should be "killpercent"

Share this post


Link to post
Share on other sites
  • 0

I'm not sure the  DMS_AI_KillPercent  feature is actually functional yet. I was looking at this the other day, trying to see if there was a way to display remaining AI percentage instead of actual remaining AI numbers on a mission. The only reference I found to  DMS_AI_KillPercent was in the config.sqf, which tells me that it's probably not complete yet. I'm sure @eraser1 could correct me if I am wrong.

Share this post


Link to post
Share on other sites
Advertisement
  • 0
8 hours ago, Kurewe said:

I'm not sure the  DMS_AI_KillPercent  feature is actually functional yet. I was looking at this the other day, trying to see if there was a way to display remaining AI percentage instead of actual remaining AI numbers on a mission. The only reference I found to  DMS_AI_KillPercent was in the config.sqf, which tells me that it's probably not complete yet. I'm sure @eraser1 could correct me if I am wrong.

Kill percent is  a function that completes the mission after a certain percent of AI have been killed in the mission. It is functional I have encountered it in other servers as a function for there static missions. ADK is one example

Share this post


Link to post
Share on other sites
  • 0
1 hour ago, Uncle.Biddle said:

Kill percent is  a function that completes the mission after a certain percent of AI have been killed in the mission. It is functional I have encountered it in other servers as a function for there static missions. ADK is one example

I understand what kill percent is supposed to be. However, if you look at the DMS code, you will see a couple things that support my previous statement. Don't get me wrong, I'm not trying to be argumentative. I'm only pointing out why it's not working.

Doing a "Containing Text" search for "percent" on the entire DMS folder, there are only 2 references to this function in the DMS files. One indicates "(NOT IMPLEMENTED)" and the other "//<---TODO". There is no fn_TargetsKilledPercent.sqf to support the Killed Percent function. While I don't doubt that another server run by someone who has some coding abilities may have figured out how to implement this function on their own, it does not yet appear to be a complete function of DMS by default. Maybe have a chat with the person that runs ADK to see how they did it?

In the config.sqf:

DMS_AI_KillPercent = 100; // The percent amount of AI that need to be killed for "killPercent" mission requirement (NOT IMPLEMENTED)

In the fn_MissionSuccessState.sqf:

			case "killpercent":
			{
				_success = _completionArgs call DMS_fnc_TargetsKilledPercent;//<---TODO
			};
			*/

 

Share this post


Link to post
Share on other sites
  • 0
13 hours ago, red_ned said:

I think "kill" should be "killpercent"

19:22:55 Error in expression <private _arr =
[
_pos,
_completionInfo,
_groupReinforcementsInfo,
[
_timeStarted>
19:22:55   Error position: <_groupReinforcementsInfo,
[
_timeStarted>
19:22:55   Error Undefined variable in expression: _groupreinforcementsinfo
19:22:55 File \x\addons\dms\scripts\fn_AddMissionToMonitor_Static.sqf [DMS_fnc_AddMissionToMonitor_Static], line 165
19:22:55 Error in expression <Near",
[_pos,DMS_playerNearRadius]
]
],
_groupReinforcementsInfo,
[
_time,
DMS_S>
19:22:55   Error position: <_groupReinforcementsInfo,
[
_time,
DMS_S>
19:22:55   Error Undefined variable in expression: _groupreinforcementsinfo
19:22:55 File x\addons\DMS\missions\static\SkalistyCastle.sqf, line 182
19:22:56 "DMS ERROR :: Invalid completion type (killpercent) with args: O Alpha 1-1"
19:22:56 Error in expression <fo deleteAt _forEachIndex;
};
} forEach _groupReinforcementsInfo;
};

 

 
if !(_onM>
19:22:56   Error position: <_groupReinforcementsInfo;
};

 

that is the error i get when I try that method.

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.