Ver 6.90 Experimenta
Rewrote scripts to handle case where all ai in vehicles are dead; moved this code to the AIKilled event handler; tried to fix a bug reported by Tall Man related to crypto zeroing out when you kill AI from aircraft (confirmed) but the issue seems to still persist.
This commit is contained in:
parent
164815fa54
commit
ac2f57aeee
@ -13,11 +13,12 @@
|
|||||||
*/
|
*/
|
||||||
#include "\q\addons\custom_server\Configs\blck_defines.hpp";
|
#include "\q\addons\custom_server\Configs\blck_defines.hpp";
|
||||||
|
|
||||||
private _Groups_AI_Side = 0;
|
private _groups_AI_Side = 0;
|
||||||
|
|
||||||
{
|
{
|
||||||
if ( (side _x) isEqualTo blck_AI_Side) then {_Groups_AI_Side = _Groups_AI_Side + 1;};
|
//if ( (side _x) isEqualTo blck_AI_Side) then {_Groups_AI_Side = _Groups_AI_Side + 1;};
|
||||||
|
_groups_AI_Side = {(side _x) isEqualTo blck_AI_side} count allGroups;
|
||||||
}forEach allGroups;
|
}forEach allGroups;
|
||||||
//diag_log format["_fnc_groupsOnAISide:: -- >> allGroups = %1 | _Groups_AI_Side = %2",allGroups, _Groups_AI_Side];
|
//diag_log format["_fnc_groupsOnAISide:: -- >> allGroups = %1 | _Groups_AI_Side = %2",allGroups, _Groups_AI_Side];
|
||||||
|
|
||||||
_Groups_AI_Side
|
_groups_AI_Side
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
//////////////////////////////////////////////////////
|
|
||||||
// Returns an array of all players on the server
|
|
||||||
/*
|
/*
|
||||||
|
|
||||||
By Ghostrider [GRG]
|
By Ghostrider [GRG]
|
||||||
@ -13,16 +11,6 @@
|
|||||||
http://creativecommons.org/licenses/by-nc-sa/4.0/
|
http://creativecommons.org/licenses/by-nc-sa/4.0/
|
||||||
*/
|
*/
|
||||||
#include "\q\addons\custom_server\Configs\blck_defines.hpp";
|
#include "\q\addons\custom_server\Configs\blck_defines.hpp";
|
||||||
/////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
private ["_result"];
|
|
||||||
|
|
||||||
/*
|
|
||||||
_result = [];
|
|
||||||
{
|
|
||||||
if (isPlayer _x && alive _x) then { _result pushback _x };
|
|
||||||
} forEach allPlayers;
|
|
||||||
*/
|
|
||||||
_result = allPlayers;
|
|
||||||
|
|
||||||
|
private _result = allPlayers;
|
||||||
_result
|
_result
|
||||||
|
@ -10,9 +10,7 @@
|
|||||||
http://creativecommons.org/licenses/by-nc-sa/4.0/
|
http://creativecommons.org/licenses/by-nc-sa/4.0/
|
||||||
*/
|
*/
|
||||||
#include "\q\addons\custom_server\Configs\blck_defines.hpp";
|
#include "\q\addons\custom_server\Configs\blck_defines.hpp";
|
||||||
private["_markerName"];
|
params["_markerName"];
|
||||||
_markerName = _this select 0;
|
|
||||||
deleteMarker _markerName;
|
|
||||||
_markerName = "label" + _markerName;
|
|
||||||
deleteMarker _markerName;
|
deleteMarker _markerName;
|
||||||
|
deleteMarker ("label" + _markerName);
|
||||||
|
|
||||||
|
@ -73,7 +73,7 @@ while {_findNew} do
|
|||||||
{
|
{
|
||||||
_findNew = true;
|
_findNew = true;
|
||||||
};
|
};
|
||||||
}forEach (allmissionobjects _pole);
|
}forEach nearestObjects[blck_mapCenter, [_pole], blck_minDistanceToBases];
|
||||||
};
|
};
|
||||||
if !(_findNew) then
|
if !(_findNew) then
|
||||||
{
|
{
|
||||||
|
@ -11,20 +11,20 @@
|
|||||||
#include "\q\addons\custom_server\Configs\blck_defines.hpp";
|
#include "\q\addons\custom_server\Configs\blck_defines.hpp";
|
||||||
|
|
||||||
params["_data"];
|
params["_data"];
|
||||||
_value = objNull;
|
_value = 0;
|
||||||
if (typeName _data isEqualTo "ARRAY") then
|
if (typeName _data isEqualTo "ARRAY") then
|
||||||
{
|
{
|
||||||
_min = _data select 0;
|
params["_min","_max"];
|
||||||
_max = _data select 1;
|
|
||||||
if (_max > _min) then
|
if (_max > _min) then
|
||||||
{
|
{
|
||||||
_value = _min + round(random(_max - _min));
|
_value = _min + round(random(_max - _min));
|
||||||
} else {
|
} else {
|
||||||
_value = _min;
|
_value = _min;
|
||||||
};
|
};
|
||||||
};
|
} else {
|
||||||
if (typeName _data isEqualTo "SCALAR") then
|
if (typeName _data isEqualTo "SCALAR") then
|
||||||
{
|
{
|
||||||
_value = _data;
|
_value = _data;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
_value
|
_value
|
@ -1,34 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Original Credit:
|
Credit for this method goes to He-Man who first suggested it.
|
||||||
Updated for Epoch 0.3.8.0 by He-Man
|
|
||||||
http://epochmod.com/forum/index.php?/topic/34661-release-hs-blackmarket-16-new-trader-system-special-trader-blackmarket/&page=38
|
|
||||||
HALV_takegive_crypto.sqf
|
|
||||||
by Halv
|
|
||||||
|
|
||||||
Copyright (C) 2015 Halvhjearne & Suppe
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
Contact : halvhjearne@gmail.com
|
|
||||||
*/
|
*/
|
||||||
params["_player","_nr"];
|
_this call EPOCH_server_effectCrypto;
|
||||||
private["_cIndex","_vars","_current_crypto","_current_cryptoRaw","_playerCryptoLimit"];
|
|
||||||
_cIndex = EPOCH_customVars find "Crypto";
|
|
||||||
_vars = _player getVariable["VARS", call EPOCH_defaultVars_SEPXVar];
|
|
||||||
_current_crypto = _vars select _cIndex;
|
|
||||||
_current_cryptoRaw = _current_crypto;
|
|
||||||
_playerCryptoLimit = EPOCH_customVarLimits select _cIndex;
|
|
||||||
_playerCryptoLimit params ["_playerCryptoLimitMax","_playerCryptoLimitMin"];
|
|
||||||
_current_crypto = ((_current_cryptoRaw + _nr) min _playerCryptoLimitMax) max _playerCryptoLimitMin;
|
|
||||||
_current_crypto remoteExec ['EPOCH_effectCrypto',(owner _player)];
|
|
||||||
_vars set[_cIndex, _current_crypto];
|
|
||||||
_player setVariable["VARS", _vars];
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -24,7 +24,6 @@ while {true} do
|
|||||||
uiSleep 1;
|
uiSleep 1;
|
||||||
if (diag_tickTime > _timer1sec) then
|
if (diag_tickTime > _timer1sec) then
|
||||||
{
|
{
|
||||||
[] call blck_fnc_vehicleMonitor;
|
|
||||||
#ifdef GRGserver
|
#ifdef GRGserver
|
||||||
[] call blck_fnc_broadcastServerFPS;
|
[] call blck_fnc_broadcastServerFPS;
|
||||||
#endif
|
#endif
|
||||||
@ -36,6 +35,7 @@ while {true} do
|
|||||||
//[] call blck_fnc_missionGroupMonitor;
|
//[] call blck_fnc_missionGroupMonitor;
|
||||||
if (blck_simulationManager == blck_useBlckeaglsSimulationManagement) then {call blck_fnc_blckSimulationManager};
|
if (blck_simulationManager == blck_useBlckeaglsSimulationManagement) then {call blck_fnc_blckSimulationManager};
|
||||||
[] call blck_fnc_sm_missionPatrolMonitor;
|
[] call blck_fnc_sm_missionPatrolMonitor;
|
||||||
|
[] call blck_fnc_vehicleMonitor;
|
||||||
};
|
};
|
||||||
if (diag_tickTime > _timer20sec) then
|
if (diag_tickTime > _timer20sec) then
|
||||||
{
|
{
|
||||||
|
@ -14,10 +14,8 @@
|
|||||||
params["_mArray","_count"];
|
params["_mArray","_count"];
|
||||||
|
|
||||||
_mArray params["_missionType","_markerPos","_markerLabel","_markerLabelType","_markerColor","_markerType"];
|
_mArray params["_missionType","_markerPos","_markerLabel","_markerLabelType","_markerColor","_markerType"];
|
||||||
|
|
||||||
_name = "ai_count" + _name;
|
|
||||||
_textPos = [(_pos select 0) + (count toArray (_text) * 12), (_pos select 1) + (_size select 0), 0];
|
_textPos = [(_pos select 0) + (count toArray (_text) * 12), (_pos select 1) + (_size select 0), 0];
|
||||||
_MainMarker = createMarker [_name, _textPos];
|
_MainMarker = createMarker ["ai_count" + _name, _textPos];
|
||||||
_MainMarker setMarkerShape "Icon";
|
_MainMarker setMarkerShape "Icon";
|
||||||
_MainMarker setMarkerType "HD_Arrow";
|
_MainMarker setMarkerType "HD_Arrow";
|
||||||
_MainMarker setMarkerColor "ColorBlack";
|
_MainMarker setMarkerColor "ColorBlack";
|
||||||
|
@ -15,8 +15,6 @@
|
|||||||
// blck_connectedHCs // list of connected HCs at last check.
|
// blck_connectedHCs // list of connected HCs at last check.
|
||||||
_HCs = entities "HeadlessClient_F"; // currently connected HCs.
|
_HCs = entities "HeadlessClient_F"; // currently connected HCs.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
if ([_x] call _fn_HC_disconnected) then
|
if ([_x] call _fn_HC_disconnected) then
|
||||||
{
|
{
|
||||||
|
@ -0,0 +1,11 @@
|
|||||||
|
/*
|
||||||
|
--------------------------
|
||||||
|
License
|
||||||
|
--------------------------
|
||||||
|
All the code and information provided here is provided under an Attribution Non-Commercial ShareAlike 4.0 Commons License.
|
||||||
|
|
||||||
|
http://creativecommons.org/licenses/by-nc-sa/4.0/
|
||||||
|
*/
|
||||||
|
|
||||||
|
params["_killer"];
|
||||||
|
[["IED","",0,0],[_killer]] call blck_fnc_MessagePlayers;
|
@ -21,7 +21,6 @@ private ["_result","_players"];
|
|||||||
params["_pos","_dist",["_onFootOnly",false]];
|
params["_pos","_dist",["_onFootOnly",false]];
|
||||||
_players = call blck_fnc_allPlayers;
|
_players = call blck_fnc_allPlayers;
|
||||||
_result = false;
|
_result = false;
|
||||||
|
|
||||||
//diag_log format["_fnc_playerInRange:: -> _pos = %1 and _dist = %2 and _result = %3",_pos,_dist,_result];
|
//diag_log format["_fnc_playerInRange:: -> _pos = %1 and _dist = %2 and _result = %3",_pos,_dist,_result];
|
||||||
if !(_onFootOnly) then
|
if !(_onFootOnly) then
|
||||||
{
|
{
|
||||||
@ -29,10 +28,7 @@ if !(_onFootOnly) then
|
|||||||
//diag_log format["_fnc_playerInRange:: !_onFootOnly -> _pos = %1 and _player = %2 and distance = %3",_pos,_x, _pos distance _x];
|
//diag_log format["_fnc_playerInRange:: !_onFootOnly -> _pos = %1 and _player = %2 and distance = %3",_pos,_x, _pos distance _x];
|
||||||
if ((_x distance2D _pos) < _dist) exitWith {_result = true;};
|
if ((_x distance2D _pos) < _dist) exitWith {_result = true;};
|
||||||
} forEach _players;
|
} forEach _players;
|
||||||
};
|
} else {
|
||||||
|
|
||||||
if (_onFootOnly) then
|
|
||||||
{
|
|
||||||
{
|
{
|
||||||
//diag_log format["_fnc_playerInRange:: onfootOnly -> _pos = %1 and _player = %2 and distance = %3",_pos,_x, _pos distance2d _x];
|
//diag_log format["_fnc_playerInRange:: onfootOnly -> _pos = %1 and _player = %2 and distance = %3",_pos,_x, _pos distance2d _x];
|
||||||
if ( ((_x distance2D _pos) < _dist) && (vehicle _x isEqualTo _x)) exitWith {_result = true;};
|
if ( ((_x distance2D _pos) < _dist) && (vehicle _x isEqualTo _x)) exitWith {_result = true;};
|
||||||
|
@ -19,11 +19,9 @@
|
|||||||
|
|
||||||
private ["_result"];
|
private ["_result"];
|
||||||
params["_locations","_dist",["_onFootOnly",false]];
|
params["_locations","_dist",["_onFootOnly",false]];
|
||||||
//diag_log format["_fnc_playerInRangeArray: _locations = %1 | _dist = %2 | _onFootOnly = %3",_locations,_dist, _onFootOnly];
|
|
||||||
_result = false;
|
_result = false;
|
||||||
{
|
{
|
||||||
_result = [_x,_dist,_onFootOnly] call blck_fnc_playerInRange;
|
_result = [_x,_dist,_onFootOnly] call blck_fnc_playerInRange;
|
||||||
if (_result) exitWith {};
|
if (_result) exitWith {};
|
||||||
} forEach _locations;
|
} forEach _locations;
|
||||||
//diag_log format["_fnc_playerInRangeArray: _locations = %1 |_return = %2",_result];
|
|
||||||
_result
|
_result
|
||||||
|
@ -19,12 +19,8 @@
|
|||||||
|
|
||||||
private["_newX","_newY"];
|
private["_newX","_newY"];
|
||||||
params["_pos","_range"];
|
params["_pos","_range"];
|
||||||
|
_newX = ((_pos select 0) + (random(_range)) * (selectRandom [1,-1]));
|
||||||
_signs = [1,-1];
|
_newY = ((_pos select 1) + (random(_range)) * (selectRandom [1,-1]));
|
||||||
_sign = selectRandom _signs;
|
|
||||||
|
|
||||||
_newX = ((_pos select 0) + (random(_range)) * (selectRandom _signs));
|
|
||||||
_newY = ((_pos select 1) + (random(_range)) * (selectRandom _signs));
|
|
||||||
|
|
||||||
[_newX,_newY,0]
|
[_newX,_newY,0]
|
||||||
|
|
||||||
|
@ -13,7 +13,6 @@
|
|||||||
|
|
||||||
private["_blck_fn_configureRoundMarker"];
|
private["_blck_fn_configureRoundMarker"];
|
||||||
_blck_fn_configureRoundMarker = {
|
_blck_fn_configureRoundMarker = {
|
||||||
//diag_log format["_blck_fn_configureRoundMarker: _this = %1",_this];
|
|
||||||
private["_name","_pos","_color","_size","_MainMarker","_arrowMarker","_labelMarker","_labelType"];
|
private["_name","_pos","_color","_size","_MainMarker","_arrowMarker","_labelMarker","_labelType"];
|
||||||
params["_name","_pos","_color","_text","_size","_labelType","_mShape","_mBrush"];
|
params["_name","_pos","_color","_text","_size","_labelType","_mShape","_mBrush"];
|
||||||
if ((_pos distance [0,0,0]) < 10) exitWith {};
|
if ((_pos distance [0,0,0]) < 10) exitWith {};
|
||||||
@ -23,13 +22,11 @@ _blck_fn_configureRoundMarker = {
|
|||||||
_MainMarker setMarkerShape "ELLIPSE";
|
_MainMarker setMarkerShape "ELLIPSE";
|
||||||
_MainMarker setMarkerBrush "Grid";
|
_MainMarker setMarkerBrush "Grid";
|
||||||
_MainMarker setMarkerSize _size; //
|
_MainMarker setMarkerSize _size; //
|
||||||
//diag_log format["_blck_fn_configureRoundMarker: -: _labelType = %1", _labelType];
|
|
||||||
if (count toArray(_text) > 0) then
|
if (count toArray(_text) > 0) then
|
||||||
{
|
{
|
||||||
switch (_labelType) do {
|
switch (_labelType) do {
|
||||||
case "arrow":
|
case "arrow":
|
||||||
{
|
{
|
||||||
//diag_log "++++++++++++++--- marker label arrow detected";
|
|
||||||
_name = "label" + _name;
|
_name = "label" + _name;
|
||||||
_textPos = [(_pos select 0) + (count toArray (_text) * 12), (_pos select 1) - (_size select 0), 0];
|
_textPos = [(_pos select 0) + (count toArray (_text) * 12), (_pos select 1) - (_size select 0), 0];
|
||||||
_arrowMarker = createMarker [_name, _textPos];
|
_arrowMarker = createMarker [_name, _textPos];
|
||||||
@ -41,7 +38,6 @@ _blck_fn_configureRoundMarker = {
|
|||||||
};
|
};
|
||||||
case "center":
|
case "center":
|
||||||
{
|
{
|
||||||
//diag_log "++++++++++++++--- marker label dot detected";
|
|
||||||
_name = "label" + _name;
|
_name = "label" + _name;
|
||||||
_labelMarker = createMarker [_name, _pos];
|
_labelMarker = createMarker [_name, _pos];
|
||||||
_labelMarker setMarkerShape "Icon";
|
_labelMarker setMarkerShape "Icon";
|
||||||
@ -57,7 +53,6 @@ _blck_fn_configureRoundMarker = {
|
|||||||
|
|
||||||
_blck_fn_configureIconMarker = {
|
_blck_fn_configureIconMarker = {
|
||||||
private["_MainMarker"];
|
private["_MainMarker"];
|
||||||
//diag_log format["_blck_fn_configureIconMarker: _this = %1",_this];
|
|
||||||
params["_name","_pos",["_color","ColorBlack"],["_text",""],["_icon","mil_triangle"]];
|
params["_name","_pos",["_color","ColorBlack"],["_text",""],["_icon","mil_triangle"]];
|
||||||
_name = "label" + _name;
|
_name = "label" + _name;
|
||||||
_MainMarker = createMarker [_name, _pos];
|
_MainMarker = createMarker [_name, _pos];
|
||||||
@ -68,13 +63,11 @@ _blck_fn_configureIconMarker = {
|
|||||||
_MainMarker
|
_MainMarker
|
||||||
};
|
};
|
||||||
|
|
||||||
//diag_log format["spawnMarker:: -- >> _this = %1",_this];
|
|
||||||
params["_mArray"];
|
params["_mArray"];
|
||||||
private["_marker"];
|
private["_marker"];
|
||||||
_mArray params["_missionMarkerName","_markerPos","_markerLabel","_markerLabelType","_markerColor","_markerTypeInfo"];
|
_mArray params["_missionMarkerName","_markerPos","_markerLabel","_markerLabelType","_markerColor","_markerTypeInfo"];
|
||||||
|
|
||||||
_markerTypeInfo params["_mShape",["_mSize",[0,0]],["_mBrush","GRID"]];
|
_markerTypeInfo params["_mShape",["_mSize",[0,0]],["_mBrush","GRID"]];
|
||||||
//diag_log format["spawnMarker.sqf:: -- >> _missionMarkerName %1 | _markerPos %2 | _markerLabel %3 | _markerLabelType %4 | _markerColor %5 | _markerTypeInfo %6 | _mShape %7",_missionMarkerName,_markerPos,_markerLabel,_markerLabelType,_markerColor,_markerTypeInfo,_mShape];
|
|
||||||
|
|
||||||
if (toUpper(_mShape) in ["ELIPSE","ELLIPSE","RECTANGLE"]) then // not an Icon ....
|
if (toUpper(_mShape) in ["ELIPSE","ELLIPSE","RECTANGLE"]) then // not an Icon ....
|
||||||
{
|
{
|
||||||
@ -84,6 +77,5 @@ if !(toUpper(_mShape) in ["ELIPSE","ELLIPSE","RECTANGLE"]) then
|
|||||||
{
|
{
|
||||||
_marker = [_missionMarkerName,_markerPos, _markerColor,_markerLabel,_mShape] call _blck_fn_configureIconMarker;
|
_marker = [_missionMarkerName,_markerPos, _markerColor,_markerLabel,_mShape] call _blck_fn_configureIconMarker;
|
||||||
};
|
};
|
||||||
//diag_log format["spawnMarker complete script with _marker = %1",_marker];
|
|
||||||
if (isNil "_marker") then {_marker = ""};
|
if (isNil "_marker") then {_marker = ""};
|
||||||
_marker
|
_marker
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
params["_center","_emplaced","_garrisonGroup"];
|
params["_center","_emplaced","_garrisonGroup"];
|
||||||
private["_obj","_objects"];
|
private["_obj","_objects"];
|
||||||
_group = call blck_fnc_create_AI_Group;
|
private _group = call blck_fnc_create_AI_Group;
|
||||||
_objects = [];
|
_objects = [];
|
||||||
{
|
{
|
||||||
_x params["_objClassName","_objRelPos","_objDir"];
|
_x params["_objClassName","_objRelPos","_objDir"];
|
||||||
@ -20,12 +20,12 @@
|
|||||||
_objects pushBack _obj;
|
_objects pushBack _obj;
|
||||||
_obj setPosATL (_objRelPos vectorAdd _center);
|
_obj setPosATL (_objRelPos vectorAdd _center);
|
||||||
_obj setDir _objDir;
|
_obj setDir _objDir;
|
||||||
_unit = [_group] call blck_fnc_spawnUnit;
|
private _unit = [_group] call blck_fnc_spawnUnit;
|
||||||
_unit moveInGunner _unit;
|
_unit moveInGunner _unit;
|
||||||
_wep addMPEventHandler["MPHit",{[_this] call blck_EH_AIVehicle_HandleDamage}];
|
private _wep addMPEventHandler["MPHit",{[_this] call blck_EH_AIVehicle_HandleDamage}];
|
||||||
_wep setVariable["GRG_vehType","emplaced"];
|
_wep setVariable["GRG_vehType","emplaced"];
|
||||||
[_wep,false] call blck_fnc_configureMissionVehicle;
|
[_wep,false] call blck_fnc_configureMissionVehicle;
|
||||||
}forEach _emplaced;
|
}forEach _emplaced;
|
||||||
blck_monitoredVehicles append _emplacedWeps;
|
blck_monitoredVehicles append _emplacedWeps;
|
||||||
_return = [_emplacedWeps,_group,_abort];
|
private _return = [_emplacedWeps,_group,_abort];
|
||||||
_return
|
_return
|
@ -18,4 +18,4 @@ _objects = [];
|
|||||||
_obj = [_objClassName, _objRelPos vectorAdd _center, _objDir,enableSimulationForObject,enableDamageForObject,enableRopesforObject,"CAN_COLLIDE"] call blck_fnc_spawnSingleObject;
|
_obj = [_objClassName, _objRelPos vectorAdd _center, _objDir,enableSimulationForObject,enableDamageForObject,enableRopesforObject,"CAN_COLLIDE"] call blck_fnc_spawnSingleObject;
|
||||||
_objects pushBack _obj;
|
_objects pushBack _obj;
|
||||||
}forEach _landscape;
|
}forEach _landscape;
|
||||||
_landscape
|
_objects
|
@ -19,7 +19,6 @@ _cratesSpawned = [];
|
|||||||
_crate = [_objClassName, _objRelPos vectorAdd _center, _objDir] call blck_fnc_spawn_lootCrate;
|
_crate = [_objClassName, _objRelPos vectorAdd _center, _objDir] call blck_fnc_spawn_lootCrate;
|
||||||
//_crate setPosATL _objRelPos vectorAdd _center;
|
//_crate setPosATL _objRelPos vectorAdd _center;
|
||||||
_cratesSpawned pushBack _crate;
|
_cratesSpawned pushBack _crate;
|
||||||
//_crate setVariable ["LAST_CHECK", 100000];
|
|
||||||
_crate allowDamage false;
|
_crate allowDamage false;
|
||||||
_crate enableRopeAttach false;
|
_crate enableRopeAttach false;
|
||||||
_crate
|
_crate
|
||||||
|
@ -10,10 +10,8 @@
|
|||||||
#include "\q\addons\custom_server\Configs\blck_defines.hpp";
|
#include "\q\addons\custom_server\Configs\blck_defines.hpp";
|
||||||
|
|
||||||
params["_objClassName","_objPosn",["_objDir",0],["_enableSimulation",true],["_enableDamage",true],["_enableRopes",true],["_mode","NONE"]];
|
params["_objClassName","_objPosn",["_objDir",0],["_enableSimulation",true],["_enableDamage",true],["_enableRopes",true],["_mode","NONE"]];
|
||||||
//diag_log format["_fnc_spawnSingleObject: _objClassName = %1 | _objPosn = %2 | _objPosn = %3",_objClassName,_objPosn,_objDir];
|
|
||||||
private _obj = createVehicle[_objClassName,_objPosn,[],0,_mode];
|
private _obj = createVehicle[_objClassName,_objPosn,[],0,_mode];
|
||||||
_obj setDir _objDir;
|
_obj setDir _objDir;
|
||||||
_obj allowDamage _enableDamage;
|
_obj allowDamage _enableDamage;
|
||||||
_obj enableDynamicSimulation _enableSimulation;
|
_obj enableDynamicSimulation _enableSimulation;
|
||||||
//diag_log format["created object %1 at %2 heading %3",_obj,getPosATL _obj, getDir _obj];
|
|
||||||
_obj
|
_obj
|
@ -17,6 +17,6 @@
|
|||||||
|
|
||||||
params["_startTime",["_timeoutTime",blck_MissionTimeout]];
|
params["_startTime",["_timeoutTime",blck_MissionTimeout]];
|
||||||
private["_return"];
|
private["_return"];
|
||||||
if ((diag_tickTime - _startTime) > _timeoutTime) then {_return = true} else {_return = false};
|
//if ((diag_tickTime - _startTime) > _timeoutTime) then {_return = true} else {_return = false};
|
||||||
//diag_log format["fnc_timedOut:: blck_MissionTimeout = %2 || _return = %1",_return,blck_MissionTimeout];
|
_return = ((diag_tickTime - _startTime) > _timeoutTime) ;
|
||||||
_return;
|
_return;
|
||||||
|
@ -20,8 +20,5 @@
|
|||||||
#include "\q\addons\custom_server\Configs\blck_defines.hpp";
|
#include "\q\addons\custom_server\Configs\blck_defines.hpp";
|
||||||
private["_wait","_Tstart"];
|
private["_wait","_Tstart"];
|
||||||
params["_min","_max"];
|
params["_min","_max"];
|
||||||
|
uiSleep round( _min + (_max - _min) );
|
||||||
_wait = round( _min + (_max - _min) );
|
|
||||||
uiSleep _wait;
|
|
||||||
|
|
||||||
true
|
true
|
||||||
|
@ -0,0 +1,23 @@
|
|||||||
|
/*
|
||||||
|
Checks for groups that have not reached their waypoints within a proscribed period
|
||||||
|
and redirects them.
|
||||||
|
|
||||||
|
for ghostridergaming
|
||||||
|
By Ghostrider [GRG]
|
||||||
|
Copyright 2016
|
||||||
|
--------------------------
|
||||||
|
License
|
||||||
|
--------------------------
|
||||||
|
All the code and information provided here is provided under an Attribution Non-Commercial ShareAlike 4.0 Commons License.
|
||||||
|
|
||||||
|
http://creativecommons.org/licenses/by-nc-sa/4.0/
|
||||||
|
*/
|
||||||
|
|
||||||
|
params["_group","_maxTime","radius"];
|
||||||
|
if ((diag_tickTime > (_group getVariable "timeStamp") + _maxTime) || ( (getPos (leader)) distance2d (_group getVariable "patrolCenter") > 200)) then
|
||||||
|
{
|
||||||
|
(leader _group) call blck_fnc_changeToMoveWaypoint;
|
||||||
|
#ifdef blck_debugMode
|
||||||
|
if (blck_debugLevel > 2) then {diag_log format["_fnc_missionGroupMonitor: infantry group %1 stuck, waypoint reset",_group];};
|
||||||
|
#endif
|
||||||
|
};
|
@ -13,6 +13,8 @@
|
|||||||
private["_groupSpawned"];
|
private["_groupSpawned"];
|
||||||
|
|
||||||
_groupSpawned = createGroup [blck_AI_Side, true];
|
_groupSpawned = createGroup [blck_AI_Side, true];
|
||||||
|
if (isNull _groupSpawned) exitWith{"ERROR:-> Null Group created by blck_fnc_spawnGroup";};
|
||||||
|
|
||||||
if (blck_simulationManager == blck_useDynamicSimulationManagement) then
|
if (blck_simulationManager == blck_useDynamicSimulationManagement) then
|
||||||
{
|
{
|
||||||
_groupSpawned enableDynamicSimulation true;
|
_groupSpawned enableDynamicSimulation true;
|
||||||
@ -25,8 +27,4 @@ _groupSpawned setspeedmode "FULL";
|
|||||||
_groupSpawned setFormation blck_groupFormation;
|
_groupSpawned setFormation blck_groupFormation;
|
||||||
_groupSpawned setVariable ["blck_group",true,true];
|
_groupSpawned setVariable ["blck_group",true,true];
|
||||||
|
|
||||||
#ifdef blck_debugMode
|
|
||||||
if (blck_debugLevel >= 2) then {diag_log format["_fnc_create_AI_Group: _groupSpawned = %1",_groupSpawned]};
|
|
||||||
#endif
|
|
||||||
|
|
||||||
_groupSpawned
|
_groupSpawned
|
@ -22,15 +22,9 @@ _fn_waypointComplete = {
|
|||||||
_done
|
_done
|
||||||
};
|
};
|
||||||
|
|
||||||
_fn_aliveGroupUnits = {
|
|
||||||
private _group = _this select 0;
|
|
||||||
private _units = {alive _x} count (units _group);
|
|
||||||
_units
|
|
||||||
};
|
|
||||||
{
|
{
|
||||||
private["_timeStamp","_index","_unit","_soldierType"];
|
private["_timeStamp","_index","_unit","_soldierType"];
|
||||||
// check for error conditions
|
if ( !(_x isEqualTo grpNull) && ({alive _x} count (units _x) > 0) ) then
|
||||||
if ( !(_x isEqualTo grpNull) && ([_x] call _fn_aliveGroupUnits > 0) ) then
|
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
#define blck_turnBackRadiusInfantry 800
|
#define blck_turnBackRadiusInfantry 800
|
||||||
@ -46,81 +40,12 @@ _fn_aliveGroupUnits = {
|
|||||||
};
|
};
|
||||||
_soldierType = _x getVariable["soldierType","null"];
|
_soldierType = _x getVariable["soldierType","null"];
|
||||||
//diag_log format["_fn_monitorGroupWaypoints::--> soldierType for group %1 = %2 and timeStamp = %3",_x,_soldierType,_timeStamp];
|
//diag_log format["_fn_monitorGroupWaypoints::--> soldierType for group %1 = %2 and timeStamp = %3",_x,_soldierType,_timeStamp];
|
||||||
private _maxtime = 0;
|
|
||||||
switch (soldierType) do
|
switch (soldierType) do
|
||||||
{
|
{
|
||||||
case "infantry": {_maxtime = 60};
|
case "infantry": {[_x, 60] call GMS_fnc_checkGroupWaypointStatus;};
|
||||||
case "vehicle": {_maxtime = 90};
|
case "vehicle": {[_x, 90, 800] call GMS_fnc_checkGroupWaypointStatus;};
|
||||||
case "aircraft": {_maxtime = 90};
|
case "aircraft": {_[_x, 90, 1000] call GMS_fnc_checkGroupWaypointStatus;};
|
||||||
};
|
};
|
||||||
_private _updateNeeded = if (diag_tickTime > (_x getVariable "timeStamp") + 60) then
|
_private _updateNeeded = if (diag_tickTime > (_x getVariable "timeStamp") + 60) then
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
if (_soldierType isEqualTo "infantry") then
|
|
||||||
{
|
|
||||||
if (diag_tickTime > (_x getVariable "timeStamp") + 60) then
|
|
||||||
{
|
|
||||||
_units = [_x] call _fn_aliveGroupUnits;
|
|
||||||
if (count _units > 0) then
|
|
||||||
{
|
|
||||||
private _leader = leader _x;
|
|
||||||
(_leader) call blck_fnc_changeToMoveWaypoint;
|
|
||||||
#ifdef blck_debugMode
|
|
||||||
if (blck_debugLevel > 2) then {diag_log format["_fnc_missionGroupMonitor: infantry group %1 stuck, waypoint reset",_x];};
|
|
||||||
#endif
|
|
||||||
/*
|
|
||||||
if ( (getPos _leader) distance2d (_group getVariable "patrolCenter") > 200) then
|
|
||||||
{
|
|
||||||
|
|
||||||
};
|
|
||||||
*/
|
|
||||||
};
|
|
||||||
|
|
||||||
};
|
|
||||||
};
|
|
||||||
if (_soldierType isEqualTo "vehicle") then
|
|
||||||
{
|
|
||||||
if (diag_tickTime > (_x getVariable "timeStamp") + 60) then
|
|
||||||
{
|
|
||||||
_units = [_x] call _fn_aliveGroupUnits;
|
|
||||||
if (count _units > 0) then
|
|
||||||
{
|
|
||||||
private _leader = leader _x;
|
|
||||||
(_leader) call blck_fnc_changeToMoveWaypoint;
|
|
||||||
//#ifdef blck_debugMode
|
|
||||||
if (true /*blck_debugLevel > 2*/) then {diag_log format["_fnc_missionGroupMonitor: vehicle group %1 stuck, waypoint reset",_x];};
|
|
||||||
//#endif
|
|
||||||
/*
|
|
||||||
if ( (getPos _leader) distance2d (_group getVariable "patrolCenter") > 200) then
|
|
||||||
{
|
|
||||||
};
|
|
||||||
*/
|
|
||||||
};
|
|
||||||
|
|
||||||
};
|
|
||||||
};
|
|
||||||
/*
|
|
||||||
if (_soldierType isEqualTo "helicopter") then
|
|
||||||
{
|
|
||||||
if ((diag_tickTime > (_x getVariable "timeStamp")) then
|
|
||||||
{
|
|
||||||
private _units = [_x] call _fn_aliveGroupUnits;
|
|
||||||
if (count _units > 0) then
|
|
||||||
{
|
|
||||||
private _leader = leader _x;
|
|
||||||
if (_leader distance (_group getVariable "patrolCenter") > blck_turnBackRadiusHelis) then
|
|
||||||
{
|
|
||||||
_leader call blck_fnc_changeToMoveWaypoint;
|
|
||||||
//#ifdef blck_debugMode
|
|
||||||
if (true ) then {diag_log format["_fnc_missionGroupMonitor: helicopter group %1 stuck, waypoint reset",_x];};
|
|
||||||
//#endif
|
|
||||||
//diag_log format["_fnc_missionGroupMonitor: helicopter group %1 stuck, waypoint reset",_x];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
};
|
|
||||||
};
|
|
||||||
*/
|
|
||||||
} forEach blck_monitoredMissionAIGroups;
|
} forEach blck_monitoredMissionAIGroups;
|
||||||
|
|
||||||
|
@ -13,39 +13,9 @@
|
|||||||
http://creativecommons.org/licenses/by-nc-sa/4.0/
|
http://creativecommons.org/licenses/by-nc-sa/4.0/
|
||||||
*/
|
*/
|
||||||
#include "\q\addons\custom_server\Configs\blck_defines.hpp";
|
#include "\q\addons\custom_server\Configs\blck_defines.hpp";
|
||||||
#ifdef blck_debugMode
|
|
||||||
if (blck_debugLevel > 2) then
|
|
||||||
{
|
|
||||||
diag_log format["_fnc_setupWaypoints: -> -This = %1",_this];
|
|
||||||
};
|
|
||||||
#endif
|
|
||||||
private["_dir","_arc","_noWp","_newpos","_wpradius","_wp"];
|
private["_dir","_arc","_noWp","_newpos","_wpradius","_wp"];
|
||||||
params["_pos","_minDis","_maxDis","_group",["_mode","random"],["_wpPatrolMode","SAD"],["_soldierType","null"] ];
|
params["_pos","_minDis","_maxDis","_group",["_mode","random"],["_wpPatrolMode","SAD"],["_soldierType","null"] ];
|
||||||
_wp = [_group, 0];
|
_wp = [_group, 0];
|
||||||
#ifdef blck_debugMode
|
|
||||||
if (blck_debugLevel >= 2) then
|
|
||||||
{
|
|
||||||
diag_log format["_fnc_setupWaypoints (4/29/17): configuring waypoints for group %1: _mode = %2 | _wpPatrolMode = %3 _soldierType = %4",_group, _mode, _wpPatrolMode,_soldierType];
|
|
||||||
};
|
|
||||||
#endif
|
|
||||||
if (_soldierType isEqualTo "emplaced") then
|
|
||||||
{
|
|
||||||
_wp setWaypointType "SENTRY";
|
|
||||||
_wp setWPPos (getPos leader _group);
|
|
||||||
_wp setWaypointCompletionRadius 100;
|
|
||||||
_wp setWaypointBehaviour "COMBAT";
|
|
||||||
_wp setWaypointCombatMode "RED";
|
|
||||||
_wp setWaypointTimeout [1,1.1,1.2];
|
|
||||||
//_wp setWaypointTimeout [0.1,0.1100,0.1200];
|
|
||||||
_group setCurrentWaypoint _wp;
|
|
||||||
_group setVariable["soldierType",_soldierType,true];
|
|
||||||
#ifdef blck_debugMode
|
|
||||||
_wp setWaypointStatements ["true","this call blck_fnc_emplacedWeaponWaypoint; diag_log format['====Updating timestamp for group %1 and changing its WP to an emplaced weapon Waypoint',group this];"];
|
|
||||||
if (blck_debugLevel > 2) then {diag_log format["_fnc_setupWaypoints: configuring weapoints for group %2 for emplaced weapon with _soldierType = %1",_soldierType,_group];};
|
|
||||||
#else
|
|
||||||
_wp setWaypointStatements ["true","this call blck_fnc_emplacedWeaponWaypoint;"];
|
|
||||||
#endif
|
|
||||||
};
|
|
||||||
if !(_soldierType isEqualTo "emplaced") then
|
if !(_soldierType isEqualTo "emplaced") then
|
||||||
{
|
{
|
||||||
_arc = 360/5;
|
_arc = 360/5;
|
||||||
@ -96,4 +66,20 @@ if !(_soldierType isEqualTo "emplaced") then
|
|||||||
diag_log format["_fnc_setupWaypoints:: -- >> Waypoint marker for group %1 have been configured as %2 with text set to %3",_group, _group getVariable "wpMarker", markerText (_group getVariable "wpMarker")];
|
diag_log format["_fnc_setupWaypoints:: -- >> Waypoint marker for group %1 have been configured as %2 with text set to %3",_group, _group getVariable "wpMarker", markerText (_group getVariable "wpMarker")];
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
} else {
|
||||||
|
_wp setWaypointType "SENTRY";
|
||||||
|
_wp setWPPos (getPos leader _group);
|
||||||
|
_wp setWaypointCompletionRadius 100;
|
||||||
|
_wp setWaypointBehaviour "COMBAT";
|
||||||
|
_wp setWaypointCombatMode "RED";
|
||||||
|
_wp setWaypointTimeout [1,1.1,1.2];
|
||||||
|
//_wp setWaypointTimeout [0.1,0.1100,0.1200];
|
||||||
|
_group setCurrentWaypoint _wp;
|
||||||
|
_group setVariable["soldierType",_soldierType,true];
|
||||||
|
#ifdef blck_debugMode
|
||||||
|
_wp setWaypointStatements ["true","this call blck_fnc_emplacedWeaponWaypoint; diag_log format['====Updating timestamp for group %1 and changing its WP to an emplaced weapon Waypoint',group this];"];
|
||||||
|
if (blck_debugLevel > 2) then {diag_log format["_fnc_setupWaypoints: configuring weapoints for group %2 for emplaced weapon with _soldierType = %1",_soldierType,_group];};
|
||||||
|
#else
|
||||||
|
_wp setWaypointStatements ["true","this call blck_fnc_emplacedWeaponWaypoint;"];
|
||||||
|
#endif
|
||||||
};
|
};
|
@ -12,7 +12,7 @@
|
|||||||
*/
|
*/
|
||||||
#include "\q\addons\custom_server\Configs\blck_defines.hpp";
|
#include "\q\addons\custom_server\Configs\blck_defines.hpp";
|
||||||
|
|
||||||
private["_numbertospawn","_groupSpawned","_safepos","_useLauncher","_launcherType","_infantryType"];
|
private["_numbertospawn","_groupSpawned","_safepos","_launcherType","_infantryType"];
|
||||||
// _newGroup = [_groupSpawnPos,_minAI,_maxAI,_skillLevel,_coords,_minPatrolRadius,_maxPatrolRadius,_uniforms,_headGear,_vests,_backpacks,_weapons,_sideArms,true,_isScubaGroup]
|
// _newGroup = [_groupSpawnPos,_minAI,_maxAI,_skillLevel,_coords,_minPatrolRadius,_maxPatrolRadius,_uniforms,_headGear,_vests,_backpacks,_weapons,_sideArms,true,_isScubaGroup]
|
||||||
params["_pos", "_center", ["_numai1",5], ["_numai2",10], ["_skillLevel","red"], ["_minDist",30], ["_maxDist",45],["_configureWaypoints",true], ["_uniforms",[]], ["_headGear",[]],["_vests",[]],["_backpacks",[]],["_weaponList",[]],["_sideArms",[]], ["_scuba",false]];
|
params["_pos", "_center", ["_numai1",5], ["_numai2",10], ["_skillLevel","red"], ["_minDist",30], ["_maxDist",45],["_configureWaypoints",true], ["_uniforms",[]], ["_headGear",[]],["_vests",[]],["_backpacks",[]],["_weaponList",[]],["_sideArms",[]], ["_scuba",false]];
|
||||||
if (_weaponList isEqualTo []) then {_weaponList = [_skillLevel] call blck_fnc_selectAILoadout};
|
if (_weaponList isEqualTo []) then {_weaponList = [_skillLevel] call blck_fnc_selectAILoadout};
|
||||||
@ -22,44 +22,13 @@ if (_headGear isEqualTo []) then {_headGear = [_skillLevel] call blck_fnc_selec
|
|||||||
if (_vests isEqualTo []) then {_vests = [_skillLevel] call blck_fnc_selectAIVests};
|
if (_vests isEqualTo []) then {_vests = [_skillLevel] call blck_fnc_selectAIVests};
|
||||||
if (_backpacks isEqualTo []) then {_backpacks = [_skillLevel] call blck_fnc_selectAIBackpacks};
|
if (_backpacks isEqualTo []) then {_backpacks = [_skillLevel] call blck_fnc_selectAIBackpacks};
|
||||||
|
|
||||||
#ifdef blck_debugMode
|
_numbertospawn = [_numai1,_numai2] call blck_fnc_getNumberFromRange;
|
||||||
if (blck_debugLevel >= 2) then
|
|
||||||
{
|
|
||||||
private _params = ["_pos","_center","_numai1","_numai2","_skillLevel","_minDis","_maxDist","_configureWaypoints","_uniforms","_headGear","_vests","_backpacks","_weaponList","_sideArms","_scuba"];
|
|
||||||
{
|
|
||||||
diag_log format["_fnc_spawnGroup: param %1 | value %2 | _forEachIndex %3",_params select _forEachIndex,_this select _forEachIndex,_forEachIndex];
|
|
||||||
}forEach _this;
|
|
||||||
};
|
|
||||||
#endif
|
|
||||||
//Spawns correct number of AI
|
|
||||||
if (_numai2 > _numai1) then
|
|
||||||
{
|
|
||||||
_numbertospawn = floor( (random (_numai2 - _numai1) + _numai1 ) );
|
|
||||||
} else {
|
|
||||||
_numbertospawn = _numai2;
|
|
||||||
};
|
|
||||||
|
|
||||||
#ifdef blck_debugMode
|
|
||||||
if (blck_debugLevel >= 2) then
|
|
||||||
{
|
|
||||||
diag_log format["spawnGroup.sqf: _numbertospawn = %1",_numbertospawn];
|
|
||||||
};
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//_groupSpawned = createGroup [blck_AI_Side, true]; // true here causes any empty group to be automatically deleted within 1 sec or so. https://community.bistudio.com/wiki/createGroup
|
//_groupSpawned = createGroup [blck_AI_Side, true]; // true here causes any empty group to be automatically deleted within 1 sec or so. https://community.bistudio.com/wiki/createGroup
|
||||||
_groupSpawned = call blck_fnc_create_AI_Group;
|
_groupSpawned = call blck_fnc_create_AI_Group;
|
||||||
|
|
||||||
#ifdef blck_debugMode
|
|
||||||
if (blck_debugLevel >= 1) then
|
|
||||||
{
|
|
||||||
diag_log format["spawnGroup.sqf: _groupSpawned = %1",_groupSpawned];
|
|
||||||
};
|
|
||||||
#endif
|
|
||||||
if !(isNull _groupSpawned) then
|
if !(isNull _groupSpawned) then
|
||||||
{
|
{
|
||||||
|
|
||||||
//diag_log format["spawnGroup:: group is %1",_groupSpawned];
|
|
||||||
_useLauncher = blck_useLaunchers;
|
|
||||||
if (_weaponList isEqualTo []) then
|
if (_weaponList isEqualTo []) then
|
||||||
{
|
{
|
||||||
_weaponList = [_skillLevel] call blck_fnc_selectAILoadout;
|
_weaponList = [_skillLevel] call blck_fnc_selectAILoadout;
|
||||||
@ -77,35 +46,16 @@ if !(isNull _groupSpawned) then
|
|||||||
} else {
|
} else {
|
||||||
_launcherType = "none";
|
_launcherType = "none";
|
||||||
};
|
};
|
||||||
|
|
||||||
//Finds a safe positon to spawn the AI in the area given
|
|
||||||
//_safepos = [_pos,0,30,2,0,20,0] call BIS_fnc_findSafePos;
|
|
||||||
|
|
||||||
//Spawns the AI unit
|
|
||||||
#ifdef blck_debugMode
|
|
||||||
if (blck_debugLevel > 2) then
|
|
||||||
{
|
|
||||||
diag_log format["spawnGroup:: spawning unit #%1",_i];
|
|
||||||
};
|
|
||||||
#endif
|
|
||||||
//params["_pos","_aiGroup",_skillLevel,_uniforms, _headGear,_vests,_backpacks,_Launcher,_weaponList,_sideArms,_scuba];
|
//params["_pos","_aiGroup",_skillLevel,_uniforms, _headGear,_vests,_backpacks,_Launcher,_weaponList,_sideArms,_scuba];
|
||||||
[_pos,_groupSpawned,_skillLevel,_uniforms,_headGear,_vests,_backpacks,_launcherType, _weaponList, _sideArms, _scuba] call blck_fnc_spawnUnit;
|
[_pos,_groupSpawned,_skillLevel,_uniforms,_headGear,_vests,_backpacks,_launcherType, _weaponList, _sideArms, _scuba] call blck_fnc_spawnUnit;
|
||||||
};
|
};
|
||||||
_groupSpawned selectLeader (units _groupSpawned select 0);
|
_groupSpawned selectLeader ((units _groupSpawned) select 0);
|
||||||
// params["_pos","_minDis","_maxDis","_group",["_mode","random"],["_pattern",["MOVE","SAD"]]];
|
// params["_pos","_minDis","_maxDis","_group",["_mode","random"],["_pattern",["MOVE","SAD"]]];
|
||||||
if (_configureWaypoints) then
|
if (_configureWaypoints) then
|
||||||
{
|
{
|
||||||
if (_scuba) then {_infantryType = "scuba"} else {_infantryType = "infantry"};
|
if (_scuba) then {_infantryType = "scuba"} else {_infantryType = "infantry"};
|
||||||
[_pos,_minDist,_maxDist,_groupSpawned,"random","SAD",_infantryType] spawn blck_fnc_setupWaypoints;
|
[_pos,_minDist,_maxDist,_groupSpawned,"random","SAD",_infantryType] spawn blck_fnc_setupWaypoints;
|
||||||
};
|
};
|
||||||
//diag_log format["_fnc_spawnGroup: blck_fnc_setupWaypoints called for group %1",_groupSpawned];
|
|
||||||
#ifdef blck_debugMode
|
|
||||||
if (blck_debugLevel >= 1) then
|
|
||||||
{
|
|
||||||
diag_log format["fnc_spawnGroup:: Group spawned was %1 with units of %2",_groupSpawned, units _groupSpawned];
|
|
||||||
};
|
|
||||||
#endif
|
|
||||||
|
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
diag_log "_fnc_spawnGroup:: ERROR CONDITION : NULL GROUP CREATED";
|
diag_log "_fnc_spawnGroup:: ERROR CONDITION : NULL GROUP CREATED";
|
||||||
|
@ -116,7 +116,6 @@ if (blck_debugLevel > 1) then
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
_wep setVariable["GRG_vehType","emplaced"];
|
_wep setVariable["GRG_vehType","emplaced"];
|
||||||
_wep setdir (random 359);
|
|
||||||
_wep setPos _pos;
|
_wep setPos _pos;
|
||||||
_wep setdir (random 359);
|
_wep setdir (random 359);
|
||||||
[_wep,false] call blck_fnc_configureMissionVehicle;
|
[_wep,false] call blck_fnc_configureMissionVehicle;
|
||||||
@ -124,6 +123,8 @@ if (blck_debugLevel > 1) then
|
|||||||
_units = units _empGroup;
|
_units = units _empGroup;
|
||||||
_gunner = _units select 0;
|
_gunner = _units select 0;
|
||||||
_gunner moveingunner _wep;
|
_gunner moveingunner _wep;
|
||||||
|
_gunner setVariable["GRG_vehType","emplaced"];
|
||||||
|
_gunner setVariable["GRG_vehicle",_wep];
|
||||||
_emplacedAI append _units;
|
_emplacedAI append _units;
|
||||||
|
|
||||||
#ifdef blck_debugMode
|
#ifdef blck_debugMode
|
||||||
|
@ -37,7 +37,6 @@ for "_i" from 1 to _statics do
|
|||||||
_allBldPsn = _allBldPsn - [_pos];
|
_allBldPsn = _allBldPsn - [_pos];
|
||||||
_staticClassName = selectRandom _typesStatics;
|
_staticClassName = selectRandom _typesStatics;
|
||||||
_obj = [_staticClassName, [0,0,0], true] call blck_fnc_spawnVehicle;
|
_obj = [_staticClassName, [0,0,0], true] call blck_fnc_spawnVehicle;
|
||||||
_obj setdir (random 359);
|
|
||||||
_obj setVariable["GRG_vehType","emplaced"];
|
_obj setVariable["GRG_vehType","emplaced"];
|
||||||
_staticsSpawned pushBack _obj;
|
_staticsSpawned pushBack _obj;
|
||||||
//diag_log format["_fnc_spawnGarrisonInsideBuilding_relPos: _obj = %1 | _staticsSpawned = %2",_obj,_staticsSpawned];
|
//diag_log format["_fnc_spawnGarrisonInsideBuilding_relPos: _obj = %1 | _staticsSpawned = %2",_obj,_staticsSpawned];
|
||||||
|
@ -7,12 +7,6 @@
|
|||||||
|
|
||||||
http://creativecommons.org/licenses/by-nc-sa/4.0/
|
http://creativecommons.org/licenses/by-nc-sa/4.0/
|
||||||
*/
|
*/
|
||||||
if (isServer) then
|
|
||||||
{
|
|
||||||
#ifdef blck_debugMode
|
|
||||||
if (blck_debugLevel > 1) then {diag_log format["_EH_AHit: _this = %1",_this]};
|
|
||||||
#endif
|
|
||||||
_this remoteExec["blck_fnc_processAIHit",2];
|
_this remoteExec["blck_fnc_processAIHit",2];
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -10,15 +10,5 @@
|
|||||||
|
|
||||||
http://creativecommons.org/licenses/by-nc-sa/4.0/
|
http://creativecommons.org/licenses/by-nc-sa/4.0/
|
||||||
*/
|
*/
|
||||||
#include "\q\addons\custom_server\Configs\blck_defines.hpp";
|
//#include "\q\addons\custom_server\Configs\blck_defines.hpp";
|
||||||
|
_this remoteExec ["blck_fnc_processAIKill",2];
|
||||||
params["_unit","_killer"];
|
|
||||||
|
|
||||||
#ifdef blck_debugMode
|
|
||||||
if (blck_debugLevel > 2) then
|
|
||||||
{
|
|
||||||
private _vars = ["unit","killer","instigator","useEffects"];
|
|
||||||
diag_log format["EH_AIKilled:: _this select %1 (_var select %2) = %3",_forEachIndex,_vars select _forEachIndex,_this select _forEachIndex];
|
|
||||||
};
|
|
||||||
#endif
|
|
||||||
[_unit,_killer] remoteExec ["blck_fnc_processAIKill",2];
|
|
||||||
|
@ -11,26 +11,11 @@
|
|||||||
#include "\q\addons\custom_server\Configs\blck_defines.hpp";
|
#include "\q\addons\custom_server\Configs\blck_defines.hpp";
|
||||||
|
|
||||||
params["_target"];
|
params["_target"];
|
||||||
|
private["_vehGroup"];
|
||||||
_fn_alertGroupUnits = {
|
{
|
||||||
params["_group","_target"];
|
|
||||||
private["_intelligence","_knowsAbout"];
|
|
||||||
_intelligence = (leader _group) getVariable ["intelligence",1];
|
|
||||||
{
|
|
||||||
_knowsAbout = _x knowsAbout _target;
|
|
||||||
_x reveal [_target,_knowsAbout + _intelligence];
|
|
||||||
}forEach (units _group);
|
|
||||||
};
|
|
||||||
|
|
||||||
_fn_allertNearbyVehicleGroups = {
|
|
||||||
params["_vehicles","_target"];
|
|
||||||
private["_vehGroup"];
|
|
||||||
{
|
|
||||||
_vehGroup = _x getVariable["vehicleGroup",grpNull];
|
_vehGroup = _x getVariable["vehicleGroup",grpNull];
|
||||||
if (_target distance2D (leader _vehGroup) < 1000) then {[_vehGroup,_target] call _fn_alertGroupUnits;};
|
if (_target distance2D (leader _vehGroup) < 1000) then {[_vehGroup,_target] call GMS_fnc_alertGroupUnits;};
|
||||||
}forEach _vehicles;
|
}forEach blck_monitoredVehicles;
|
||||||
};
|
|
||||||
//diag_log format["_fnc_alertNearbyVehicles called: _target = %1",_target];
|
|
||||||
[blck_monitoredVehicles,_target] call _fn_allertNearbyVehicleGroups;
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
http://creativecommons.org/licenses/by-nc-sa/4.0/
|
http://creativecommons.org/licenses/by-nc-sa/4.0/
|
||||||
*/
|
*/
|
||||||
#include "\q\addons\custom_server\Configs\blck_defines.hpp";
|
#include "\q\addons\custom_server\Configs\blck_defines.hpp";
|
||||||
|
|
||||||
for "_i" from 1 to (count blck_liveMissionAI) do {
|
for "_i" from 1 to (count blck_liveMissionAI) do {
|
||||||
if ((_i) <= count blck_liveMissionAI) then {
|
if ((_i) <= count blck_liveMissionAI) then {
|
||||||
_units = blck_liveMissionAI deleteat 0;
|
_units = blck_liveMissionAI deleteat 0;
|
||||||
|
@ -10,15 +10,14 @@
|
|||||||
|
|
||||||
http://creativecommons.org/licenses/by-nc-sa/4.0/
|
http://creativecommons.org/licenses/by-nc-sa/4.0/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// assumptions: this is always run on the server rgardless if th event is triggered on an HC or other client.
|
||||||
#include "\q\addons\custom_server\Configs\blck_defines.hpp";
|
#include "\q\addons\custom_server\Configs\blck_defines.hpp";
|
||||||
|
|
||||||
private["_group","_isLegal","_weapon","_lastkill","_kills","_message","_killstreakMsg"];
|
private["_group","_isLegal","_weapon","_lastkill","_kills","_message","_killstreakMsg"];
|
||||||
params["_unit","_killer","_isLegal"];
|
params["_unit","_killer"/*,"_instigator"*/];
|
||||||
|
|
||||||
if (_unit getVariable["blck_cleanupAt",-1] > 0) exitWith {};
|
if (_unit getVariable["blck_cleanupAt",-1] > 0) exitWith {};
|
||||||
|
_unit setVariable ["blck_cleanupAt", (diag_tickTime) + blck_bodyCleanUpTimer];
|
||||||
_unit setVariable ["blck_cleanupAt", (diag_tickTime) + blck_bodyCleanUpTimer, true];
|
|
||||||
|
|
||||||
blck_deadAI pushback _unit;
|
blck_deadAI pushback _unit;
|
||||||
_group = group _unit;
|
_group = group _unit;
|
||||||
[_unit] joinSilent grpNull;
|
[_unit] joinSilent grpNull;
|
||||||
@ -26,12 +25,45 @@ if (count(units _group) < 1) then
|
|||||||
{
|
{
|
||||||
deleteGroup _group;
|
deleteGroup _group;
|
||||||
};
|
};
|
||||||
if (blck_launcherCleanup) then {[_unit] spawn blck_fnc_removeLaunchers;};
|
|
||||||
if (blck_removeNVG) then {[_unit] spawn blck_fnc_removeNVG;};
|
if !((vehicle _unit) isEqualTo _unit) then
|
||||||
|
{
|
||||||
|
private _veh = vehicle _unit;
|
||||||
|
diag_log format["_processAIKill: _unit %1 is in vehicle %2",_unit,_veh];
|
||||||
|
if ({alive _x} count (crew _veh) == 0) then
|
||||||
|
{
|
||||||
|
diag_log format["_processAIKill: no units alive in vehicle %1 of type %2",_veh, typeOf _veh];
|
||||||
|
if (_veh getVariable["GRG_vehType","none"] isEqualTo "emplaced") then
|
||||||
|
{
|
||||||
|
[_veh] call GMS_fnc_handleEmptyStaticWeapon;
|
||||||
|
} else {
|
||||||
|
if (blck_killEmptyAIVehicles) then
|
||||||
|
{
|
||||||
|
diag_log format["_processAIKill: disabling vehicle %1 and setting a delete time",_veh];
|
||||||
|
_veh setDamage 0.7;
|
||||||
|
_veh setFuel 0;
|
||||||
|
_veh setVariable["blck_deleteAtTime",diag_tickTime + 60];
|
||||||
|
} else {
|
||||||
|
diag_log format["_processAIKill: releasing vehicle %1 to players and setting a default delete timer",_veh];
|
||||||
|
_veh setVariable["blck_deleteAtTime",diag_tickTime + blck_vehicleDeleteTimer,true];
|
||||||
|
[_veh] call blck_fnc_releaseVehicleToPlayers;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
[_unit, ["Eject", vehicle _unit]] remoteExec ["action",(owner _unit)];
|
||||||
|
} else {
|
||||||
|
if (_unit getVariable["GRG_vehType","none"] isEqualTo "emplaced") then
|
||||||
|
{
|
||||||
|
[_unit getVariable "GRG_vehicle"] call GMS_fnc_handleEmptyStaticWeapon;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
if (blck_launcherCleanup) then {[_unit] call blck_fnc_removeLaunchers;};
|
||||||
|
if (blck_removeNVG) then {[_unit] call blck_fnc_removeNVG;};
|
||||||
if !(isPlayer _killer) exitWith {};
|
if !(isPlayer _killer) exitWith {};
|
||||||
|
|
||||||
[_unit,_killer] call blck_fnc_alertGroupUnits;
|
[_unit,_killer] call blck_fnc_alertGroupUnits;
|
||||||
[_killer] call blck_fnc_alertNearbyVehicles;
|
[_killer] call blck_fnc_alertNearbyVehicles;
|
||||||
_group = group _unit;
|
|
||||||
_wp = [_group, currentWaypoint _group];
|
_wp = [_group, currentWaypoint _group];
|
||||||
_wp setWaypointBehaviour "COMBAT";
|
_wp setWaypointBehaviour "COMBAT";
|
||||||
_group setCombatMode "RED";
|
_group setCombatMode "RED";
|
||||||
@ -48,7 +80,6 @@ if ((diag_tickTime - _lastkill) < 240) then
|
|||||||
_killer setVariable["blck_kills",0];
|
_killer setVariable["blck_kills",0];
|
||||||
};
|
};
|
||||||
|
|
||||||
[_unit, ["Eject", vehicle _unit]] remoteExec ["action",(owner _unit)];
|
|
||||||
if (blck_useKillMessages) then
|
if (blck_useKillMessages) then
|
||||||
{
|
{
|
||||||
_weapon = currentWeapon _killer;
|
_weapon = currentWeapon _killer;
|
||||||
|
@ -10,89 +10,42 @@
|
|||||||
*/
|
*/
|
||||||
#include "\q\addons\custom_server\Configs\blck_defines.hpp";
|
#include "\q\addons\custom_server\Configs\blck_defines.hpp";
|
||||||
|
|
||||||
|
// assumptions:
|
||||||
|
// 1) if the muzzle that killed the AI was forbbiden then the kill does not count
|
||||||
|
// 2) if the vehicle the player was in when the player killed the AI, the kill does not count.
|
||||||
|
// data to check: blck_forbidenVehicles
|
||||||
|
// and blck_forbidenVehicleGuns
|
||||||
|
// blck_VK_RunoverDamage
|
||||||
|
// blck_RunGear
|
||||||
private["_missionType","_wasRunover","_launcher","_legal"];
|
private["_missionType","_wasRunover","_launcher","_legal"];
|
||||||
params["_unit","_killer"];
|
params["_unit","_killer"];
|
||||||
#ifdef blck_debugMode
|
|
||||||
if (blck_debugLevel > 1) then {diag_log format["##-processIlleagalAIKills.sqf-## processing illeagal kills for unit %1",_unit]};
|
|
||||||
#endif
|
|
||||||
_launcher = _unit getVariable ["Launcher",""];
|
|
||||||
_legal = true;
|
_legal = true;
|
||||||
|
|
||||||
_fn_targetVehicle = { // force AI to fire on the vehicle with launchers if equiped
|
if (vehicle _killer == _killer) exitWith {true}; // Player not in vehicle, no further checks needed.
|
||||||
params["_unit","_vk"];
|
if (_killer == (driver (vehicle _killer))) then // If the killer is also the driver then the killer must have run the AI over
|
||||||
private["_unit"];
|
|
||||||
{
|
|
||||||
if ( ( (getPos _vk) distance2d (getPos _x) ) < 500 ) then
|
|
||||||
{
|
|
||||||
_x reveal [_vk, 4];
|
|
||||||
_x dowatch _vk;
|
|
||||||
_x doTarget _vk;
|
|
||||||
};
|
|
||||||
} forEach (call blck_fnc_allPlayers);
|
|
||||||
};
|
|
||||||
|
|
||||||
_fn_applyVehicleDamage = { // apply a bit of damage
|
|
||||||
private["_vd"];
|
|
||||||
params["_vk"];
|
|
||||||
_vd = getDammage _vk;
|
|
||||||
_vk setDamage (_vd + blck_RunGearDamage);
|
|
||||||
};
|
|
||||||
|
|
||||||
_fn_deleteAIGear = {
|
|
||||||
params["_ai"];
|
|
||||||
{deleteVehicle _x}forEach nearestObjects [(getPosATL _ai), ['GroundWeaponHolder','WeaponHolderSimulated','WeaponHolder'], 3]; //Adapted from the AI cleanup logic by KiloSwiss
|
|
||||||
[_ai] call blck_fnc_removeGear;
|
|
||||||
};
|
|
||||||
|
|
||||||
_fn_msgIED = {
|
|
||||||
params["_killer"];
|
|
||||||
//diag_log format["fn_msgIED:: -- >> msg = %1 and owner _killer = %2",blck_Message, (owner _killer)];
|
|
||||||
[["IED","",0,0],[_killer]] call blck_fnc_MessagePlayers;
|
|
||||||
};
|
|
||||||
|
|
||||||
if (typeOf _killer != typeOf (vehicle _killer)) then // AI was killed by a vehicle
|
|
||||||
{
|
{
|
||||||
if(_killer == driver(vehicle _killer))then{ // The AI was runover
|
[_unit, vehicle _killer] call GMS_fnc_revealVehicleToUnits;
|
||||||
if(blck_RunGear) then { // If we are supposed to delete gear from AI that were run over then lets do it.
|
if(blck_RunGear && !((vehicle _killer) isKindOf "Air")) then // assume aircraft are too fragile to kill AI by moving close to ground
|
||||||
[_unit] call _fn_deleteAIGear;
|
|
||||||
#ifdef blck_debugMode
|
|
||||||
if (blck_debugLevel > 2) then
|
|
||||||
{
|
{
|
||||||
diag_log format["<<--->> Unit %1 was run over by %2",_unit,_killer];
|
[_unit] call GMS_fnc_removeAllAIgear;
|
||||||
|
if (blck_VK_RunoverDamage) then
|
||||||
|
{//apply vehicle damage
|
||||||
|
[vehicle _killer] call GMS_fnc_applyVehicleDamagePenalty;
|
||||||
|
[_killer] call GMS_fnc_msgIED;
|
||||||
};
|
};
|
||||||
#endif
|
|
||||||
};
|
|
||||||
if (blck_VK_RunoverDamage) then {//apply vehicle damage
|
|
||||||
[vehicle _killer] call _fn_applyVehicleDamage;
|
|
||||||
if (blck_debugON) then{diag_log format[">>---<< %1's vehicle has had damage applied",_killer];};
|
|
||||||
[_killer] call _fn_msgIED;
|
|
||||||
};
|
|
||||||
[_unit, vehicle _killer] call _fn_targetVehicle;
|
|
||||||
_legal = false;
|
_legal = false;
|
||||||
};
|
};
|
||||||
};
|
} else {
|
||||||
|
if ( blck_VK_GunnerDamage ) then
|
||||||
if ( blck_VK_GunnerDamage ) then
|
|
||||||
{
|
|
||||||
if ((typeOf vehicle _killer) in blck_forbidenVehicles) then
|
|
||||||
{_legal = false;}
|
|
||||||
else {
|
|
||||||
if ((currentWeapon _killer) in blck_forbidenVehicleGuns) then { _legal = false;};
|
|
||||||
};
|
|
||||||
|
|
||||||
if !(_legal) then
|
|
||||||
{
|
{
|
||||||
if (blck_VK_Gear) then {[_unit] call _fn_deleteAIGear;};
|
if ((typeOf vehicle _killer) in blck_forbidenVehicles || (currentWeapon _killer) in blck_forbidenVehicleGuns) then
|
||||||
[_unit, vehicle _killer] call _fn_targetVehicle;
|
|
||||||
[vehicle _killer] call _fn_applyVehicleDamage;
|
|
||||||
[_killer] call _fn_msgIED;
|
|
||||||
#ifdef blck_debugMode
|
|
||||||
if (blck_debugLevel > 1) then
|
|
||||||
{
|
{
|
||||||
diag_log format["!!---!! Unit was killed by a forbidden vehicle or gun",_unit];
|
if (blck_VK_Gear) then {[_unit] call GMS_fnc_removeAllAIgear;};
|
||||||
|
[_unit, vehicle _killer] call GMS_fnc_revealVehicleToUnits;
|
||||||
|
[vehicle _killer] call GMS_fnc_applyVehicleDamagePenalty;
|
||||||
|
[_killer] call GMS_fnc_msgIED;
|
||||||
|
_legal = false;
|
||||||
};
|
};
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
_legal
|
_legal
|
||||||
|
@ -0,0 +1,16 @@
|
|||||||
|
/*
|
||||||
|
By Ghostrider [GRG]
|
||||||
|
Last Modified 7-27-17
|
||||||
|
|
||||||
|
Handles the case where a vehicle is hit.
|
||||||
|
|
||||||
|
--------------------------
|
||||||
|
License
|
||||||
|
--------------------------
|
||||||
|
All the code and information provided here is provided under an Attribution Non-Commercial ShareAlike 4.0 Commons License.
|
||||||
|
|
||||||
|
http://creativecommons.org/licenses/by-nc-sa/4.0/
|
||||||
|
*/
|
||||||
|
params["_ai"];
|
||||||
|
{deleteVehicle _x}forEach nearestObjects [(getPosATL _ai), ['GroundWeaponHolder','WeaponHolderSimulated','WeaponHolder'], 3]; //Adapted from the AI cleanup logic by KiloSwiss
|
||||||
|
[_ai] call blck_fnc_removeGear;
|
@ -26,18 +26,11 @@ if (toLower(blck_modType) isEqualTo "epoch") then
|
|||||||
_maxReward = 50;
|
_maxReward = 50;
|
||||||
_dist = _unit distance _killer;
|
_dist = _unit distance _killer;
|
||||||
_reward = 0;
|
_reward = 0;
|
||||||
|
_distanceBonus = floor((_unit distance _killer)/100);
|
||||||
if (_dist < 50) then { _reward = _maxReward - (_maxReward / 1.25); _reward };
|
_killstreakBonus = 3 * (_killer getVariable["blck_kills",0]);
|
||||||
if (_dist < 100) then { _reward = _maxReward - (_maxReward / 1.5); _reward };
|
_reward = 25 + _distanceBonus + _killstreakBonus;
|
||||||
if (_dist < 800) then { _reward = _maxReward - (_maxReward / 2); _reward };
|
|
||||||
if (_dist > 800) then { _reward = _maxReward - (_maxReward / 4); _reward };
|
|
||||||
//diag_log format["_fnc_rewardPlayer: _killer %1 | _dist %2 | _reward %3 ",_killer,_dist,_reward];
|
|
||||||
//diag_log format["_fnc_rewardPlayer: blck_addAIMoney %1 | blck_useKillScoreMessage %2",blck_addAIMoney,blck_useKillScoreMessage];
|
|
||||||
private _killstreakReward=+(_kills*2);
|
private _killstreakReward=+(_kills*2);
|
||||||
if (blck_addAIMoney) then
|
|
||||||
{
|
|
||||||
[_killer,_reward + _killstreakReward] call blck_fnc_giveTakeCrypto;
|
[_killer,_reward + _killstreakReward] call blck_fnc_giveTakeCrypto;
|
||||||
};
|
|
||||||
if (blck_useKillScoreMessage) then
|
if (blck_useKillScoreMessage) then
|
||||||
{
|
{
|
||||||
[["showScore",[_reward,"",_kills],""],[_killer]] call blck_fnc_messageplayers;
|
[["showScore",[_reward,"",_kills],""],[_killer]] call blck_fnc_messageplayers;
|
||||||
|
@ -0,0 +1,16 @@
|
|||||||
|
/*
|
||||||
|
Killed handler for _units
|
||||||
|
By Ghostrider-GRG-
|
||||||
|
|
||||||
|
--------------------------
|
||||||
|
License
|
||||||
|
--------------------------
|
||||||
|
All the code and information provided here is provided under an Attribution Non-Commercial ShareAlike 4.0 Commons License.
|
||||||
|
|
||||||
|
http://creativecommons.org/licenses/by-nc-sa/4.0/
|
||||||
|
*/
|
||||||
|
|
||||||
|
private["_vd"];
|
||||||
|
params["_vk"];
|
||||||
|
_vd = getDammage _vk;
|
||||||
|
_vk setDamage (_vd + blck_RunGearDamage);
|
@ -0,0 +1,22 @@
|
|||||||
|
// GMS_fnc_handleEmptyStaticWeapon.sqf
|
||||||
|
/*
|
||||||
|
By Ghostrider [GRG]
|
||||||
|
|
||||||
|
--------------------------
|
||||||
|
License
|
||||||
|
--------------------------
|
||||||
|
All the code and information provided here is provided under an Attribution Non-Commercial ShareAlike 4.0 Commons License.
|
||||||
|
|
||||||
|
http://creativecommons.org/licenses/by-nc-sa/4.0/
|
||||||
|
*/
|
||||||
|
params["_veh"];
|
||||||
|
if (blck_killEmptyStaticWeapons) then
|
||||||
|
{
|
||||||
|
diag_log format["_processAIKill: disabling static %1 and setting its delete time",_veh];
|
||||||
|
_veh setDamage 1;
|
||||||
|
_veh setVariable["blck_deleteAtTime",diag_tickTime + 60,true];
|
||||||
|
}else {
|
||||||
|
diag_log format["_processAIKill: releasing static %1 to players and setting a default delete timer",_veh];
|
||||||
|
[_veh] call blck_fnc_releaseVehicleToPlayers; //Call this from _processAIKill
|
||||||
|
_veh setVariable["blck_DeleteAt",diag_tickTime + blck_vehicleDeleteTimer,true];
|
||||||
|
};
|
@ -9,22 +9,11 @@
|
|||||||
|
|
||||||
http://creativecommons.org/licenses/by-nc-sa/4.0/
|
http://creativecommons.org/licenses/by-nc-sa/4.0/
|
||||||
*/
|
*/
|
||||||
|
// assummptions: since this is called after an AI Killed event that always runs on the server we can assume this code will too.
|
||||||
#include "\q\addons\custom_server\Configs\blck_defines.hpp";
|
#include "\q\addons\custom_server\Configs\blck_defines.hpp";
|
||||||
|
|
||||||
params["_veh"];
|
params["_veh"];
|
||||||
if (local _veh) then {
|
[_veh] call GMS_fnc_unlockServerVehicle;
|
||||||
_veh lock false;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
if (isserver) then {
|
|
||||||
[_veh,false] remoteExecCall ["lock",_veh]; // let the machine, where the vehicle is local unlock it (only the server knows, who the owner is!!!)
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
[[_veh,false],["lock",_veh]] remoteExecCall ["remoteExecCall", 2]; // If run on HC, move to the server. Server will remoteexec on local machine
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
{
|
{
|
||||||
_veh removealleventhandlers _x;
|
_veh removealleventhandlers _x;
|
||||||
} forEach ["GetIn","GetOut","fired","hit","hitpart","reloaded","dammaged","HandleDamage"];
|
} forEach ["GetIn","GetOut","fired","hit","hitpart","reloaded","dammaged","HandleDamage"];
|
||||||
|
@ -16,26 +16,17 @@
|
|||||||
params["_veh"];
|
params["_veh"];
|
||||||
private ["_crew","_mag","_allMags","_cnt"];
|
private ["_crew","_mag","_allMags","_cnt"];
|
||||||
// https://community.bistudio.com/wiki/fullCrew
|
// https://community.bistudio.com/wiki/fullCrew
|
||||||
// 0 1 2 3 4
|
|
||||||
// returns Array - format [[<Object>unit,<String>role,<Number>cargoIndex,<Array>turretPath,<Boolean>personTurret], ...]
|
|
||||||
//diag_log format["_fnc_vehicleMonitor:: (65) _veh = %1",_veh];
|
|
||||||
if ({alive _x and !(isPlayer _x)} count (crew _veh) > 0) then
|
if ({alive _x and !(isPlayer _x)} count (crew _veh) > 0) then
|
||||||
{
|
{
|
||||||
_crew = fullCrew _veh;
|
_crew = fullCrew _veh;
|
||||||
//diag_log format["_fnc_vehicleMonitor:: (67) _crew = %1",_crew];
|
|
||||||
{
|
{
|
||||||
//diag_log format ["_fnc_vehicleMonitor:: (69) _x = %1",_x];
|
|
||||||
_mag = _veh currentMagazineTurret (_x select 3);
|
_mag = _veh currentMagazineTurret (_x select 3);
|
||||||
if (count _mag > 0) then
|
if (count _mag > 0) then
|
||||||
{
|
{
|
||||||
//diag_log format["_fnc_vehicleMonitor:: (71) _mag is typeName %1", typeName _mag];
|
|
||||||
//diag_log format ["_fnc_vehicleMonitor:: (71) length _mag = %2 and _mag = %1",_mag,count _mag];
|
|
||||||
_allMags = magazinesAmmo _veh;
|
_allMags = magazinesAmmo _veh;
|
||||||
//diag_log format["_fnc_vehicleMonitor:: (71) _allMags = %1",_allMags];
|
|
||||||
_cnt = ( {_mag isEqualTo (_x select 0)}count _allMags);
|
_cnt = ( {_mag isEqualTo (_x select 0)}count _allMags);
|
||||||
//diag_log format["_fnc_vehicleMonitor:: (75) _cnt = %1",_cnt];
|
|
||||||
if (_cnt < 2) then {_veh addMagazineCargo [_mag,2]};
|
if (_cnt < 2) then {_veh addMagazineCargo [_mag,2]};
|
||||||
};
|
};
|
||||||
} forEach _crew;
|
} forEach _crew;
|
||||||
};
|
};
|
||||||
//};
|
|
@ -0,0 +1,18 @@
|
|||||||
|
/*
|
||||||
|
By Ghostrider-GRG-
|
||||||
|
|
||||||
|
--------------------------
|
||||||
|
License
|
||||||
|
--------------------------
|
||||||
|
All the code and information provided here is provided under an Attribution Non-Commercial ShareAlike 4.0 Commons License.
|
||||||
|
|
||||||
|
http://creativecommons.org/licenses/by-nc-sa/4.0/
|
||||||
|
*/
|
||||||
|
|
||||||
|
params["_unit","_vk"];
|
||||||
|
private["_unit"];
|
||||||
|
{
|
||||||
|
_x reveal [_vk, 4];
|
||||||
|
_x dowatch _vk;
|
||||||
|
_x doTarget _vk;
|
||||||
|
} forEach ([getPos _unit, 500] call blck_fnc_allPlayers); // get all players within 500 m
|
@ -0,0 +1,21 @@
|
|||||||
|
/*
|
||||||
|
By Ghostrider [GRG]
|
||||||
|
Copyright 2016
|
||||||
|
|
||||||
|
--------------------------
|
||||||
|
License
|
||||||
|
--------------------------
|
||||||
|
All the code and information provided here is provided under an Attribution Non-Commercial ShareAlike 4.0 Commons License.
|
||||||
|
|
||||||
|
http://creativecommons.org/licenses/by-nc-sa/4.0/
|
||||||
|
*/
|
||||||
|
// assumptions: there are no crew in vehicle. there are no players in vehicle. thus we can just be sure the owner is the server then set the lock locally
|
||||||
|
#include "\q\addons\custom_server\Configs\blck_defines.hpp";
|
||||||
|
params["_vehicle"];
|
||||||
|
if !(local _vehicle) then
|
||||||
|
{
|
||||||
|
private _return = _vehicle setOwner 2;
|
||||||
|
};
|
||||||
|
_vehicle setVehicleLock "UNLOCKED";
|
||||||
|
diag_log format["_fn_unlockServerVehicle: owner of vehicle %1 = %2",_vehicle, owner _vehicle];
|
||||||
|
diag_log format["_fn_unlockServerVehicle: vehicle %1 lock state set to %2",_vehicle,locked _vehicle];
|
@ -33,35 +33,6 @@ for "_i" from 1 to (count blck_monitoredVehicles) do
|
|||||||
blck_monitoredVehicles pushBack _veh;
|
blck_monitoredVehicles pushBack _veh;
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
if ({alive _veh} count (crew _veh) == 0) then
|
|
||||||
{
|
|
||||||
if (_veh getVariable["GRG_vehType","none"] isEqualTo "emplaced") then
|
|
||||||
{
|
|
||||||
if (blck_killEmptyStaticWeapons) then
|
|
||||||
{
|
|
||||||
//diag_log format["_fnc_vehicleMonitor: disabling static %1 and setting its delete time",_veh];
|
|
||||||
_veh setDamage 1;
|
|
||||||
_veh setVariable["blck_deleteAtTime",diag_tickTime + 60,true];
|
|
||||||
}else {
|
|
||||||
//diag_log format["_fnc_vehicleMonitor: releasing static %1 to players and setting a default delete timer",_veh];
|
|
||||||
[_veh] call blck_fnc_releaseVehicleToPlayers;
|
|
||||||
_veh setVariable["blck_DeleteAt",diag_tickTime + blck_vehicleDeleteTimer,true];
|
|
||||||
};
|
|
||||||
} else {
|
|
||||||
if (blck_killEmptyAIVehicles) then
|
|
||||||
{
|
|
||||||
//diag_log format["_fnc_vehicleMonitor: disabling vehicle %1 and setting a delete time",_veh];
|
|
||||||
_veh setDamage 0.7;
|
|
||||||
_veh setFuel 0;
|
|
||||||
_veh setVariable["blck_deleteAtTime",diag_tickTime + 60];
|
|
||||||
} else {
|
|
||||||
//diag_log format["-------->_fnc_vehicleMonitor: releasing vehicle %1 to players and setting a default delete timer",_veh];
|
|
||||||
_veh setVariable["blck_deleteAtTime",diag_tickTime + blck_vehicleDeleteTimer,true];
|
|
||||||
[_veh] call blck_fnc_releaseVehicleToPlayers;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
};
|
|
||||||
blck_monitoredVehicles pushBack _veh;
|
blck_monitoredVehicles pushBack _veh;
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
|
@ -42,6 +42,8 @@ private _functions = [
|
|||||||
//["blck_fnc_emptyObjectInventory","\q\addons\custom_server\Compiles\Functions\GMS_fnc_emptyObjectInventory.sqf"],
|
//["blck_fnc_emptyObjectInventory","\q\addons\custom_server\Compiles\Functions\GMS_fnc_emptyObjectInventory.sqf"],
|
||||||
["blck_fnc_spawnMissionLandscapeRelative","\q\addons\custom_server\Compiles\Functions\GMS_fnc_spawnMissionLandscapeRelative.sqf"],
|
["blck_fnc_spawnMissionLandscapeRelative","\q\addons\custom_server\Compiles\Functions\GMS_fnc_spawnMissionLandscapeRelative.sqf"],
|
||||||
["blck_fnc_nearestPlayers","\q\addons\custom_server\Compiles\Functions\GMS_fnc_nearestPlayers.sqf"],
|
["blck_fnc_nearestPlayers","\q\addons\custom_server\Compiles\Functions\GMS_fnc_nearestPlayers.sqf"],
|
||||||
|
["GMS_fnc_msgIED","\q\addons\custom_server\Compiles\Functions\GMS_fnc_msgIED.sqf"],
|
||||||
|
|
||||||
|
|
||||||
// Player-related functions
|
// Player-related functions
|
||||||
["blck_fnc_rewardKiller","\q\addons\custom_server\Compiles\Units\GMS_fnc_rewardKiller.sqf"],
|
["blck_fnc_rewardKiller","\q\addons\custom_server\Compiles\Units\GMS_fnc_rewardKiller.sqf"],
|
||||||
@ -121,6 +123,11 @@ private _functions = [
|
|||||||
["blck_fnc_reloadVehicleAmmo","\q\addons\custom_server\Compiles\Vehicles\GMS_fnc_reloadVehicleAmmo.sqf"],
|
["blck_fnc_reloadVehicleAmmo","\q\addons\custom_server\Compiles\Vehicles\GMS_fnc_reloadVehicleAmmo.sqf"],
|
||||||
["blck_fnc_scanForPlayersNearVehicles","\q\addons\custom_server\Compiles\Vehicles\GMS_fnc_scanForPlayersNearVehicles.sqf"],
|
["blck_fnc_scanForPlayersNearVehicles","\q\addons\custom_server\Compiles\Vehicles\GMS_fnc_scanForPlayersNearVehicles.sqf"],
|
||||||
["blck_fnc_revealNearbyPlayers","\q\addons\custom_server\Compiles\Vehicles\GMS_fnc_revealNearbyPlayers.sqf"],
|
["blck_fnc_revealNearbyPlayers","\q\addons\custom_server\Compiles\Vehicles\GMS_fnc_revealNearbyPlayers.sqf"],
|
||||||
|
["GMS_fnc_unlockServerVehicle","\q\addons\custom_server\Compiles\Vehicles\GMS_fnc_unlockServerVehicle.sqf"],
|
||||||
|
["GMS_fnc_applyVehicleDamagePenalty","\q\addons\custom_server\Compiles\Vehicles\GMS_fnc_applyVehicleDamagePenalty.sqf"],
|
||||||
|
["GMS_fnc_revealVehicleToUnits","\q\addons\custom_server\Compiles\Vehicles\GMS_fnc_revealVehicleToUnits.sqf"],
|
||||||
|
["GMS_fnc_handleEmptyStaticWeapon","\q\addons\custom_server\Compiles\Vehicles\GMS_fnc_handleEmptyStaticWeapon.sqf"],
|
||||||
|
// GMS_fnc_handleEmptyStaticWeapon
|
||||||
|
|
||||||
// functions to support Units
|
// functions to support Units
|
||||||
["blck_fnc_removeGear","\q\addons\custom_server\Compiles\Units\GMS_fnc_removeGear.sqf"], // Strip an AI unit of all gear.
|
["blck_fnc_removeGear","\q\addons\custom_server\Compiles\Units\GMS_fnc_removeGear.sqf"], // Strip an AI unit of all gear.
|
||||||
@ -147,6 +154,8 @@ private _functions = [
|
|||||||
["blck_fnc_spawnParaUnits","\q\addons\custom_server\Compiles\Units\GMS_fnc_spawnParaUnits.sqf"],
|
["blck_fnc_spawnParaUnits","\q\addons\custom_server\Compiles\Units\GMS_fnc_spawnParaUnits.sqf"],
|
||||||
["blck_fnc_nextAnim","\q\addons\custom_server\Compiles\Units\GMS_fnc_nextAnim.sqf"],
|
["blck_fnc_nextAnim","\q\addons\custom_server\Compiles\Units\GMS_fnc_nextAnim.sqf"],
|
||||||
["blck_fnc_placeCharacterInBuilding","\q\addons\custom_server\Compiles\Units\GMS_fnc_placeCharacterInBuilding.sqf"],
|
["blck_fnc_placeCharacterInBuilding","\q\addons\custom_server\Compiles\Units\GMS_fnc_placeCharacterInBuilding.sqf"],
|
||||||
|
["GMS_fnc_removeAllAIgear","\q\addons\custom_server\Compiles\Units\GMS_fnc_removeAllAIgear.sqf"],
|
||||||
|
["GMS_fnc_alertGroupUnits","\q\addons\custom_server\Compiles\Functions\GMS_fnc_alertGroupUnits.sqf"],
|
||||||
|
|
||||||
// HC support functions
|
// HC support functions
|
||||||
["blck_fnc_HC_XferGroup","\q\addons\custom_server\Compiles\HC\GMS_fnc_HC_XferGroup.sqf"],
|
["blck_fnc_HC_XferGroup","\q\addons\custom_server\Compiles\HC\GMS_fnc_HC_XferGroup.sqf"],
|
||||||
|
@ -11,8 +11,8 @@
|
|||||||
http://creativecommons.org/licenses/by-nc-sa/4.0/
|
http://creativecommons.org/licenses/by-nc-sa/4.0/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "\q\addons\custom_server\Configs\blck_defines.hpp";
|
#include "\q\addons\custom_server\Configs\blck_defines.hpp"
|
||||||
|
#include "\q\addons\custom_server\init\build.sqf"
|
||||||
/*
|
/*
|
||||||
changing any of these variables may break the mission systemChat
|
changing any of these variables may break the mission systemChat
|
||||||
*/
|
*/
|
||||||
|
@ -186,14 +186,11 @@ AI WEAPONS, UNIFORMS, VESTS AND GEAR
|
|||||||
"Exile_Car_HMMWV_M2_Desert",
|
"Exile_Car_HMMWV_M2_Desert",
|
||||||
"B_LSV_01_armed_F"
|
"B_LSV_01_armed_F"
|
||||||
];
|
];
|
||||||
|
|
||||||
#ifdef useCUP
|
#ifdef useCUP
|
||||||
blck_AIPatrolVehiclesRed = _blck_lightlyArmed_ARMA3 + _blck_APC_CUP;
|
blck_AIPatrolVehiclesRed = _blck_lightlyArmed_ARMA3 + _blck_APC_CUP;
|
||||||
blck_AIPatrolVehiclesGreen = _blck_Tanks_ARMA3 + _blck_Tanks_CUP;
|
blck_AIPatrolVehiclesGreen = _blck_Tanks_ARMA3 + _blck_Tanks_CUP;
|
||||||
blck_AIPatrolVehiclesOrange = _blck_Tanks_ARMA3 + _blck_Tanks_CUP;
|
blck_AIPatrolVehiclesOrange = _blck_Tanks_ARMA3 + _blck_Tanks_CUP;
|
||||||
#else
|
|
||||||
blck_AIPatrolVehiclesRed = _blck_lightlyArmed_ARMA3;
|
|
||||||
blck_AIPatrolVehiclesGreen = _blck_Tanks_ARMA3;
|
|
||||||
blck_AIPatrolVehiclesOrange = _blck_Tanks_ARMA3;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (toLower(worldName) isEqualTo "namalsk") then
|
if (toLower(worldName) isEqualTo "namalsk") then
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "\q\addons\custom_server\Configs\blck_defines.hpp";
|
#include "\q\addons\custom_server\Configs\blck_defines.hpp";
|
||||||
|
#include "\q\addons\custom_server\init\build.sqf"
|
||||||
diag_log format["[blckeagls] Loading blck_configs_mil.sqf for Militarized Servers for blckeagls build %1",blck_buildNumber];
|
diag_log format["[blckeagls] Loading blck_configs_mil.sqf for Militarized Servers for blckeagls build %1",blck_buildNumber];
|
||||||
|
|
||||||
/***************************************************************
|
/***************************************************************
|
||||||
|
@ -150,9 +150,9 @@ if (blck_debugON || (blck_debugLevel > 0)) then // These variables are found in
|
|||||||
blck_mainThreadUpdateInterval = 10;
|
blck_mainThreadUpdateInterval = 10;
|
||||||
blck_enableOrangeMissions = -1;
|
blck_enableOrangeMissions = -1;
|
||||||
blck_enableGreenMissions = -1;
|
blck_enableGreenMissions = -1;
|
||||||
blck_enableRedMissions = 1;
|
blck_enableRedMissions = -1;
|
||||||
blck_enableBlueMissions = -1;
|
blck_enableBlueMissions = 1;
|
||||||
blck_numberUnderwaterDynamicMissions = -3;
|
blck_numberUnderwaterDynamicMissions = 3;
|
||||||
blck_enableHunterMissions = -1;
|
blck_enableHunterMissions = -1;
|
||||||
blck_enableScoutsMissions = -1;
|
blck_enableScoutsMissions = -1;
|
||||||
blck_maxCrashSites = -3;
|
blck_maxCrashSites = -3;
|
||||||
@ -203,9 +203,9 @@ if (blck_debugON || (blck_debugLevel > 0)) then // These variables are found in
|
|||||||
blck_TMax_Crashes = 15;
|
blck_TMax_Crashes = 15;
|
||||||
blck_TMax_UMS = 25;
|
blck_TMax_UMS = 25;
|
||||||
|
|
||||||
blck_MinAI_Orange = 1;
|
//blck_MinAI_Orange = 1;
|
||||||
blck_MaxAI_Orange = 2;
|
//blck_MaxAI_Orange = 2;
|
||||||
blck_AIGrps_Orange = 0;
|
//blck_AIGrps_Orange = 0;
|
||||||
|
|
||||||
//blck_MinAI_Blue = 1;
|
//blck_MinAI_Blue = 1;
|
||||||
//blck_MaxAI_Blue = 2;
|
//blck_MaxAI_Blue = 2;
|
||||||
|
@ -11,18 +11,18 @@
|
|||||||
http://creativecommons.org/licenses/by-nc-sa/4.0/
|
http://creativecommons.org/licenses/by-nc-sa/4.0/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#define useAPEX
|
#define useAPEX
|
||||||
//#define blck_milServer
|
#define blck_milServer
|
||||||
//#define blck_useCUP
|
#define blck_useCUP
|
||||||
//#define blck_useRHS
|
//#define blck_useRHS
|
||||||
//#define blck_addCarParts (For Exile should you wish to use some of the advanced repair scripts).
|
|
||||||
////////////////////////////
|
////////////////////////////
|
||||||
// Do not touch anything below this line
|
// Do not touch anything below this line
|
||||||
///////////////////////////
|
///////////////////////////
|
||||||
|
|
||||||
//#define blck_debugMode
|
//#define blck_debugMode
|
||||||
|
#define GRGserver
|
||||||
|
#define blck_addCarParts
|
||||||
#define blck_triggerLoopCompleteTime 40*60
|
#define blck_triggerLoopCompleteTime 40*60
|
||||||
#define onFoot 1
|
#define onFoot 1
|
||||||
#define inVehicle 2
|
#define inVehicle 2
|
||||||
@ -56,6 +56,3 @@
|
|||||||
#define blck_turnBackRadiusVehicles 1000
|
#define blck_turnBackRadiusVehicles 1000
|
||||||
#define blck_turnBackRadiusHelis 1000
|
#define blck_turnBackRadiusHelis 1000
|
||||||
#define blck_turnBackRadiusJets 1500
|
#define blck_turnBackRadiusJets 1500
|
||||||
|
|
||||||
#define blck_buildNumber 167
|
|
||||||
#define blck_versionNumber 6.88
|
|
||||||
|
@ -128,5 +128,6 @@ if (blck_enableBlueMissions > 0) then
|
|||||||
|
|
||||||
// start the main thread for the mission system which monitors missions running and stuff to be cleaned up
|
// start the main thread for the mission system which monitors missions running and stuff to be cleaned up
|
||||||
[] spawn blck_fnc_mainThread;
|
[] spawn blck_fnc_mainThread;
|
||||||
|
blck_pvs_version = blck_versionNumber;
|
||||||
|
publicVariable "blck_pvs_version";
|
||||||
diag_log "[blckeagls] < MISSION SYSTEM FULLY INITIALIZED AND RUNNING >";
|
diag_log "[blckeagls] < MISSION SYSTEM FULLY INITIALIZED AND RUNNING >";
|
||||||
|
@ -1,7 +1,4 @@
|
|||||||
#include "\q\addons\custom_server\Configs\blck_defines.hpp";
|
|
||||||
private ["_version","_versionDate"];
|
#define blck_buildNumber 170
|
||||||
blck_version = format["6.88 Build %1",blck_buildNumber];
|
#define blck_versionNumber 6.90
|
||||||
_blck_version = blck_version;
|
|
||||||
_blck_versionDate = "12-1-18 8:00 AM";
|
|
||||||
blck_pvs_version = _blck_version;
|
|
||||||
publicVariable blck_pvs_version;
|
|
||||||
|
Loading…
Reference in New Issue
Block a user