This commit is contained in:
IT07 2016-05-20 13:54:12 +02:00
parent 74517751b1
commit 4f87ee3314
18 changed files with 1203 additions and 1248 deletions

View File

@ -12,7 +12,7 @@ class CfgFunctions
class getSetting {};
class giveAmmo {};
class giveWeaponItems {};
class headLessClient {};
class headlessClient {};
class launch { postInit = 1; };
class loadInv {};
class loadLoot {};

View File

@ -6,7 +6,7 @@ class CfgPatches
requiredAddons[] = {"exile_server","exile_vemf_reloaded_config"};
fileName = "exile_vemf_reloaded.pbo";
requiredVersion = 1.56; // VEMFr does not work on older versions due to use of the latest scripting commands
version = "0743.0"; // Do NOT change
version = "0743.1"; // Do NOT change
author = "IT07";
};
};

View File

@ -23,15 +23,12 @@ if (count _pos isEqualTo 3) then
if (_rad > -1) then
{ // Check all player distances from _loc
{
if (isPlayer _x) then
{
if (speed _x < 250) then // Ignore fast moving players
if (isPlayer _x AND speed _x < 250) then
{
private ["_isClose"];
_isClose = if ((position _x distance _pos) < _rad) then { true } else { false };
if _isClose then { _found = true };
};
};
} forEach allPlayers;
};
};

View File

@ -86,8 +86,8 @@ if not(_mode isEqualTo "") then
_listedMaps pushBack (configName _x);
} forEach _blackListMapClasses;
private ["_blackList"];
if (worldName in _listedMaps) then { _blackList = ([["locationBlackLists", worldName],["locations"]] call VEMFr_fnc_getSetting) select 0 };
if not(worldName in _listedMaps) then { _blackList = ([["locationBlackLists","Other"],["locations"]] call VEMFr_fnc_getSetting) select 0 };
if (worldName in _listedMaps) then { _blackList = ([["locationBlackLists", worldName],["locations"]] call VEMFr_fnc_getSetting) select 0 }
else { _blackList = ([["locationBlackLists","Other"],["locations"]] call VEMFr_fnc_getSetting) select 0 };
{ // Check _locs for invalid locations (too close, hasPlayers or inBlacklist)
private ["_hasPlayers"];
@ -95,8 +95,7 @@ if not(_mode isEqualTo "") then
if _hasPlayers then
{
_remLocs pushBack _x;
};
if not _hasPlayers then
} else
{
if _checkBlackPos then
{
@ -117,8 +116,7 @@ if not(_mode isEqualTo "") then
_remLocs pushBack _loc;
};
};
};
if not(count _x isEqualTo 2) then
} else
{
["fn_findPos", 0, format["found invalid entry in mission blacklist: %1", _x]] ExecVM "exile_vemf_reloaded\sqf\log.sqf";
};
@ -127,14 +125,12 @@ if not(_mode isEqualTo "") then
if ((text _x) in _blackList) then
{
_remLocs pushBack _x;
};
if not((text _x) in _blackList) then
} else
{
if (_cntr distance (locationPosition _x) < _tooCloseRange) then
{
_remLocs pushBack _x;
};
if (_cntr distance (locationPosition _x) > _tooCloseRange) then
} else
{
if (_x in _usedLocs) then
{
@ -156,18 +152,17 @@ if not(_mode isEqualTo "") then
};
} forEach _locs;
{ // Remove all invalid locations from _locs
private ["_index"];
{ // Remove all invalid locations from _locs
_index = _locs find _x;
_locs deleteAt _index;
} forEach _remLocs;
private ["_far","_pref"];
private ["_far","_pref","_dist"];
// Check what kind of distances we have
_far = []; // Further than _maxPrefered
_pref = []; // Closer then _maxPrefered
{
private ["_dist"];
_dist = _cntr distance (locationPosition _x);
if (_dist > _maxPrefered) then
{

View File

@ -62,28 +62,23 @@ if (_this isEqualType []) then
{
private ["_path","_build"];
_path = _this select 0;
//["fn_getSetting", 1, format["_path = %1", _path]] ExecVM "exile_vemf_reloaded\sqf\log.sqf";
_build =
{
{
_cfg = _cfg >> _x;
} forEach _path;
};
{
private ["_cfg"];
{
_cfg = configFile >> "CfgVemfReloadedOverrides";
call _build;
_cfg = _cfg >> _x;
//["fn_getSetting", 1, format["_cfg after first build = %1", _cfg]] ExecVM "exile_vemf_reloaded\sqf\log.sqf";
if (isNull _cfg) then
{
//["fn_getSetting", 1, format["_cfg isNull. Resetting _cfg...."]] ExecVM "exile_vemf_reloaded\sqf\log.sqf";
_cfg = configFile >> "CfgVemfReloaded";
call _build;
_cfg = _cfg >> _x;
//["fn_getSetting", 1, format["_cfg after second build = %1", _cfg]] ExecVM "exile_vemf_reloaded\sqf\log.sqf";
};
//["fn_getSetting", 1, format["_cfg after appending _x = %1", _cfg]] ExecVM "exile_vemf_reloaded\sqf\log.sqf";
call _check;
if not isNil"_v" then
{
@ -92,9 +87,9 @@ if (_this isEqualType []) then
} forEach (_this select 1);
};
if (_this isEqualTypeArray [[]]) then
{
{
private ["_cfg"];
{
_cfg = configFile >> "CfgVemfReloadedOverrides" >> _x;
if (isNull _cfg) then
{

View File

@ -33,13 +33,11 @@ if (_this isEqualType []) then
{
if (_x find "tws" > -1) then
{
//["fn_giveWeaponItems", 0, format["This scope is not allowed: %1", _x]] ExecVM "exile_vemf_reloaded\sqf\log.sqf";
_indexes pushBack _forEachIndex;
} else
{
if (_x find "TWS" > -1) then
{
//["fn_giveWeaponItems", 0, format["This scope is not allowed: %1", _x]] ExecVM "exile_vemf_reloaded\sqf\log.sqf";
_indexes pushBack _forEachIndex;
};
};

View File

@ -19,13 +19,10 @@ if (("headLessClientSupport" call VEMFr_fnc_getSetting) isEqualTo 1) then
// We have the names now, check if any of them is actually ingame
_ingameHCs = [];
{
if (typeOf _x isEqualTo "HeadlessClient_F") then
{
if (_x in _hcList) then
if (side _x isEqualTo sideLogic AND _x in _hcList) then
{
_ingameHCs pushBack [_x, name _x];
};
};
} forEach allPlayers;
if (count _ingameHCs > 0) then
{ // At least 1 of given headless clients is ingame, lets check their load
@ -33,8 +30,8 @@ if (("headLessClientSupport" call VEMFr_fnc_getSetting) isEqualTo 1) then
_globalLoad = uiNamespace getVariable "VEMFrHcLoad";
_lowestLoad = 99999;
_hasLowest = "";
{ // Find the lowest load number
private ["_load"];
{ // Find the lowest load number
_load = _x select 1;
if (_load < _lowestLoad) then
{
@ -42,7 +39,6 @@ if (("headLessClientSupport" call VEMFr_fnc_getSetting) isEqualTo 1) then
_hasLowest = _x select 0;
};
} forEach _globalLoad;
private ["_index"];
// HC with lowest load found, add +1 to its current load
_index = _globalLoad find [_hasLowest, _lowestLoad];
@ -50,10 +46,20 @@ if (("headLessClientSupport" call VEMFr_fnc_getSetting) isEqualTo 1) then
{
_globalLoad set [_index,[_hasLowest, _lowestLoad +1]]
};
} else
{
["fn_headlessClient", 0, "Unable to find any ingame Headless Client(s)"] spawn VEMFr_fnc_log;
};
} else
{
["fn_headLessClient", 0, "Can not run. headLessClientSupport is not enabled"] ExecVM "exile_vemf_reloaded\sqf\log.sqf";
};
// Lowest load found, send it
if not isNil"_hasLowest" then
{
_hasLowest
} else
{
["fn_headlessClient", 0, "Unable to find HC with lowest load..."] spawn VEMFr_fnc_log;
};

View File

@ -31,14 +31,12 @@ uiNamespace setVariable ["VEMFrHcLoad", []];
["overridesToRPT", 1, format["Overriding 'CfgVemfReloaded >> %1 >> %2 >> %3'", _classLv1Name, _classLv2Name, configName _x]] ExecVM "exile_vemf_reloaded\sqf\log.sqf";
};
} forEach _levelTwo;
};
if not(isClass _x) then
} else
{
["overridesToRPT", 1, format["Overriding 'CfgVemfReloaded >> %1 >> %2", _classLv1Name, configName _x]] ExecVM "exile_vemf_reloaded\sqf\log.sqf";
};
} forEach _levelOne;
};
if not(isClass _x) then
} else
{
["overridesToRPT", 1, format["Overriding 'CfgVemfReloaded >> %1'", configName _x]] ExecVM "exile_vemf_reloaded\sqf\log.sqf";
};

View File

@ -61,7 +61,6 @@ if (_this isEqualType []) then
removeBackpack _unit;
removeGoggles _unit;
removeHeadGear _unit;
if (count _uniforms > 0) then
{
removeUniform _unit;
@ -70,10 +69,8 @@ if (_this isEqualType []) then
};
_gear = selectRandom _headGear;
_unit addHeadGear _gear;
_gear = selectRandom _vests;
_unit addVest _gear;
if (_aiLaunchers isEqualTo 1) then
{
if (_launcherChance isEqualTo 100 OR (ceil random (100 / _launcherChance) isEqualTo (ceil random (100 / _launcherChance)))) then
@ -86,9 +83,9 @@ if (_this isEqualType []) then
{
_unit addBackpack "B_Parachute";
};
private ["_ammo"];
_gear = selectRandom _launchers;
_unit addWeapon _gear;
private ["_ammo"];
_ammo = getArray (configFile >> "cfgWeapons" >> _gear >> "magazines");
if (count _ammo > 2) then
{
@ -105,10 +102,8 @@ if (_this isEqualType []) then
_gear = selectRandom _rifles;
_unit addWeapon _gear;
_unit selectWeapon _gear;
_gear = selectRandom _pistols;
_unit addWeapon _gear;
// Give this guy some ammo
_givenAmmo = [_unit] call VEMFr_fnc_giveAmmo;
if not _givenAmmo then
@ -121,7 +116,6 @@ if (_this isEqualType []) then
{
["fn_loadInv", 0, format["FAILED to giveWeaponItems to %1", _unit]] ExecVM "exile_vemf_reloaded\sqf\log.sqf";
};
} forEach _units;
_ok = true;
breakOut "this";
@ -163,7 +157,6 @@ if (_this isEqualType []) then
_unit selectWeapon _rifle;
_pistol = selectRandom _pistols;
_unit addWeapon _pistol;
if not(_missionName isEqualTo "BaseAttack") then
{
_backpack = selectRandom _backpacks;
@ -172,7 +165,6 @@ if (_this isEqualType []) then
{
_unit addBackpack "B_Parachute";
};
// Give this guy some ammo
_givenAmmo = [_unit] call VEMFr_fnc_giveAmmo;
if not _givenAmmo then
@ -199,17 +191,17 @@ if (_this isEqualType []) then
private ["_unit","_rifle","_pistol","_givenAmmo","_giveAttachments"];
_unit = _x;
// Strip it
removeAllWeapons _unit;
removeAllItems _unit;
if ("removeAllAssignedItems" call VEMFr_fnc_getSetting isEqualTo 1) then
{
removeAllAssignedItems _unit;
};
removeUniform _unit;
removeVest _unit;
removeAllItems _unit;
removeAllWeapons _unit;
removeBackpack _unit;
removeGoggles _unit;
removeHeadGear _unit;
removeUniform _unit;
removeVest _unit;
_unit addHeadGear "H_HelmetB_light_black";
_unit addGoggles "G_Balaclava_blk";
_unit addVest "V_PlateCarrier2_blk";
@ -224,7 +216,6 @@ if (_this isEqualType []) then
{
_unit addBackpack "B_Parachute";
};
// Give this guy some ammo
_givenAmmo = [_unit] call VEMFr_fnc_giveAmmo;
if not _givenAmmo then

View File

@ -13,13 +13,12 @@ _crate = param [0, objNull, [objNull]];
if not isNull _crate then
{
_crate setVariable ["VEMFrCrate", 1, true];
clearWeaponCargoGlobal _crate;
clearMagazineCargoGlobal _crate;
clearBackpackCargoGlobal _crate;
clearItemCargoGlobal _crate;
clearMagazineCargoGlobal _crate;
clearWeaponCargoGlobal _crate;
private ["_settings"];
_settings =
[
_settings = [
["crateLoot"],
[
"primarySlotsMax","primarySlotsMin","secondarySlotsMax","secondarySlotsMin","magSlotsMax","magSlotsMin","attSlotsMax","attSlotsMin","itemSlotsMax","itemSlotsMin",
@ -31,6 +30,7 @@ if not isNull _crate then
"_maxPrim","_minPrim","_maxSec","_minSec","_maxMagSlots","_minMagSlots","_maxAttSlots","_minAttSlots","_maxItemSlots","_minItemSlots","_maxVestSlots","_minVestSlots",
"_maxHeadGearSlots","_minHeadGearSlots","_maxBagSlots","_minBagSlots","_primaries","_secondaries","_magazines","_attachments","_items","_vests","_backpacks","_headGear","_blackList"
];
_maxPrim = _settings select 0;
_minPrim = _settings select 1;
_maxSec = _settings select 2;
@ -56,7 +56,6 @@ if not isNull _crate then
_backpacks = _settings select 22;
_headGear = _settings select 23;
_blackList = _settings select 24;
// Add primary weapons
for "_j" from 0 to (_maxPrim - _minPrim + floor random _minPrim) do
{
@ -67,7 +66,6 @@ if not isNull _crate then
_crate addWeaponCargoGlobal [_prim select 0, _prim select 1];
};
};
// Secondary weapons
for "_j" from 0 to (_maxSec - _minSec + floor random _minSec) do
{
@ -78,7 +76,6 @@ if not isNull _crate then
_crate addWeaponCargoGlobal [_sec select 0, _sec select 1];
};
};
// Magazines
for "_j" from 0 to (_maxMagSlots - _minMagSlots + floor random _minMagSlots) do
{
@ -89,7 +86,6 @@ if not isNull _crate then
_crate addMagazineCargoGlobal [_mag select 0, _mag select 1];
};
};
// Weapon attachments
for "_j" from 0 to (_maxAttSlots - _minAttSlots + floor random _minAttSlots) do
{
@ -100,7 +96,6 @@ if not isNull _crate then
_crate addItemCargoGlobal [_att select 0, _att select 1];
};
};
// Items
for "_j" from 0 to (_maxItemSlots - _minItemSlots + floor random _minItemSlots) do
{
@ -111,7 +106,6 @@ if not isNull _crate then
_crate addItemCargoGlobal [_item select 0, _item select 1];
};
};
// Vests
for "_j" from 0 to (_maxVestSlots - _minVestSlots + floor random _minVestSlots) do
{
@ -122,7 +116,6 @@ if not isNull _crate then
_crate addItemCargoGlobal [_vest select 0, _vest select 1];
};
};
// Helmets / caps / berets / bandanas
for "_j" from 0 to (_maxHeadGearSlots - _minHeadGearSlots + floor random _minHeadGearSlots) do
{
@ -133,7 +126,6 @@ if not isNull _crate then
_crate addItemCargoGlobal [_headGearItem select 0, _headGearItem select 1];
};
};
// Backpacks
for "_j" from 0 to (_maxBagSlots - _minBagSlots + floor random _minBagSlots) do
{

View File

@ -11,7 +11,7 @@
_this select 3: STRING - exact config name of mission
Returns:
BOOL - true if all OK
ARRAY - array containing all mine objects
*/
private ["_ok","_mineSetting","_missionName"];
@ -49,7 +49,6 @@ if (_missionName in ("missionList" call VEMFr_fnc_getSetting)) then
["fn_placeMines", 0, "Invalid mines mode!"] ExecVM "exile_vemf_reloaded\sqf\log.sqf";
breakOut "main"
};
_mines = [];
["fn_placeMines", 1, format["Placing %1 mines at %2", _amount, _pos]] ExecVM "exile_vemf_reloaded\sqf\log.sqf";
for "_m" from 1 to _amount do

View File

@ -54,7 +54,6 @@ if (count _pos isEqualTo 3) then
_reloadSpd = _skills select 7;
_commanding = _skills select 8;
_general = _skills select 9;
_houses = nearestTerrainObjects [_pos, ["House"], _maxRange]; // Find some houses to spawn in
_notTheseHouses = "housesBlackList" call VEMFr_fnc_getSetting;
_goodHouses = [];
@ -73,7 +72,6 @@ if (count _pos isEqualTo 3) then
{
_noHouses = true;
};
_cal50s = [["DynamicLocationInvasion"],["cal50s"]] call VEMFr_fnc_getSetting param [0, 3, [0]];
if (_cal50s > 0) then
{
@ -96,22 +94,18 @@ if (count _pos isEqualTo 3) then
private ["_grp"];
_grp = createGroup _groupSide;
(_spawned select 0) pushBack _grp;
if not _noHouses then
{
_grp enableAttack false;
};
_grp setBehaviour "AWARE";
_grp setCombatMode "RED";
_grp allowFleeing 0;
private ["_house","_housePositions"];
if not _noHouses then
{
_grp enableAttack false;
_house = selectRandom _goodHouses;
_houseID = _goodHouses find _house;
_goodHouses deleteAt _houseID;
_housePositions = [_house] call BIS_fnc_buildingPositions;
};
private ["_placed50"];
_placed50 = false;
for "_u" from 1 to _unitsPerGrp do
@ -134,7 +128,6 @@ if (count _pos isEqualTo 3) then
};
};
};
private ["_unit"];
_unit = _grp createUnit [_sldrClass, _spawnPos, [], 0, "CAN_COLLIDE"]; // Create Unit There
if not _noHouses then
@ -152,12 +145,10 @@ if (count _pos isEqualTo 3) then
};
};
};
private ["_houseIndex"];
_houseIndex = _housePositions find _spawnPos;
_housePositions deleteAt _houseIndex;
};
_unit addMPEventHandler ["mpkilled","if (isDedicated) then { [_this select 0, _this select 1] ExecVM 'exile_vemf_reloaded\sqf\aiKilled.sqf' }"];
// Set skills
_unit setSkill ["aimingAccuracy", _accuracy];
@ -191,8 +182,7 @@ if (count _pos isEqualTo 3) then
if _noHouses then
{
private ["_waypoints"];
_waypoints =
[
_waypoints = [
[(_pos select 0), (_pos select 1)+50, 0],
[(_pos select 0)+50, (_pos select 1), 0],
[(_pos select 0), (_pos select 1)-50, 0],

View File

@ -60,7 +60,6 @@ if (_pos isEqualTypeArray [0,0,0]) then
_reloadSpd = _skills select 7;
_commanding = _skills select 8;
_general = _skills select 9;
_units = []; // Define units array. the for loops below will fill it with units
for "_g" from 1 to _grpCount do // Spawn Groups near Position
{
@ -79,7 +78,6 @@ if (_pos isEqualTypeArray [0,0,0]) then
_unit = _grp createUnit [_sldrClass, _pos, [], _spawnRadius, "FORM"]; // Create Unit There
_allUnits pushBack _unit;
_unit addMPEventHandler ["mpkilled","if (isDedicated) then { [_this select 0, _this select 1] ExecVM 'exile_vemf_reloaded\sqf\aiKilled.sqf' }"];
// Set skills
_unit setSkill ["aimingAccuracy", _accuracy];
_unit setSkill ["aimingShake", _aimShake];

View File

@ -28,7 +28,6 @@ if not isNull _toTransfer then
_hcEnabled = -1;
};
};
private ["_to"];
if (_hcEnabled isEqualTo 1) then
{ // Gather the Headless Client(s)
@ -42,9 +41,8 @@ if not isNull _toTransfer then
} forEach allPlayers;
if (count _hcClients > 0) then
{
_to = call VEMFr_fnc_headLessClient; // Select a random hc
};
if (count _hcClients isEqualTo 0) then
_to = call VEMFr_fnc_headlessClient; // Select a random hc
} else
{
uiNamespace setVariable ["VEMFr_forceAItoClients", true];
};
@ -70,6 +68,7 @@ if not isNull _toTransfer then
} forEach allPlayers;
};
};
};
if not isNil"_to" then
{
@ -81,13 +80,11 @@ if not isNull _toTransfer then
if (_index > -1) then
{
_load set [_index, ((_load select _index) select 1) + 1];
};
if (_index isEqualTo -1) then
} else
{
_load pushBack [_to, 1];
};
};
};
};
_transfer // Return the value of this var to the calling script

View File

@ -53,9 +53,8 @@ if (count _pos isEqualTo 3) then
};
} forEach _killed;
};
if not _complete then { uiSleep 1 };
if (((count _killed) isEqualTo _killToComplete) OR ((count _killed) > _killToComplete)) then { _complete = true };
if not _complete then { uiSleep 1 };
if not _complete then { uiSleep 2 };
};
["fn_waitForMissionDone", 1, format["mission in %1 completed!", _this select 0]] ExecVM "exile_vemf_reloaded\sqf\log.sqf";
};

View File

@ -32,7 +32,7 @@ if (count _pos isEqualTo 3) then
_playerNear = true;
} else
{
waitUntil { uiSleep 2; (([_pos, _rad] call VEMFr_fnc_checkPlayerPresence) OR (round time - _time > _timeOutTime)) };
waitUntil { if (([_pos, _rad] call VEMFr_fnc_checkPlayerPresence) OR (round time - _time > _timeOutTime)) then {true} else {uiSleep 2; false} };
if ([_pos, _rad] call VEMFr_fnc_checkPlayerPresence) then
{
_playerNear = true;