Fixed issue with kills made from vehicle not registering

This commit is contained in:
Chris Cardozo 2019-05-21 07:42:10 -04:00
parent ad4d66e386
commit a531fdc71d
13 changed files with 234 additions and 122 deletions

View File

@ -0,0 +1,20 @@
Added new settings to blck_config.sqf and blck_config_mil.sqf
1.
// global settings for this parameters
// Determine the number of crew plus driver per vehicle; excess crew are ignored.
// This can be a value or array of [_min, _max];
blck_vehCrew_blue = 3;
blck_vehCrew_red = 3;
blck_vehCrew_green = 3;
blck_vehCrew_orange = 3;
You can also define this value in missions by adding the following variable definition to the mission template:
_vehicleCrewCount = 3 //
2.
lists of items to be excluded from dynamically generated loadouts has been moved to:
blck_config.sqf
blck_config_mil.sqf

View File

@ -2,11 +2,11 @@
Credit for this method goes to He-Man who first suggested it. Credit for this method goes to He-Man who first suggested it.
*/ */
//diag_log format["_fnc_giveTakeCrypto: _this = %1",_this]; //diag_log format["_fnc_giveTakeCrypto: _this = %1",_this];
//_object = _this select 0; _object = _this select 0;
//diag_log format["_giveTakeCrypto: _object data = %1 | _object = %2",_object call BIS_fnc_objectType, _object]; diag_log format["_giveTakeCrypto: _object data = %1 | _object = %2",_object call BIS_fnc_objectType, _object];
if (_object isKindOf "Man") then if (_object isKindOf "Man") then
{ {
(_this select 0) call EPOCH_server_effectCrypto; _this call EPOCH_server_effectCrypto;
}; };

View File

@ -54,6 +54,7 @@ if (isNil "_paraLootCounts") then {_paraLootCounts = blck_lootCountsRed}; //
if (isNil "_missionLootVehicles") then {_missionLootVehicles = []}; if (isNil "_missionLootVehicles") then {_missionLootVehicles = []};
if (isNil "_garrisonedBuilding_ATLsystem") then {_garrisonedBuilding_ATLsystem = []}; if (isNil "_garrisonedBuilding_ATLsystem") then {_garrisonedBuilding_ATLsystem = []};
if (isNil "_garrisonedBuildings_BuildingPosnSystem") then {_garrisonedBuildings_BuildingPosnSystem = []}; if (isNil "_garrisonedBuildings_BuildingPosnSystem") then {_garrisonedBuildings_BuildingPosnSystem = []};
if (isNil "_vehicleCrewCount") then {_vehicleCrewCount = [_aiDifficultyLevel] call GMS_fnc_selectVehicleCrewCount};
_objects = []; _objects = [];
_mines = []; _mines = [];

View File

@ -0,0 +1,11 @@
params["_diff"];
private ["_count"];
switch (toLower(_diff)) do
{
case "blue": {_count = blck_vehCrew_blue};
case "red": {_count = blck_vehCrew_red};
case "green": {_count = blck_vehCrew_green};
case "orange": {_count = blck_vehCrew_orange};
};
_count

View File

@ -12,34 +12,22 @@
*/ */
#include "\q\addons\custom_server\Configs\blck_defines.hpp"; #include "\q\addons\custom_server\Configs\blck_defines.hpp";
params["_unit","_killer"]; _fn_doUpdates = {
private _player = _killer;
diag_log format["_fnc_handlePlayerUpdates: typeOf (vehicle _killer) = %2 | vehicle(_killer) isKindOf Man = %1",(vehicle _killer) isKindOf "Man",typeOf (vehicle _killer)];
diag_log format[" : uid _killer = %1 | netID _killer = %2 | netID vehicle(_killer) = %3",if(isPlayer _killer) then {getPlayerUID _killer} else {-1},netID _killer,netID (vehicle(_killer))];
private _killerType = _killer call BIS_fnc_objectType; // anObject call BIS_fnc_objectType
private _killerVehicleType = (vehicle _killer) call BIS_fnc_objectType;
diag_log format["_killerType = %1 | _killerVehicleType = %2",_killerType,_killerVehicleType];
if (_killerType select 0 isEqualTo "Vehicle") then
{
{
if (_x isEqualTo _killer) exitWith {_player = _x};
}forEach (crew (vehicle _killer));
diag_log format["_fnc_handlePlayerUpdates:[find crew slot of player] _killer = %1 | _player set to %2 | vehicle _player = %3",_killer,_player,vehicle _player];
};
private _playerType = _player call BIS_fnc_objectType;
diag_log format["(35)_fnc_handlePlayerUpdates: _playerType = %1 | _player set to %2 | vehicle _player = %3",_playerType,_player,vehicle _player];
private _lastkill = _player getVariable["blck_lastkill",diag_tickTime];
_player setVariable["blck_lastkill",diag_tickTime];
private _kills = (_player getVariable["blck_kills",0]) + 1;
if ((diag_tickTime - _lastkill) < 240) then
{
_player setVariable["blck_kills",_kills];
} else {
_player setVariable["blck_kills",0];
};
if (toLower(blck_modType) isEqualTo "epoch") then params["_player"];
{
private _lastkill = _player getVariable["blck_lastkill",diag_tickTime];
_player setVariable["blck_lastkill",diag_tickTime];
private _kills = (_player getVariable["blck_kills",0]) + 1;
if ((diag_tickTime - _lastkill) < 240) then
{
_player setVariable["blck_kills",_kills];
} else {
_player setVariable["blck_kills",0];
};
if (toLower(blck_modType) isEqualTo "epoch") then
{
#define maxReward 2500 #define maxReward 2500
private _distanceBonus = floor((_unit distance _player)/100); private _distanceBonus = floor((_unit distance _player)/100);
private _killstreakBonus = 3 * (_player getVariable["blck_kills",0]); private _killstreakBonus = 3 * (_player getVariable["blck_kills",0]);
@ -51,9 +39,9 @@ if (toLower(blck_modType) isEqualTo "epoch") then
{ {
[["showScore",[_reward,"",_kills],""],[_player]] call blck_fnc_messageplayers; [["showScore",[_reward,"",_kills],""],[_player]] call blck_fnc_messageplayers;
}; };
}; };
if (toLower(blck_modType) isEqualTo "exile") then if (toLower(blck_modType) isEqualTo "exile") then
{ {
private _distanceBonus = floor((_unit distance _player)/100); private _distanceBonus = floor((_unit distance _player)/100);
private _killstreakBonus = 3 * (_player getVariable["blck_kills",0]); private _killstreakBonus = 3 * (_player getVariable["blck_kills",0]);
private _respectGained = 25 + _distanceBonus + _killstreakBonus; private _respectGained = 25 + _distanceBonus + _killstreakBonus;
@ -70,9 +58,9 @@ if (toLower(blck_modType) isEqualTo "exile") then
{ {
[["showScore",[_respectGained,_distanceBonus,_kills]], [_player]] call blck_fnc_messageplayers; [["showScore",[_respectGained,_distanceBonus,_kills]], [_player]] call blck_fnc_messageplayers;
}; };
}; };
if (blck_useKillMessages) then if (blck_useKillMessages) then
{ {
private _weapon = currentWeapon _player; private _weapon = currentWeapon _player;
_killstreakMsg = format[" %1X KILLSTREAK",_kills]; _killstreakMsg = format[" %1X KILLSTREAK",_kills];
private["_message"]; private["_message"];
@ -84,4 +72,40 @@ if (blck_useKillMessages) then
}; };
_message =_message + _killstreakMsg; _message =_message + _killstreakMsg;
[["aikilled",_message,"victory"],allPlayers] call blck_fnc_messageplayers; [["aikilled",_message,"victory"],allPlayers] call blck_fnc_messageplayers;
};
}; };
params["_unit","_killer"];
//diag_log format["_fnc_handlePlayerUpdates: typeOf (vehicle _killer) = %2 | vehicle(_killer) isKindOf Man = %1",(vehicle _killer) isKindOf "Man",typeOf (vehicle _killer)];
//diag_log format[" : uid _killer = %1 | netID _killer = %2 | netID vehicle(_killer) = %3",if(isPlayer _killer) then {getPlayerUID _killer} else {-1},netID _killer,netID (vehicle(_killer))];
private _killerType = _killer call BIS_fnc_objectType; // anObject call BIS_fnc_objectType
private _killerVehicleType = (vehicle _killer) call BIS_fnc_objectType;
diag_log format["_fnc_handlePlayerUpdates (84): _killerType = %1 | _killerVehicleType = %2",_killerType,_killerVehicleType];
if ((_killerType select 0 )isEqualTo "Vehicle") then
{
{
_vehicle = vehicle _killer;
_crew = crew _vehicle;
//_player = (crew (vehicle _killer)) select ((crew (vehicle(_killer))) find _killer);
_player = _killer;
//diag_log format["_fnc_handlePlayerUpdates (91): _killer = %1 | vehicle _killer = 2 | _player = %3 | vehicle _player = %4 | _crew = %5",_killer,vehicle _killer,_player,vehicle _player,_crew];
diag_log format["_fnc_handlePlayerUpdates (93): _x = %1 | vehicle _player = %2 | _objectType _x = %3 | _x isKindOf mann = %4 | getPlayerUID(_x) isEqualTo getPlayerUID(_killer) = %5 | crew (vehicle _killer) find _killer = %6 ",
_x,
vehicle _killer,
[_x] call BIS_fnc_objectType,
(_x isKindOf "Man"),
getPlayerUID(_x) isEqualTo getPlayerUID(_killer),
crew (vehicle _killer) find _killer
];
if (getPlayerUID(_x) isEqualTo getPlayerUID(_killer)) exitWith {
diag_log format["_fnc_handlePlayerUpdates (90): _x = %1 | vehicle _player = %2 | _objectType %3 | _x isKindOf mann = %4",_x,vehicle _killer, [_x] call BIS_fnc_objectType,(_x isKindOf "Man")];
[_x] call _fn_doUpdates;
};
}forEach (crew (vehicle _killer));
} else {
[_killer] call _fn_doUpdates;
};

View File

@ -15,7 +15,7 @@
#include "\q\addons\custom_server\Configs\blck_defines.hpp"; #include "\q\addons\custom_server\Configs\blck_defines.hpp";
params["_unit","_killer","_instigator"]; params["_unit","_killer","_instigator"];
diag_log format["_fnc_processAIKill: _unit = %1 | _killer = %2 | _instigator = %3" ,_unit,_killer,_instigator]; //diag_log format["_fnc_processAIKill: _unit = %1 | _killer = %2 | _instigator = %3" ,_unit,_killer,_instigator];
if (_unit getVariable["blck_cleanupAt",-1] > 0) exitWith {}; // this is here so that the script is not accidently run more than once for each MPKilled occurrence. if (_unit getVariable["blck_cleanupAt",-1] > 0) exitWith {}; // this is here so that the script is not accidently run more than once for each MPKilled occurrence.
_unit setVariable ["blck_cleanupAt", (diag_tickTime) + blck_bodyCleanUpTimer]; _unit setVariable ["blck_cleanupAt", (diag_tickTime) + blck_bodyCleanUpTimer];
blck_deadAI pushback _unit; blck_deadAI pushback _unit;
@ -25,6 +25,7 @@ if (count(units _group) == 0) then
{ {
deleteGroup _group; deleteGroup _group;
}; };
/*
diag_log format[ diag_log format[
"_fnc_processAIKill: _killer = %1 | vehicle _killer = %2 | typeOf (vehicle _killer = %3) | driver(vehicle _killer) = %4", "_fnc_processAIKill: _killer = %1 | vehicle _killer = %2 | typeOf (vehicle _killer = %3) | driver(vehicle _killer) = %4",
_killer, _killer,
@ -32,8 +33,9 @@ diag_log format[
typeOf(vehicle _killer), typeOf(vehicle _killer),
driver(vehicle _killer) driver(vehicle _killer)
]; ];
*/
if !((vehicle _unit) isEqualTo _unit) then diag_log format["+fnc_processAIKill: (vehicle _killer) isKindOf Man = %1",(vehicle _killer) isKindOf "Man"];
if !((vehicle _unit) isKindOf "Man") then
{ {
private _veh = vehicle _unit; private _veh = vehicle _unit;
diag_log format["_processAIKill: _unit %1 is in vehicle %2",_unit,_veh]; diag_log format["_processAIKill: _unit %1 is in vehicle %2",_unit,_veh];

View File

@ -84,6 +84,7 @@ private _functions = [
["blck_fnc_garrisonBuilding_ATLsystem","\q\addons\custom_server\Compiles\Missions\GMS_fnc_garrisonBuilding_ATLsystem.sqf"], ["blck_fnc_garrisonBuilding_ATLsystem","\q\addons\custom_server\Compiles\Missions\GMS_fnc_garrisonBuilding_ATLsystem.sqf"],
["blck_fnc_spawnGarrisonInsideBuilding_ATL","\q\addons\custom_server\Compiles\Missions\GMS_fnc_spawnGarrisonInsideBuilding_ATL.sqf"], ["blck_fnc_spawnGarrisonInsideBuilding_ATL","\q\addons\custom_server\Compiles\Missions\GMS_fnc_spawnGarrisonInsideBuilding_ATL.sqf"],
["blck_fnc_spawnGarrisonInsideBuilding_relPos","\q\addons\custom_server\Compiles\Missions\GMS_fnc_spawnGarrisonInsideBuilding_relPos.sqf"], ["blck_fnc_spawnGarrisonInsideBuilding_relPos","\q\addons\custom_server\Compiles\Missions\GMS_fnc_spawnGarrisonInsideBuilding_relPos.sqf"],
["GMS_fnc_selectVehicleCrewCount","\q\addons\custom_server\Compiles\Missions\GMS_fnc_selectVehicleCrewCount.sqf"],
// Group-related functions // Group-related functions
["blck_fnc_spawnGroup","\q\addons\custom_server\Compiles\Groups\GMS_fnc_spawnGroup.sqf"], // Spawn a single group and populate it with AI units] ["blck_fnc_spawnGroup","\q\addons\custom_server\Compiles\Groups\GMS_fnc_spawnGroup.sqf"], // Spawn a single group and populate it with AI units]

View File

@ -260,6 +260,11 @@
blck_SpawnVeh_Blue = 1; // Number of static weapons at Blue Missions blck_SpawnVeh_Blue = 1; // Number of static weapons at Blue Missions
blck_SpawnVeh_Red = 1; // Number of static weapons at Red Missions blck_SpawnVeh_Red = 1; // Number of static weapons at Red Missions
blck_vehCrew_blue = 3;
blck_vehCrew_red = 3;
blck_vehCrew_green = 3;
blck_vehCrew_orange = 3;
/////////////////////////////// ///////////////////////////////
// AI STATIC WEAPON PARAMETERS // AI STATIC WEAPON PARAMETERS
/////////////////////////////// ///////////////////////////////
@ -287,6 +292,47 @@
****************************************************************/ ****************************************************************/
// When true, AI loadouts will be set from the class names in CfgPricing rather than the settings in the mod-specific configuration files // When true, AI loadouts will be set from the class names in CfgPricing rather than the settings in the mod-specific configuration files
blck_useConfigsGeneratedLoadouts = true; blck_useConfigsGeneratedLoadouts = true;
// lists of black-listed items to be excluded from dynamic loadouts
blck_blacklistedVests = [
];
blck_blacklistedUniforms = [
];
blck_blacklistedBackpacks = [
];
blck_blacklistedHeadgear = [
];
blck_blacklistedPrimaryWeapons = [
];
blck_blacklistedSecondaryWeapons = [
];
blck_blacklistedLaunchersAndSwingWeapons = [
];
blck_blacklistedOptics = [
];
blck_blacklistedAttachments = [
];
blck_blacklistedItems = [
];
/////////////////////////////////////////////
blck_groupBehavior = "SENTRY"; // Suggested choices are "SAD", "SENTRY", "AWARE" https://community.bistudio.com/wiki/ArmA:_AI_Combat_Modes blck_groupBehavior = "SENTRY"; // Suggested choices are "SAD", "SENTRY", "AWARE" https://community.bistudio.com/wiki/ArmA:_AI_Combat_Modes
blck_combatMode = "RED"; // Change this to "YELLOW" if the AI wander too far from missions for your tastes. blck_combatMode = "RED"; // Change this to "YELLOW" if the AI wander too far from missions for your tastes.

View File

@ -247,6 +247,11 @@
blck_SpawnVeh_Blue = 1; // Number of vehicles at Blue Missions blck_SpawnVeh_Blue = 1; // Number of vehicles at Blue Missions
blck_SpawnVeh_Red = 2; // Number of vehicles at Red Missions blck_SpawnVeh_Red = 2; // Number of vehicles at Red Missions
blck_vehCrew_blue = 3;
blck_vehCrew_red = 3;
blck_vehCrew_green = 3;
blck_vehCrew_orange = 3;
/////////////////////////////// ///////////////////////////////
// AI STATIC WEAPON Settings // AI STATIC WEAPON Settings
/////////////////////////////// ///////////////////////////////
@ -271,6 +276,48 @@
****************************************************************/ ****************************************************************/
// When true, AI loadouts will be set from the class names in CfgPricing rather than the settings in the mod-specific configuration files // When true, AI loadouts will be set from the class names in CfgPricing rather than the settings in the mod-specific configuration files
blck_useConfigsGeneratedLoadouts = true; blck_useConfigsGeneratedLoadouts = true;
// lists of black-listed items to be excluded from dynamic loadouts
blck_blacklistedVests = [
];
blck_blacklistedUniforms = [
];
blck_blacklistedBackpacks = [
];
blck_blacklistedHeadgear = [
];
blck_blacklistedPrimaryWeapons = [
];
blck_blacklistedSecondaryWeapons = [
];
blck_blacklistedLaunchersAndSwingWeapons = [
];
blck_blacklistedOptics = [
];
blck_blacklistedAttachments = [
];
blck_blacklistedItems = [
];
/////////////////////////////////////////////
blck_groupBehavior = "SAD"; // Suggested choices are "SAD", "SENTRY", "AWARE" https://community.bistudio.com/wiki/ArmA:_AI_Combat_Modes blck_groupBehavior = "SAD"; // Suggested choices are "SAD", "SENTRY", "AWARE" https://community.bistudio.com/wiki/ArmA:_AI_Combat_Modes
blck_combatMode = "RED"; // Change this to "YELLOW" if the AI wander too far from missions for your tastes. blck_combatMode = "RED"; // Change this to "YELLOW" if the AI wander too far from missions for your tastes.
blck_groupFormation = "WEDGE"; // Possibilities include "WEDGE","VEE","FILE","DIAMOND" blck_groupFormation = "WEDGE"; // Possibilities include "WEDGE","VEE","FILE","DIAMOND"

View File

@ -13,46 +13,6 @@
#include "\q\addons\custom_server\Configs\blck_defines.hpp"; #include "\q\addons\custom_server\Configs\blck_defines.hpp";
blck_blacklistedVests = [
];
blck_blacklistedUniforms = [
];
blck_blacklistedBackpacks = [
];
blck_blacklistedHeadgear = [
];
blck_blacklistedPrimaryWeapons = [
];
blck_blacklistedSecondaryWeapons = [
];
blck_blacklistedLaunchersAndSwingWeapons = [
];
blck_blacklistedOptics = [
];
blck_blacklistedAttachments = [
];
blck_blacklistedItems = [
];
blck_headgearList = []; blck_headgearList = [];
blck_SkinList = []; blck_SkinList = [];
blck_vests = []; blck_vests = [];

View File

@ -16,10 +16,10 @@ private ["_staticMissions"];
_staticMissions = [ _staticMissions = [
// [mod (Epoch, Exile), map (Altis, Tanoa etc), mission center, eg [10445,2014,0], filename.sqf (name of static mission template for that mission)]; // [mod (Epoch, Exile), map (Altis, Tanoa etc), mission center, eg [10445,2014,0], filename.sqf (name of static mission template for that mission)];
//["Epoch","Altis","template.sqf"], //["Epoch","Altis","template.sqf"],
//["Epoch","Altis","staticMissionExample2_Epoch.sqf"], ["Epoch","Altis","staticMissionExample2_Epoch.sqf"],
//["Epoch","Altis","destroyer.sqf"], //["Epoch","Altis","destroyer.sqf"],
//["Exile","Altis","template.sqf"], //["Exile","Altis","template.sqf"],
//["Exile","Altis","staticMissionExample2_Exile.sqf"] ["Exile","Altis","staticMissionExample2_Exile.sqf"]
]; ];
diag_log "[blckeagls] GMS_StaticMissions_Lists.sqf <Loaded>"; diag_log "[blckeagls] GMS_StaticMissions_Lists.sqf <Loaded>";

View File

@ -102,9 +102,9 @@ _aiGroupParameters = [
//[[22947.8,16717,6.80305],"red",4, 75,900], //[[22947.8,16717,6.80305],"red",4, 75,900],
// [[22849,16720.4,7.33123],"red",4, 75,9000], // [[22849,16720.4,7.33123],"red",4, 75,9000],
//[[22832.9,16805.6,4.59315],"red",4, 75,900], //[[22832.9,16805.6,4.59315],"red",4, 75,900],
//[[22909.8,16778.6,3.19144],"red",4, 75,900], [[22909.8,16778.6,3.19144],"red",4, 75,900],
//[[22809.4,16929.5,5.33892],"blue",1, 75,0], [[22809.4,16929.5,5.33892],"blue",5, 75,0],
[[22819.4,16929.5,0],"red",1, 75, 10, 1] [[22819.4,16929.5,0],"red",5, 75, 10, 9000]
]; ];
_noVehiclePatrols = blck_SpawnVeh_Red; // Modified as needed; can be a numberic value (e.g. 3) or range presented as [2,4]; _noVehiclePatrols = blck_SpawnVeh_Red; // Modified as needed; can be a numberic value (e.g. 3) or range presented as [2,4];

View File

@ -1,4 +1,4 @@
#define blck_buildNumber 172 #define blck_buildNumber 173
#define blck_versionNumber 6.90 #define blck_versionNumber 6.90
#define blck_buildDate "5-13-19" #define blck_buildDate "5-21-19"