Last batch of converted functions as TODOs
Mostly all of them needs proper function headers. Also most likely a complete overhaul/refactor to simplify the functions.
This commit is contained in:
parent
e0d78e7a93
commit
49b4831c35
|
@ -3,22 +3,74 @@ class KPLIB
|
|||
class functions
|
||||
{
|
||||
file = "functions";
|
||||
class checkClass {};
|
||||
class cleanOpforVehicle {};
|
||||
class forceBluforCrew {};
|
||||
class getAdaptiveVehicle {};
|
||||
class getCommander {};
|
||||
class getFobName {};
|
||||
class getForceRatio {};
|
||||
class getGroupType {};
|
||||
class getLoadout {};
|
||||
class getLocationName {};
|
||||
class getMobileRespawns {};
|
||||
class getNearbyPlayers {};
|
||||
class getOpforFactor {};
|
||||
class getOpforSpawnPoint {};
|
||||
class getPlayerCount {};
|
||||
class getSquadComp {};
|
||||
class hasPermission {};
|
||||
class addObjectInit {};
|
||||
class allowCrewInImmobile {};
|
||||
class checkClass {};
|
||||
class checkCrateValue {};
|
||||
class checkGear {};
|
||||
class cleanOpforVehicle {};
|
||||
class crAddAceAction {};
|
||||
class crateFromStorage {};
|
||||
class crateToStorage {};
|
||||
class createClearance {};
|
||||
class createCrate {};
|
||||
class createManagedUnit {};
|
||||
class crGetMulti {};
|
||||
class crGlobalMsg {};
|
||||
class forceBluforCrew {};
|
||||
class getAdaptiveVehicle {};
|
||||
class getCommander {};
|
||||
class getFobName {};
|
||||
class getForceRatio {};
|
||||
class getGroupType {};
|
||||
class getLessLoadedHC {};
|
||||
class getLoadout {};
|
||||
class getLocalCap {};
|
||||
class getLocationName {};
|
||||
class getMilitaryId {};
|
||||
class getMobileRespawns {};
|
||||
class getNearbyPlayers {};
|
||||
class getNearestBluforObjective {};
|
||||
class getNearestFob {};
|
||||
class getNearestSector {};
|
||||
class getNearestTower {};
|
||||
class getNearestViVTransport {};
|
||||
class getOpforCap {};
|
||||
class getOpforFactor {};
|
||||
class getOpforSpawnPoint {};
|
||||
class getPlayerCount {};
|
||||
class getResistanceTier {};
|
||||
class getSaveableParam {};
|
||||
class getSectorOwnership {};
|
||||
class getSectorRange {};
|
||||
class getSquadComp {};
|
||||
class getUnitPositionId {};
|
||||
class getUnitsCount {};
|
||||
class getVirtualCargo {};
|
||||
class getWeaponComponents {};
|
||||
class hasPermission {};
|
||||
class isAdmin {};
|
||||
class isBigtownActive {};
|
||||
class isClassUAV {};
|
||||
class isRadio {};
|
||||
class potatoScan {};
|
||||
class protectObject {};
|
||||
class rearmVehicle {};
|
||||
class removeWeaponCargo {};
|
||||
class secondsToTimer {};
|
||||
class setFobMass {};
|
||||
class setFuel {};
|
||||
class setLoadableViV {};
|
||||
class setLoadout {};
|
||||
class setMass {};
|
||||
class sortStorage {};
|
||||
class spawnBuildingSquad {};
|
||||
class spawnCivilians {};
|
||||
class spawnGuerillaGroup {};
|
||||
class spawnMilitaryPostSquad {};
|
||||
class spawnMilitiaCrew {};
|
||||
class spawnRegularSquad {};
|
||||
class spawnVehicle {};
|
||||
class swapInventory {};
|
||||
};
|
||||
};
|
||||
|
|
|
@ -120,7 +120,7 @@ while { true } do {
|
|||
_marker setMarkerColorLocal _color;
|
||||
};
|
||||
|
||||
_marker setMarkerTextLocal format [ "%1", ( [ _nextai ] call F_getUnitPositionId )];
|
||||
_marker setMarkerTextLocal format [ "%1", ( [ _nextai ] call KPLIB_fnc_getUnitPositionId )];
|
||||
} foreach _marked_squadmates;
|
||||
|
||||
{
|
||||
|
@ -141,7 +141,7 @@ while { true } do {
|
|||
if (isPlayer _x) then {
|
||||
_vehiclename = _vehiclename + (name _x);
|
||||
} else {
|
||||
_vehiclename = _vehiclename + ( format [ "%1", [ _x ] call F_getUnitPositionId ] );
|
||||
_vehiclename = _vehiclename + ( format [ "%1", [ _x ] call KPLIB_fnc_getUnitPositionId ] );
|
||||
};
|
||||
|
||||
if( (_datcrew find _x) != ((count _datcrew) - 1) ) then {
|
||||
|
@ -187,4 +187,4 @@ while { true } do {
|
|||
_nextunit setVariable [ "spotmarker", "" ];
|
||||
};
|
||||
} forEach (allUnits + vehicles);
|
||||
};
|
||||
};
|
||||
|
|
|
@ -1,19 +1,18 @@
|
|||
/*
|
||||
F_addObjectInit
|
||||
File: fn_addObjectInit.sqf
|
||||
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
|
||||
Date: 2019-05-08
|
||||
Last Update: 2019-12-03
|
||||
License: MIT License - http://www.opensource.org/licenses/MIT
|
||||
|
||||
File: F_kp_addObjectInit.sqf
|
||||
Author: Wyqer - https://github.com/Wyqer
|
||||
Date: 2019-05-08
|
||||
Last Update: 2019-05-08
|
||||
Description:
|
||||
Applies code from kp_objectInits.sqf to given object. Returns true if some code was applied, false if object has no KPLIB init code.
|
||||
|
||||
Description:
|
||||
Applies code from kp_objectInits.sqf to given object. Returns true if some code was applied, false if object has no KPLIB init code.
|
||||
Parameter(s):
|
||||
_object - Object which should get init code applied, if there is any defined [OBJECT, defaults to objNull]
|
||||
|
||||
Parameter(s):
|
||||
0: OBJECT - Object which should get init code applied, if there is any defined. (Default objNull)
|
||||
|
||||
Returns:
|
||||
BOOL
|
||||
Returns:
|
||||
Function reached the end [BOOL]
|
||||
*/
|
||||
|
||||
params [["_object", objNull, [objNull]]];
|
|
@ -1,20 +1,20 @@
|
|||
/*
|
||||
F_allowKrewInImmobile
|
||||
|
||||
File: F_kp_allowCrewInImmobile.sqf
|
||||
Author: veteran29 - https://github.com/veteran29
|
||||
File: fn_allowCrewInImmobile.sqf
|
||||
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
|
||||
Date: 2019-09-05
|
||||
Last Update: 2019-09-05
|
||||
Last Update: 2019-12-03
|
||||
License: MIT License - http://www.opensource.org/licenses/MIT
|
||||
|
||||
Description:
|
||||
Allows crew in immobile vehicle depending on AllowEnemiesInImmobile parameters.
|
||||
|
||||
Parameter(s):
|
||||
0: OBJECT - Vehicle which should allow immobile crew. (Default objNull)
|
||||
_vehicle - Vehicle which should allow immobile crew [OBJECT, defaults to objNull]
|
||||
|
||||
Returns:
|
||||
BOOL
|
||||
Function reached the end [BOOL]
|
||||
*/
|
||||
|
||||
params [
|
||||
["_vehicle", objNull, [objNull]]
|
||||
];
|
|
@ -0,0 +1,26 @@
|
|||
/*
|
||||
File: fn_checkCrateValue.sqf
|
||||
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
|
||||
Date: 2017-05-26
|
||||
Last Update: 2019-12-03
|
||||
License: MIT License - http://www.opensource.org/licenses/MIT
|
||||
|
||||
Description:
|
||||
Checks content of given crate, checks if ropeAttach is enabled on the crate and if not set it to true.
|
||||
|
||||
Parameter(s):
|
||||
_crate - Crate to check [OBJECT, defaults to objNull]
|
||||
|
||||
Returns:
|
||||
Function reached the end [BOOL]
|
||||
*/
|
||||
// TODO
|
||||
if (isDedicated) exitWith {};
|
||||
|
||||
hint format [localize "STR_ACTION_CRATE_VALUE_HINT", (_this select 0) getVariable ["KP_liberation_crate_value",0]];
|
||||
|
||||
if (!(ropeAttachEnabled (_this select 0))) then {
|
||||
[(_this select 0), true] remoteExec ["enableRopeAttach"];
|
||||
};
|
||||
|
||||
true
|
|
@ -1,21 +1,21 @@
|
|||
/*
|
||||
F_checkGear
|
||||
|
||||
File: F_kp_checkGear.sqf
|
||||
Author: Wyqer - https://github.com/Wyqer
|
||||
File: fn_checkGear.sqf
|
||||
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
|
||||
Date: 2017-11-22
|
||||
Last Update: 2019-07-23
|
||||
Last Update: 2019-12-03
|
||||
License: MIT License - http://www.opensource.org/licenses/MIT
|
||||
|
||||
Description:
|
||||
Checks the players gear for blacklisted items and report these items. Also returns if the player check was fine (true) or if he had bad items (false).
|
||||
Checks the players gear for blacklisted items and report these items.
|
||||
Also returns if the player check was fine (true) or if he had bad items (false).
|
||||
|
||||
Parameter(s):
|
||||
0: STRING - Backpack classname of the players backpack as he entered the arsenal / load a loadout. (Default "")
|
||||
_backpack - Backpack classname of the players backpack as he entered the arsenal / load a loadout [STRING, defaults to ""]
|
||||
|
||||
Returns:
|
||||
BOOL
|
||||
Player checked without findings [BOOL]
|
||||
*/
|
||||
|
||||
// TODO
|
||||
params [["_backpack", ""]];
|
||||
|
||||
private _return = true;
|
||||
|
@ -51,7 +51,7 @@ _playerItems = _playerItems apply {toLower _x};
|
|||
_removedItems pushBack _x;
|
||||
player unassignItem _x;
|
||||
player removeItems _x;
|
||||
} forEach (((_playerItems arrayIntersect _playerItems) - KP_liberation_allowed_items) select {!([_x] call F_isRadio)});
|
||||
} forEach (((_playerItems arrayIntersect _playerItems) - KP_liberation_allowed_items) select {!([_x] call KPLIB_fnc_isRadio)});
|
||||
|
||||
private _playerMagazines = ((getMagazineCargo (uniformContainer player)) select 0);
|
||||
_playerMagazines append ((getMagazineCargo (vestContainer player)) select 0);
|
||||
|
@ -62,9 +62,9 @@ _playerMagazines = _playerMagazines apply {toLower _x};
|
|||
player removeMagazines _x;
|
||||
} forEach ((_playerMagazines arrayIntersect _playerMagazines) - KP_liberation_allowed_items);
|
||||
|
||||
_removedItems append ([uniformContainer player] call F_removeWeaponCargo);
|
||||
_removedItems append ([vestContainer player] call F_removeWeaponCargo);
|
||||
_removedItems append ([backpackContainer player] call F_removeWeaponCargo);
|
||||
_removedItems append ([uniformContainer player] call KPLIB_fnc_removeWeaponCargo);
|
||||
_removedItems append ([vestContainer player] call KPLIB_fnc_removeWeaponCargo);
|
||||
_removedItems append ([backpackContainer player] call KPLIB_fnc_removeWeaponCargo);
|
||||
|
||||
private _weapons = weapons player;
|
||||
_weapons = _weapons apply {toLower _x};
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
File: fn_crAddAceAction.sqf
|
||||
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
|
||||
Date: 2019-12-03
|
||||
Last Update: 2019-12-03
|
||||
License: MIT License - http://www.opensource.org/licenses/MIT
|
||||
|
||||
Description:
|
||||
No description added yet.
|
||||
|
||||
Parameter(s):
|
||||
_localVariable - Description [DATATYPE, defaults to DEFAULTVALUE]
|
||||
|
||||
Returns:
|
||||
Function reached the end [BOOL]
|
||||
*/
|
||||
// TODO
|
||||
params ["_civ"];
|
||||
|
||||
if (KP_liberation_civrep_debug > 0) then {private _text = format ["[KP LIBERATION] [CIVREP] ace_action called on: %1", debug_source];_text remoteExec ["diag_log",2];};
|
|
@ -0,0 +1,21 @@
|
|||
/*
|
||||
File: fn_crGetMulti.sqf
|
||||
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
|
||||
Date: 2017-10-08
|
||||
Last Update: 2019-12-03
|
||||
License: MIT License - http://www.opensource.org/licenses/MIT
|
||||
|
||||
Description:
|
||||
Returns the current level of the civil reputation. (positive or negative)
|
||||
|
||||
Parameter(s):
|
||||
NONE
|
||||
|
||||
Returns:
|
||||
Reputation level [NUMBER]
|
||||
*/
|
||||
// TODO
|
||||
private _reputation = if (KP_liberation_civ_rep < 0) then {KP_liberation_civ_rep * -1} else {KP_liberation_civ_rep};
|
||||
private _return = floor (_reputation / 25);
|
||||
if (_return == 4) then {_return = 3;};
|
||||
_return
|
|
@ -0,0 +1,30 @@
|
|||
/*
|
||||
File: fn_crGlobalMsg.sqf
|
||||
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
|
||||
Date: 2019-12-03
|
||||
Last Update: 2019-12-03
|
||||
License: MIT License - http://www.opensource.org/licenses/MIT
|
||||
|
||||
Description:
|
||||
No description added yet.
|
||||
|
||||
Parameter(s):
|
||||
_localVariable - Description [DATATYPE, defaults to DEFAULTVALUE]
|
||||
|
||||
Returns:
|
||||
Function reached the end [BOOL]
|
||||
*/
|
||||
// TODO
|
||||
params ["_msgType",["_data",[]]];
|
||||
|
||||
if (KP_liberation_civrep_debug > 0) then {private _text = format ["[KP LIBERATION] [CIVREP] globalMsg called on: %1 - Parameters: [%2, %3]", debug_source, _msgType, _data];_text remoteExec ["diag_log",2];};
|
||||
|
||||
switch (_msgType) do {
|
||||
case 0: {systemChat localize "STR_CR_VEHICLEMSG";};
|
||||
case 1: {systemChat (format [localize "STR_CR_BUILDINGMSG", (_data select 0)]);};
|
||||
case 2: {systemChat (format [localize "STR_CR_KILLMSG", (_data select 0)]);};
|
||||
case 3: {systemChat (format [localize "STR_CR_RESISTANCE_KILLMSG", (_data select 0)]);};
|
||||
case 4: {systemChat (format [localize "STR_CR_HEALMSG", (_data select 0)]);};
|
||||
case 5: {["lib_asymm_guerilla_incoming", _data] call BIS_fnc_showNotification;};
|
||||
default {private _text = format ["[KP LIBERATION] [ERROR] [CIVREP] globalMsg without valid msgType"];_text remoteExec ["diag_log",2];};
|
||||
};
|
|
@ -0,0 +1,81 @@
|
|||
/*
|
||||
File: fn_crateFromStorage.sqf
|
||||
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
|
||||
Date: 2017-03-27
|
||||
Last Update: 2019-12-03
|
||||
License: MIT License - http://www.opensource.org/licenses/MIT
|
||||
|
||||
Description:
|
||||
Unloads given crate type from storage area.
|
||||
|
||||
Parameter(s):
|
||||
_cratetype - Crate type [STRING, defaults to ""]
|
||||
_storage - Storage [OBJECT, defaults to objNull]
|
||||
_update - Update sector resources [BOOL, defaults to false]
|
||||
|
||||
Returns:
|
||||
Function reached the end [BOOL]
|
||||
*/
|
||||
// TODO
|
||||
params ["_cratetype", "_storage", ["_update",false]];
|
||||
|
||||
private ["_storage_positions","_unload_distance","_unload_pos","_i","_unloaded","_stored_crates","_height"];
|
||||
|
||||
switch (typeOf _storage) do {
|
||||
case KP_liberation_small_storage_building: {_storage_positions = KP_liberation_small_storage_positions; _unload_distance = 4;};
|
||||
case KP_liberation_large_storage_building: {_storage_positions = KP_liberation_large_storage_positions; _unload_distance = 6.5;};
|
||||
default {_storage_positions = KP_liberation_large_storage_positions; _unload_distance = 6.5;};
|
||||
};
|
||||
|
||||
_i = 0;
|
||||
_unload_pos = _storage getPos [_unload_distance, (getDir _storage) - 180];
|
||||
|
||||
while {!((nearestObjects [_unload_pos,KP_liberation_crates,1]) isEqualTo [])} do {
|
||||
_i = _i + 1;
|
||||
_unload_pos = _storage getPos [_unload_distance + _i * 1.8, (getDir _storage) - 180];
|
||||
};
|
||||
|
||||
sleep 0.5;
|
||||
|
||||
_unloaded = false;
|
||||
_stored_crates = attachedObjects _storage;
|
||||
reverse _stored_crates;
|
||||
|
||||
{
|
||||
if (typeOf _x == _cratetype) then {
|
||||
detach _x;
|
||||
|
||||
clearWeaponCargoGlobal _x;
|
||||
clearMagazineCargoGlobal _x;
|
||||
clearBackpackCargoGlobal _x;
|
||||
clearItemCargoGlobal _x;
|
||||
|
||||
_x setPos _unload_pos;
|
||||
[_x, true] remoteExec ["enableRopeAttach"];
|
||||
if(KP_liberation_ace) then {[_x, true, [0, 1.5, 0], 0] remoteExec ["ace_dragging_fnc_setCarryable"];};
|
||||
_unloaded = true;
|
||||
};
|
||||
if (_unloaded) exitWith {
|
||||
_i = 0;
|
||||
{
|
||||
_height = 0.6;
|
||||
switch (typeOf _x) do {
|
||||
case KP_liberation_supply_crate: {_height = 0.4;};
|
||||
case KP_liberation_ammo_crate: {_height = 0.6;};
|
||||
case KP_liberation_fuel_crate: {_height = 0.3;};
|
||||
default {_height = 0.6;};
|
||||
};
|
||||
detach _x;
|
||||
_x attachTo [_storage, [(_storage_positions select _i) select 0, (_storage_positions select _i) select 1, _height]];
|
||||
_i = _i + 1;
|
||||
} forEach attachedObjects _storage;
|
||||
};
|
||||
} forEach _stored_crates;
|
||||
|
||||
if (_update) then {
|
||||
if ((_storage getVariable ["KP_liberation_storage_type",-1]) == 1) then {
|
||||
remoteExec ["check_sector_ress_remote_call",2];
|
||||
};
|
||||
};
|
||||
|
||||
true
|
|
@ -0,0 +1,63 @@
|
|||
/*
|
||||
File: fn_crateToStorage.sqf
|
||||
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
|
||||
Date: 2017-03-27
|
||||
Last Update: 2019-12-03
|
||||
License: MIT License - http://www.opensource.org/licenses/MIT
|
||||
|
||||
Description:
|
||||
Attach given crate at storage area.
|
||||
|
||||
Parameter(s):
|
||||
_crate - Crate [OBJECT, defaults to objNull]
|
||||
_storage - Storage [OBJECT, defaults to objNull]
|
||||
_update - Update sector resources [BOOL, defaults to false]
|
||||
|
||||
Returns:
|
||||
Function reached the end [BOOL]
|
||||
*/
|
||||
// TODO
|
||||
params ["_crate", ["_storage",nil], ["_update",false]];
|
||||
|
||||
if (!isNil "_storage") then {
|
||||
private _storage_positions = KP_liberation_large_storage_positions;
|
||||
switch (typeOf _storage) do {
|
||||
case KP_liberation_small_storage_building: {_storage_positions = KP_liberation_small_storage_positions;};
|
||||
case KP_liberation_large_storage_building: {_storage_positions = KP_liberation_large_storage_positions;};
|
||||
default {_storage_positions = KP_liberation_large_storage_positions;};
|
||||
};
|
||||
|
||||
private _height = 0.6;
|
||||
switch (typeOf _crate) do {
|
||||
case KP_liberation_supply_crate: {_height = 0.4;};
|
||||
case KP_liberation_ammo_crate: {_height = 0.6;};
|
||||
case KP_liberation_fuel_crate: {_height = 0.3;};
|
||||
default {_height = 0.6;};
|
||||
};
|
||||
|
||||
clearWeaponCargoGlobal _crate;
|
||||
clearMagazineCargoGlobal _crate;
|
||||
clearBackpackCargoGlobal _crate;
|
||||
clearItemCargoGlobal _crate;
|
||||
|
||||
private _crates_count = count (attachedObjects _storage);
|
||||
|
||||
if (_crates_count >= (count _storage_positions)) exitWith {if (!isDedicated) then {hint localize "STR_BOX_CANTSTORE";};};
|
||||
|
||||
_crate attachTo [_storage, [(_storage_positions select _crates_count) select 0, (_storage_positions select _crates_count) select 1, _height]];
|
||||
[_crate, false] remoteExec ["enableRopeAttach"];
|
||||
if(KP_liberation_ace) then {[_crate, false, [0, 1.5, 0], 0] remoteExec ["ace_dragging_fnc_setCarryable"];};
|
||||
|
||||
if (_update) then {
|
||||
if ((_storage getVariable ["KP_liberation_storage_type",-1]) == 1) then {
|
||||
remoteExec ["check_sector_ress_remote_call",2];
|
||||
};
|
||||
};
|
||||
|
||||
} else {
|
||||
if (!isDedicated) then {
|
||||
hint localize "STR_BOX_CANTSTORE";
|
||||
};
|
||||
};
|
||||
|
||||
true
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
File: fn_createClearance.sqf
|
||||
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
|
||||
Date: 2019-12-03
|
||||
Last Update: 2019-12-03
|
||||
License: MIT License - http://www.opensource.org/licenses/MIT
|
||||
|
||||
Description:
|
||||
No description added yet.
|
||||
|
||||
Parameter(s):
|
||||
_localVariable - Description [DATATYPE, defaults to DEFAULTVALUE]
|
||||
|
||||
Returns:
|
||||
Function reached the end [BOOL]
|
||||
*/
|
||||
// TODO
|
||||
if (!isServer) exitWith {false};
|
||||
|
||||
params [
|
|
@ -1,21 +1,22 @@
|
|||
/*
|
||||
F_createCrate.sqf
|
||||
Author: Wyqer
|
||||
Website: www.killahpotatoes.de
|
||||
Date: 2017-10-11
|
||||
File: fn_createCrate.sqf
|
||||
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
|
||||
Date: 2017-10-11
|
||||
Last Update: 2019-12-03
|
||||
License: MIT License - http://www.opensource.org/licenses/MIT
|
||||
|
||||
Description:
|
||||
Spawns a resource crate of given type and with given amount at given position.
|
||||
Description:
|
||||
Spawns a resource crate of given type and with given amount at given position.
|
||||
|
||||
Parameters:
|
||||
_this select 0 - STRING - type of resource
|
||||
_this select 1 - INTEGER - resource amount
|
||||
_this select 2 - POSITION - Position where to spawn the crate
|
||||
Parameter(s):
|
||||
_resource - Type of resource [STRING, defaults to ""]
|
||||
_amount - Resource amount [NUMBER, defaults to 100]
|
||||
_pos - Position where to spawn the crate [POSITION, defaults to getPos player]
|
||||
|
||||
Return:
|
||||
Object - resource crate
|
||||
Returns:
|
||||
Created crate [OBJECT]
|
||||
*/
|
||||
|
||||
// TODO
|
||||
params [["_resource", KP_liberation_supply_crate],["_amount", 100],["_pos", getPos player]];
|
||||
|
||||
if !(_resource in KP_liberation_crates) exitWith {
|
||||
|
@ -34,6 +35,6 @@ clearItemCargoGlobal _crate;
|
|||
if(KP_liberation_ace) then {[_crate, true, [0, 1.5, 0], 0] remoteExec ["ace_dragging_fnc_setCarryable"];};
|
||||
|
||||
// Process KP object init
|
||||
[_crate] call F_addObjectInit;
|
||||
[_crate] call KPLIB_fnc_addObjectInit;
|
||||
|
||||
_crate
|
|
@ -1,27 +1,24 @@
|
|||
/*
|
||||
F_createManagedUnit
|
||||
|
||||
File: F_kp_createManagedUnit.sqf
|
||||
Author: veteran29 - https://github.com/veteran29
|
||||
File: fn_createManagedUnit.sqf
|
||||
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
|
||||
Date: 2019-10-04
|
||||
Last Update: 2019-10-04
|
||||
Last Update: 2019-12-03
|
||||
License: MIT License - http://www.opensource.org/licenses/MIT
|
||||
|
||||
Description:
|
||||
Creates unit managed by kill tracker.
|
||||
|
||||
Parameter(s):
|
||||
0: STRING - Type of unit. (Default "")
|
||||
1: ARRAY|OBJECT|GROUP - Where to spawn. (Default [0,0,0])
|
||||
2: GROUP - Group to add the unit to. (Default objNull)
|
||||
3: STRING - Unit rank. (Default "PRIVATE")
|
||||
4: NUMBER - Placement radius. (Default 0)
|
||||
|
||||
Example:
|
||||
|
||||
_type - Type of unit [STRING, defaults to ""]
|
||||
_spawnPos - Where to spawn [ARRAY|OBJECT|GROUP, defaults to [0, 0, 0]]
|
||||
_group - Group to add the unit to [GROUP, defaults to grpNull]
|
||||
_rank - Unit rank [STRING, defaults to "PRIVATE"]
|
||||
_placement - Placement radius [NUMBER, defaults to 0]
|
||||
|
||||
Returns:
|
||||
OBJECT - Created unit
|
||||
Created unit [OBJECT]
|
||||
*/
|
||||
// TODO
|
||||
params [
|
||||
["_type", "", [""]],
|
||||
["_spawnPos", [0,0,0], [[], objNull, grpNull], [2,3]],
|
||||
|
@ -30,7 +27,7 @@ params [
|
|||
["_placement", 0, [0]]
|
||||
];
|
||||
|
||||
private "_unit";
|
||||
private ["_unit"];
|
||||
isNil {
|
||||
// Create temp group, as we need to let the unit join the "correct side group".
|
||||
// If we use the "correct side group" for the createUnit, the group would switch to the side of the unit written in the config.
|
||||
|
@ -45,7 +42,7 @@ isNil {
|
|||
deleteGroup _groupTemp;
|
||||
|
||||
// Process KP object init
|
||||
[_unit] call F_addObjectInit;
|
||||
[_unit] call KPLIB_fnc_addObjectInit;
|
||||
};
|
||||
|
||||
_unit // return
|
||||
_unit
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
File: fn_fillStorage.sqf
|
||||
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
|
||||
Date: 2019-12-03
|
||||
Last Update: 2019-12-03
|
||||
License: MIT License - http://www.opensource.org/licenses/MIT
|
||||
|
||||
Description:
|
||||
No description added yet.
|
||||
|
||||
Parameter(s):
|
||||
_localVariable - Description [DATATYPE, defaults to DEFAULTVALUE]
|
||||
|
||||
Returns:
|
||||
Function reached the end [BOOL]
|
||||
*/
|
||||
// TODO
|
||||
params [
|
||||
["_supply", 0, [0]],
|
||||
["_ammo", 0, [0]],
|
||||
|
@ -22,9 +39,9 @@ private _pos = getPos _storage;
|
|||
_amount = _x;
|
||||
};
|
||||
_x = _x - _amount;
|
||||
_crate = [_crateType, _amount, _pos] call F_createCrate;
|
||||
_crate = [_crateType, _amount, _pos] call KPLIB_fnc_createCrate;
|
||||
if (_delay) then {sleep 0.1;};
|
||||
[_crate, _storage] call F_crateToStorage;
|
||||
[_crate, _storage] call KPLIB_fnc_crateToStorage;
|
||||
};
|
||||
} forEach [_supply, _ammo, _fuel];
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
File: fn_forceBluforCrew.sqf
|
||||
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
|
||||
Date: 2019-11-25
|
||||
Last Update: 2019-11-25
|
||||
Last Update: 2019-12-03
|
||||
License: MIT License - http://www.opensource.org/licenses/MIT
|
||||
|
||||
Description:
|
||||
|
@ -29,7 +29,7 @@ if ((side _grp) != GRLIB_side_friendly) then {
|
|||
|
||||
_grp = createGroup [GRLIB_side_friendly, true];
|
||||
while {count units _grp < 3} do {
|
||||
[crewman_classname, getPos _veh, _grp] call F_createManagedUnit;
|
||||
[crewman_classname, getPos _veh, _grp] call KPLIB_fnc_createManagedUnit;
|
||||
};
|
||||
((units _grp) select 0) moveInDriver _veh;
|
||||
((units _grp) select 1) moveInGunner _veh;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
File: fn_getForceRatio.sqf
|
||||
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
|
||||
Date: 2019-11-25
|
||||
Last Update: 2019-11-25
|
||||
Last Update: 2019-12-03
|
||||
License: MIT License - http://www.opensource.org/licenses/MIT
|
||||
|
||||
Description:
|
||||
|
@ -23,8 +23,8 @@ if ( _sector in sectors_bigtown ) then {
|
|||
_actual_capture_size = GRLIB_capture_size * 1.4;
|
||||
};
|
||||
|
||||
_red_forces = [ (markerpos _sector), _actual_capture_size, GRLIB_side_enemy ] call F_getUnitsCount;
|
||||
_blue_forces = [ (markerpos _sector), _actual_capture_size, GRLIB_side_friendly ] call F_getUnitsCount;
|
||||
_red_forces = [ (markerpos _sector), _actual_capture_size, GRLIB_side_enemy ] call KPLIB_fnc_getUnitsCount;
|
||||
_blue_forces = [ (markerpos _sector), _actual_capture_size, GRLIB_side_friendly ] call KPLIB_fnc_getUnitsCount;
|
||||
_ratio = -1;
|
||||
|
||||
if (_red_forces > 0) then {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
File: fn_getGroupType.sqf
|
||||
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
|
||||
Date: 2019-11-25
|
||||
Last Update: 2019-11-25
|
||||
Last Update: 2019-12-03
|
||||
License: MIT License - http://www.opensource.org/licenses/MIT
|
||||
|
||||
Description:
|
||||
|
@ -70,7 +70,7 @@ if ((_grouptype == 'infantry') && (_vehicletype != '')) then {
|
|||
};
|
||||
|
||||
// Check if vehicle config says it's an UAV, if it is always set its _grouptype to 'uav'
|
||||
if ( (_vehicletype call F_isClassUAV) ) then {
|
||||
if ( (_vehicletype call KPLIB_fnc_isClassUAV) ) then {
|
||||
_grouptype = 'uav';
|
||||
};
|
||||
|
||||
|
|
|
@ -0,0 +1,61 @@
|
|||
/*
|
||||
File: fn_getLessLoadedHC.sqf
|
||||
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
|
||||
Date: 2019-12-03
|
||||
Last Update: 2019-12-03
|
||||
License: MIT License - http://www.opensource.org/licenses/MIT
|
||||
|
||||
Description:
|
||||
No description added yet.
|
||||
|
||||
Parameter(s):
|
||||
_localVariable - Description [DATATYPE, defaults to DEFAULTVALUE]
|
||||
|
||||
Returns:
|
||||
Function reached the end [BOOL]
|
||||
*/
|
||||
// TODO
|
||||
private _less_loaded_HC = objNull;
|
||||
private _previous_min_load = 99999;
|
||||
|
||||
if (isMultiplayer) then {
|
||||
if (!isNil "group_owners" && !(isNil "HC1" && isNil "HC2" && isNil "HC3")) then {
|
||||
{
|
||||
if (!isNil "HC1") then {
|
||||
if (!isNull HC1) then {
|
||||
if (_x select 0 == HC1) then {
|
||||
if ((_x select 4) + (_x select 5) < _previous_min_load) then {
|
||||
_previous_min_load = (_x select 4) + (_x select 5);
|
||||
_less_loaded_HC = HC1;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
if (!isNil "HC2") then {
|
||||
if (!isNull HC2) then {
|
||||
if (_x select 0 == HC2) then {
|
||||
if ((_x select 4) + (_x select 5) < _previous_min_load) then {
|
||||
_previous_min_load = (_x select 4) + (_x select 5);
|
||||
_less_loaded_HC = HC2;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
if (!isNil "HC3") then {
|
||||
if (!isNull HC3) then {
|
||||
if (_x select 0 == HC3) then {
|
||||
if ((_x select 4) + (_x select 5) < _previous_min_load) then {
|
||||
_previous_min_load = (_x select 4) + (_x select 5);
|
||||
_less_loaded_HC = HC3;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
} foreach group_owners;
|
||||
};
|
||||
};
|
||||
|
||||
_less_loaded_HC
|
|
@ -0,0 +1,25 @@
|
|||
/*
|
||||
File: fn_getLocalCap.sqf
|
||||
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
|
||||
Date: 2019-12-03
|
||||
Last Update: 2019-12-03
|
||||
License: MIT License - http://www.opensource.org/licenses/MIT
|
||||
|
||||
Description:
|
||||
No description added yet.
|
||||
|
||||
Parameter(s):
|
||||
_localVariable - Description [DATATYPE, defaults to DEFAULTVALUE]
|
||||
|
||||
Returns:
|
||||
Function reached the end [BOOL]
|
||||
*/
|
||||
// TODO
|
||||
private [ "_unitcap_local" ];
|
||||
|
||||
_unitcap_local = (round (infantry_cap / 2));
|
||||
if ( _unitcap_local > GRLIB_blufor_cap ) then {
|
||||
_unitcap_local = GRLIB_blufor_cap;
|
||||
};
|
||||
|
||||
_unitcap_local
|
|
@ -2,7 +2,7 @@
|
|||
File: fn_getLocationName.sqf
|
||||
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
|
||||
Date: 2019-11-25
|
||||
Last Update: 2019-11-25
|
||||
Last Update: 2019-12-03
|
||||
License: MIT License - http://www.opensource.org/licenses/MIT
|
||||
|
||||
Description:
|
||||
|
@ -20,9 +20,9 @@ private [ "_attacked_string" ];
|
|||
|
||||
_attacked_string = [_attacked_position] call KPLIB_fnc_getFobName;
|
||||
if ( _attacked_string == "" ) then {
|
||||
_attacked_string = markerText ( [50, _attacked_position ] call F_getNearestSector );
|
||||
_attacked_string = markerText ( [50, _attacked_position ] call KPLIB_fnc_getNearestSector );
|
||||
} else {
|
||||
_attacked_string = format [ "FOB %1", _attacked_string ];
|
||||
_attacked_string = format [ "FOB %1", _attacked_string ];
|
||||
};
|
||||
|
||||
_attacked_string
|
||||
|
|
|
@ -0,0 +1,32 @@
|
|||
/*
|
||||
File: fn_getMilitaryId.sqf
|
||||
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
|
||||
Date: 2017-09-14
|
||||
Last Update: 2019-12-03
|
||||
License: MIT License - http://www.opensource.org/licenses/MIT
|
||||
|
||||
Description:
|
||||
Converts a number to an ID string.
|
||||
|
||||
Parameter(s):
|
||||
_count - ID number to convert [NUMBER, defaults to 0]
|
||||
|
||||
Returns:
|
||||
Military ID [STRING]
|
||||
*/
|
||||
// TODO
|
||||
params ["_count"];
|
||||
private _level = 0;
|
||||
private _return = "";
|
||||
|
||||
for [{_i = (count military_alphabet)}, {(_count + 1) > _i}, {_i = _i + (count military_alphabet)}] do {
|
||||
_level = _level + 1;
|
||||
};
|
||||
|
||||
if (_level == 0) then {
|
||||
_return = military_alphabet select _count;
|
||||
} else {
|
||||
_return = format ["%1 %2", [(_level - 1)] call KPLIB_fnc_getMilitaryId, [(_count - (_level * (count military_alphabet)))] call KPLIB_fnc_getMilitaryId];
|
||||
};
|
||||
|
||||
_return
|
|
@ -0,0 +1,51 @@
|
|||
/*
|
||||
File: fn_getNearestBluforObjective.sqf
|
||||
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
|
||||
Date: 2019-12-03
|
||||
Last Update: 2019-12-03
|
||||
License: MIT License - http://www.opensource.org/licenses/MIT
|
||||
|
||||
Description:
|
||||
No description added yet.
|
||||
|
||||
Parameter(s):
|
||||
_localVariable - Description [DATATYPE, defaults to DEFAULTVALUE]
|
||||
|
||||
Returns:
|
||||
Function reached the end [BOOL]
|
||||
*/
|
||||
// TODO
|
||||
params ["_startpos"];
|
||||
|
||||
private _currentnearest = [];
|
||||
private _refdistance = 99999;
|
||||
private _tpositions = [];
|
||||
|
||||
if (count GRLIB_all_fobs != 0 || count blufor_sectors != 0) then {
|
||||
|
||||
{_tpositions pushback _x;} foreach GRLIB_all_fobs;
|
||||
|
||||
{
|
||||
if (_startpos distance _x < _refdistance) then {
|
||||
_refdistance = (_startpos distance _x);
|
||||
_currentnearest = [_x,_refdistance];
|
||||
};
|
||||
} forEach _tpositions;
|
||||
|
||||
if (_refdistance > 4000) then {
|
||||
{
|
||||
_tpositions pushback (markerpos _x);
|
||||
} forEach blufor_sectors;
|
||||
|
||||
{
|
||||
if (_startpos distance _x < _refdistance) then {
|
||||
_refdistance = (_startpos distance _x);
|
||||
_currentnearest = [_x,_refdistance];
|
||||
};
|
||||
} forEach _tpositions;
|
||||
};
|
||||
} else {
|
||||
_currentnearest = _startpos;
|
||||
};
|
||||
|
||||
_currentnearest
|
|
@ -0,0 +1,26 @@
|
|||
/*
|
||||
File: fn_getNearestFob.sqf
|
||||
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
|
||||
Date: 2019-12-03
|
||||
Last Update: 2019-12-03
|
||||
License: MIT License - http://www.opensource.org/licenses/MIT
|
||||
|
||||
Description:
|
||||
No description added yet.
|
||||
|
||||
Parameter(s):
|
||||
_localVariable - Description [DATATYPE, defaults to DEFAULTVALUE]
|
||||
|
||||
Returns:
|
||||
Function reached the end [BOOL]
|
||||
*/
|
||||
// TODO
|
||||
params [["_source_position", (getpos player)]];
|
||||
|
||||
private _retvalue = [];
|
||||
|
||||
if (count GRLIB_all_fobs > 0) then {
|
||||
_retvalue = ([ GRLIB_all_fobs, [], {_source_position distance _x}, 'ASCEND'] call BIS_fnc_sortBy) select 0;
|
||||
};
|
||||
|
||||
_retvalue
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
File: fn_getNearestSector.sqf
|
||||
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
|
||||
Date: 2019-12-03
|
||||
Last Update: 2019-12-03
|
||||
License: MIT License - http://www.opensource.org/licenses/MIT
|
||||
|
||||
Description:
|
||||
No description added yet.
|
||||
|
||||
Parameter(s):
|
||||
_localVariable - Description [DATATYPE, defaults to DEFAULTVALUE]
|
||||
|
||||
Returns:
|
||||
Function reached the end [BOOL]
|
||||
*/
|
||||
// TODO
|
||||
params ["_limit", ["_postosearch", getpos player]];
|
||||
|
||||
private _sector_to_return = "";
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
File: fn_getNearestTower.sqf
|
||||
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
|
||||
Date: 2019-12-03
|
||||
Last Update: 2019-12-03
|
||||
License: MIT License - http://www.opensource.org/licenses/MIT
|
||||
|
||||
Description:
|
||||
No description added yet.
|
||||
|
||||
Parameter(s):
|
||||
_localVariable - Description [DATATYPE, defaults to DEFAULTVALUE]
|
||||
|
||||
Returns:
|
||||
Function reached the end [BOOL]
|
||||
*/
|
||||
// TODO
|
||||
params [ "_postosearch", "_side", "_limit" ];
|
||||
private [ "_sector_to_return", "_sectors_to_search", "_sectors_to_search_sorted"];
|
||||
|
||||
|
@ -5,9 +22,9 @@ _sector_to_return = '';
|
|||
_sectors_to_search = [];
|
||||
waitUntil {!isNil "blufor_sectors"};
|
||||
if ( _side == GRLIB_side_enemy ) then {
|
||||
_sectors_to_search = (sectors_tower - blufor_sectors);
|
||||
_sectors_to_search = (sectors_tower - blufor_sectors);
|
||||
} else {
|
||||
_sectors_to_search = blufor_sectors select {_x in sectors_tower};
|
||||
_sectors_to_search = blufor_sectors select {_x in sectors_tower};
|
||||
};
|
||||
|
||||
_sectors_to_search = _sectors_to_search select {(markerPos _x) distance _postosearch < _limit};
|
|
@ -0,0 +1,23 @@
|
|||
/*
|
||||
File: fn_getNearestViVTransport.sqf
|
||||
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
|
||||
Date: 2019-05-08
|
||||
Last Update: 2019-12-03
|
||||
License: MIT License - http://www.opensource.org/licenses/MIT
|
||||
|
||||
Description:
|
||||
Gets nearest object that can transport target object via ViV.
|
||||
|
||||
Parameter(s):
|
||||
_object - Object to check [OBJECT, defaults to objNull]
|
||||
|
||||
Returns:
|
||||
Closest transport or objNull [OBJECT]
|
||||
*/
|
||||
// TODO
|
||||
params [["_object", objNull, [objNull]]];
|
||||
|
||||
private _nearbyTransports = ((nearestObjects [_object, ["AllVehicles"], 15]) select {(_x canVehicleCargo _object) select 0});
|
||||
|
||||
// return closest transport
|
||||
_nearbyTransports param [0, objNull]
|
|
@ -0,0 +1,18 @@
|
|||
/*
|
||||
File: fn_getOpforCap.sqf
|
||||
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
|
||||
Date: 2019-12-03
|
||||
Last Update: 2019-12-03
|
||||
License: MIT License - http://www.opensource.org/licenses/MIT
|
||||
|
||||
Description:
|
||||
No description added yet.
|
||||
|
||||
Parameter(s):
|
||||
_localVariable - Description [DATATYPE, defaults to DEFAULTVALUE]
|
||||
|
||||
Returns:
|
||||
Function reached the end [BOOL]
|
||||
*/
|
||||
// TODO
|
||||
GRLIB_side_enemy countSide allUnits
|
|
@ -2,7 +2,7 @@
|
|||
File: fn_getOpforSpawnPoint.sqf
|
||||
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
|
||||
Date: 2019-11-25
|
||||
Last Update: 2019-11-25
|
||||
Last Update: 2019-12-03
|
||||
License: MIT License - http://www.opensource.org/licenses/MIT
|
||||
|
||||
Description:
|
||||
|
@ -79,7 +79,7 @@ private ["_valid", "_current", "_distances"];
|
|||
|
||||
// Make sure that there is no blufor unit inside min dist to spawn
|
||||
if (_valid) then {
|
||||
if (([markerpos _current, _min, GRLIB_side_friendly] call F_getUnitsCount) > 0) then {
|
||||
if (([markerpos _current, _min, GRLIB_side_friendly] call KPLIB_fnc_getUnitsCount) > 0) then {
|
||||
_valid = false;
|
||||
};
|
||||
};
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
/*
|
||||
File: fn_getResistanceTier.sqf
|
||||
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
|
||||
Date: 2017-10-08
|
||||
Last Update: 2019-12-03
|
||||
License: MIT License - http://www.opensource.org/licenses/MIT
|
||||
|
||||
Description:
|
||||
Returns the current tier level of the resistance forces.
|
||||
|
||||
Parameter(s):
|
||||
NONE
|
||||
|
||||
Returns:
|
||||
Tier level [NUMBER]
|
||||
*/
|
||||
// TODO
|
||||
private _return = 1;
|
||||
|
||||
if (KP_liberation_guerilla_strength >= KP_liberation_resistance_tier2) then {
|
||||
_return = 2;
|
||||
};
|
||||
|
||||
if (KP_liberation_guerilla_strength >= KP_liberation_resistance_tier3) then {
|
||||
_return = 3;
|
||||
};
|
||||
|
||||
_return
|
|
@ -0,0 +1,89 @@
|
|||
/*
|
||||
File: fn_getSaveableParam.sqf
|
||||
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
|
||||
Date: 2018-01-27
|
||||
Last Update: 2019-12-03
|
||||
License: MIT License - http://www.opensource.org/licenses/MIT
|
||||
|
||||
Description:
|
||||
Saves/loads/fetches mission parameter from profileNamespace depending on "_action" argument.
|
||||
If no action provided value from "KP_load_params" variable is used.
|
||||
On SP enviroment saving/loading is disabled.
|
||||
|
||||
Parameter(s):
|
||||
_paramName - Name of parameter [STRING, defaults to ""]
|
||||
_defaultValue - Default value if parameter not found or no saved value [NUMBER, defaults to 0]
|
||||
_action - Should save(0)/load(1) from profile namespace or get(2) from selected param value [NUMBER, defaults to nil]
|
||||
|
||||
Returns:
|
||||
Parameter value [BOOL]
|
||||
*/
|
||||
// TODO
|
||||
params ["_paramName", ["_defaultValue", 0], ["_action", nil]];
|
||||
|
||||
private _saveKey = "KP_LIBERATION_" + (toUpper worldName) + "_SAVE_PARAMS";
|
||||
private _value = nil;
|
||||
|
||||
// Use lobby value if no action specified
|
||||
if(isNil "_action") then {_action = KP_load_params;};
|
||||
|
||||
// We propably shoud not load parameters on SP environment
|
||||
if(!isMultiplayer) then {_action = 2};
|
||||
|
||||
switch (_action) do {
|
||||
// Save to profileNamespace
|
||||
case 0: {
|
||||
_value = [_paramName, _defaultValue] call bis_fnc_getParamValue;
|
||||
private _savedParams = profileNamespace getVariable _saveKey;
|
||||
|
||||
if(isNil "_savedParams") then {
|
||||
if (KP_liberation_savegame_debug > 0) then {diag_log "[KP LIBERATION] [SAVE PARAM] Param save data is corrupted, creating new.";};
|
||||
// Create new "associative" array
|
||||
_savedParams = [[_paramName, _value]];
|
||||
|
||||
} else {
|
||||
private _singleParam = (_savedParams select {(_x select 0) == _paramName}) select 0;
|
||||
if(isNil "_singleParam") then {
|
||||
if (KP_liberation_savegame_debug > 0) then {diag_log format ["[KP LIBERATION] [SAVE PARAM] Saving value: %1 for param: %2,", _value, _paramName];};
|
||||
_savedParams pushBack [_paramName, _value];
|
||||
|
||||
} else {
|
||||
if (KP_liberation_savegame_debug > 0) then {diag_log format ["[KP LIBERATION] [SAVE PARAM] Overwriting value: %1 with: %2 for param: %3,", (_singleParam select 1), _value, _paramName];};
|
||||
// _singleparam is an reference to array in _savedParams, we can use "set"
|
||||
_singleParam set [1, _value];
|
||||
};
|
||||
};
|
||||
|
||||
// Save params to profile namespace
|
||||
profileNamespace setVariable [_saveKey, _savedParams];
|
||||
saveProfileNamespace;
|
||||
};
|
||||
// Load from profileNamespace
|
||||
case 1: {
|
||||
private _savedParams = profileNamespace getVariable _saveKey;
|
||||
if(isNil "_savedParams") then {
|
||||
if (KP_liberation_savegame_debug > 0) then {diag_log "[KP LIBERATION] [SAVE PARAM] Param save data is corrupted, can't load!";};
|
||||
// Fix param save data
|
||||
profileNamespace setVariable [_saveKey, []];
|
||||
if (KP_liberation_savegame_debug > 0) then {diag_log format ["[KP LIBERATION] [SAVE PARAM] No saved value for param: %1, fetching value.", _paramName];};
|
||||
_value = [_paramName, _defaultValue] call bis_fnc_getParamValue;
|
||||
} else {
|
||||
private _singleParam = (_savedParams select {(_x select 0) == _paramName}) select 0;
|
||||
if(isNil "_singleParam") then {
|
||||
if (KP_liberation_savegame_debug > 0) then {diag_log format ["[KP LIBERATION] [SAVE PARAM] No saved value for param: %1, fetching value.", _paramName];};
|
||||
_value = [_paramName, _defaultValue] call bis_fnc_getParamValue;
|
||||
} else {
|
||||
if (KP_liberation_savegame_debug > 0) then {diag_log format ["[KP LIBERATION] [SAVE PARAM] Found value: %1 for param: %2,", (_singleParam select 1), _paramName];};
|
||||
_value = _singleParam select 1;
|
||||
};
|
||||
};
|
||||
};
|
||||
// Get param
|
||||
default {
|
||||
if (KP_liberation_savegame_debug > 0) then {diag_log "[KP LIBERATION] [SAVE PARAM] Fetch selected value for param";};
|
||||
_value = [_paramName, _defaultValue] call bis_fnc_getParamValue;
|
||||
};
|
||||
};
|
||||
|
||||
// Return param value
|
||||
_value;
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
File: fn_getSectorOwnership.sqf
|
||||
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
|
||||
Date: 2019-12-03
|
||||
Last Update: 2019-12-03
|
||||
License: MIT License - http://www.opensource.org/licenses/MIT
|
||||
|
||||
Description:
|
||||
No description added yet.
|
||||
|
||||
Parameter(s):
|
||||
_localVariable - Description [DATATYPE, defaults to DEFAULTVALUE]
|
||||
|
||||
Returns:
|
||||
Function reached the end [BOOL]
|
||||
*/
|
||||
// TODO
|
||||
params [ "_thatpos", [ "_localsize", GRLIB_capture_size ] ];
|
||||
private [ "_cap_thresold_count", "_cap_thresold_ratio", "_cap_min_ratio", "_sectorside", "_countblufor_ownership", "_countopfor_ownership", "_blufor_ratio" ];
|
||||
|
||||
|
@ -6,8 +23,8 @@ _cap_thresold_ratio = 0.85;
|
|||
_cap_min_ratio = 0.51;
|
||||
|
||||
_sectorside = GRLIB_side_resistance;
|
||||
_countblufor_ownership = [_thatpos, _localsize, GRLIB_side_friendly ] call F_getUnitsCount;
|
||||
_countopfor_ownership = [_thatpos, _localsize, GRLIB_side_enemy ] call F_getUnitsCount;
|
||||
_countblufor_ownership = [_thatpos, _localsize, GRLIB_side_friendly ] call KPLIB_fnc_getUnitsCount;
|
||||
_countopfor_ownership = [_thatpos, _localsize, GRLIB_side_enemy ] call KPLIB_fnc_getUnitsCount;
|
||||
|
||||
_blufor_ratio = 0;
|
||||
if ( _countblufor_ownership + _countopfor_ownership != 0 ) then {
|
|
@ -0,0 +1,26 @@
|
|||
/*
|
||||
File: fn_getUnitPositionId.sqf
|
||||
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
|
||||
Date: 2019-12-03
|
||||
Last Update: 2019-12-03
|
||||
License: MIT License - http://www.opensource.org/licenses/MIT
|
||||
|
||||
Description:
|
||||
No description added yet.
|
||||
|
||||
Parameter(s):
|
||||
_localVariable - Description [DATATYPE, defaults to DEFAULTVALUE]
|
||||
|
||||
Returns:
|
||||
Function reached the end [BOOL]
|
||||
*/
|
||||
// TODO
|
||||
params [ "_unit" ];
|
||||
private ["_vvn", "_str"];
|
||||
|
||||
_vvn = vehicleVarName _unit;
|
||||
_unit setVehicleVarName "";
|
||||
_str = str _unit;
|
||||
_unit setVehicleVarName _vvn;
|
||||
|
||||
parseNumber (_str select [(_str find ":") + 1])
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
File: fn_getUnitsCount.sqf
|
||||
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
|
||||
Date: 2019-12-03
|
||||
Last Update: 2019-12-03
|
||||
License: MIT License - http://www.opensource.org/licenses/MIT
|
||||
|
||||
Description:
|
||||
No description added yet.
|
||||
|
||||
Parameter(s):
|
||||
_localVariable - Description [DATATYPE, defaults to DEFAULTVALUE]
|
||||
|
||||
Returns:
|
||||
Function reached the end [BOOL]
|
||||
*/
|
||||
// TODO
|
||||
params ["_position", "_distance", "_side"];
|
||||
|
||||
private _infantrycount = _side countSide ((_position nearEntities ["Man", _distance]) select {!(captive _x) && ((getpos _x) select 2 < 100)});
|
|
@ -1,7 +1,20 @@
|
|||
// LARs_fnc_addAllVirtualCargo.sqf
|
||||
// Original code by Larrow - https://forums.bistudio.com/profile/770615-larrow/
|
||||
// See: https://forums.bistudio.com/forums/topic/182817-how-to-limit-weapons-in-the-arsenal-of-a-box/?do=findComment&comment=2907944
|
||||
/*
|
||||
File: fn_getVirtualCargo.sqf
|
||||
Author: Larrow - https://forums.bistudio.com/profile/770615-larrow/
|
||||
Date: 2015-08-31
|
||||
Last Update: 2019-12-03
|
||||
License: MIT License - http://www.opensource.org/licenses/MIT
|
||||
|
||||
Description:
|
||||
See: https://forums.bistudio.com/forums/topic/182817-how-to-limit-weapons-in-the-arsenal-of-a-box/?do=findComment&comment=2907944
|
||||
|
||||
Parameter(s):
|
||||
_localVariable - Description [DATATYPE, defaults to DEFAULTVALUE]
|
||||
|
||||
Returns:
|
||||
Function reached the end [BOOL]
|
||||
*/
|
||||
// TODO
|
||||
private ["_virtualCargo", "_virtualWeapons", "_virtualMagazines", "_virtualItems", "_virtualBackpacks"];
|
||||
|
||||
_virtualCargo = [];
|
|
@ -1,24 +1,23 @@
|
|||
/*
|
||||
F_getWeaponComponents
|
||||
File: fn_getWeaponComponents.sqf
|
||||
Author: Zharf - https://github.com/zharf
|
||||
Date: 2019-06-21
|
||||
Last Update: 2019-12-03
|
||||
License: MIT License - http://www.opensource.org/licenses/MIT
|
||||
|
||||
File: F_kp_getWeaponComponents.sqf
|
||||
Author: Zharf, based on CBA_fnc_weaponComponents by commy2
|
||||
Date: 2019-06-21
|
||||
Last Update: 2019-06-21
|
||||
Description:
|
||||
Snatched from CBA since we don't depend on it yet.
|
||||
Reports class name of base weapon without attachments and all attachments belonging to a pre equipped weapon.
|
||||
Base weapon and attachments are reported in lower case capitalization.
|
||||
Fixed version of BIS_fnc_weaponComponents..
|
||||
|
||||
Description:
|
||||
Snatched from CBA since we don't depend on it yet.
|
||||
Reports class name of base weapon without attachments and all attachments belonging to a pre equipped weapon.
|
||||
Base weapon and attachments are reported in lower case capitalization.
|
||||
Fixed version of BIS_fnc_weaponComponents.
|
||||
Parameter(s):
|
||||
_weapon - A weapons class name with attachments build in [STRING, defaults to ""]
|
||||
|
||||
Parameter(s):
|
||||
0: STRING - a weapons class name with attachments build in
|
||||
|
||||
Returns:
|
||||
ARRAY
|
||||
Returns:
|
||||
Weapon components [ARRAY]
|
||||
*/
|
||||
|
||||
// TODO
|
||||
params [["_weapon", "", [""]]];
|
||||
private _config = configFile >> "CfgWeapons" >> _weapon;
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
/*
|
||||
File: fn_isAdmin.sqf
|
||||
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
|
||||
Date: 2019-12-03
|
||||
Last Update: 2019-12-03
|
||||
License: MIT License - http://www.opensource.org/licenses/MIT
|
||||
|
||||
Description:
|
||||
No description added yet.
|
||||
|
||||
Parameter(s):
|
||||
_localVariable - Description [DATATYPE, defaults to DEFAULTVALUE]
|
||||
|
||||
Returns:
|
||||
Function reached the end [BOOL]
|
||||
*/
|
||||
// TODO
|
||||
serverCommandAvailable "#kick"
|
|
@ -0,0 +1,26 @@
|
|||
/*
|
||||
File: fn_isBigtownActive.sqf
|
||||
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
|
||||
Date: 2019-12-03
|
||||
Last Update: 2019-12-03
|
||||
License: MIT License - http://www.opensource.org/licenses/MIT
|
||||
|
||||
Description:
|
||||
No description added yet.
|
||||
|
||||
Parameter(s):
|
||||
_localVariable - Description [DATATYPE, defaults to DEFAULTVALUE]
|
||||
|
||||
Returns:
|
||||
Function reached the end [BOOL]
|
||||
*/
|
||||
// TODO
|
||||
private _is_bigtown_active = false;
|
||||
|
||||
if (!isNil "active_sectors") then {
|
||||
{
|
||||
if (_x in sectors_bigtown) exitWith {_is_bigtown_active = true};
|
||||
} forEach active_sectors;
|
||||
};
|
||||
|
||||
_is_bigtown_active
|
|
@ -0,0 +1,28 @@
|
|||
/*
|
||||
File: fn_isClassUAV.sqf
|
||||
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
|
||||
Date: 2017-11-17
|
||||
Last Update: 2019-12-03
|
||||
License: MIT License - http://www.opensource.org/licenses/MIT
|
||||
|
||||
Description:
|
||||
Returns if given vehicle class is an UAV.
|
||||
|
||||
Parameter(s):
|
||||
_vehicleclass - Class of object which will be checked if it is an UAV [STRING, defaults to ""]
|
||||
|
||||
Returns:
|
||||
Class is UAV [BOOL]
|
||||
*/
|
||||
// TODO
|
||||
params ["_vehicleclass"];
|
||||
|
||||
private _isUAV = false;
|
||||
|
||||
if ((typeName _vehicleclass) == "STRING") then {
|
||||
if ((getNumber(configFile >> "CfgVehicles" >> _vehicleclass >> "isUav")) == 1) then {
|
||||
_isUAV = true;
|
||||
};
|
||||
};
|
||||
|
||||
_isUAV;
|
|
@ -1,21 +1,20 @@
|
|||
/*
|
||||
F_isRadio
|
||||
|
||||
File: F_kp_isRadio.sqf
|
||||
File: fn_isRadio.sqf
|
||||
Author: Zharf - https://github.com/zharf
|
||||
Date: 2019-07-07
|
||||
Last Update: 2019-07-23
|
||||
Last Update: 2019-12-03
|
||||
License: MIT License - http://www.opensource.org/licenses/MIT
|
||||
|
||||
Description:
|
||||
Returns whether the provided item is a radio or not
|
||||
Returns whether the provided item is a radio or not.
|
||||
|
||||
Parameter(s):
|
||||
0: STRING - Classname to check. (Default "")
|
||||
_item - Description [STRING, defaults to ""]
|
||||
|
||||
Returns:
|
||||
BOOL
|
||||
Item is a radio [BOOL]
|
||||
*/
|
||||
|
||||
// TODO
|
||||
params [
|
||||
["_item", "", [""]]
|
||||
];
|
|
@ -0,0 +1,24 @@
|
|||
/*
|
||||
File: fn_potatoScan.sqf
|
||||
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
|
||||
Date: 2019-12-03
|
||||
Last Update: 2019-12-03
|
||||
License: MIT License - http://www.opensource.org/licenses/MIT
|
||||
|
||||
Description:
|
||||
No description added yet.
|
||||
|
||||
Parameter(s):
|
||||
_localVariable - Description [DATATYPE, defaults to DEFAULTVALUE]
|
||||
|
||||
Returns:
|
||||
Function reached the end [BOOL]
|
||||
*/
|
||||
// TODO
|
||||
private [ "_potatoes", "_potato" ];
|
||||
|
||||
_potatoes = vehicles select {typeof _x == huron_typename && alive _x};
|
||||
_potato = objNull;
|
||||
if ( count _potatoes != 0 ) then { _potato = _potatoes select 0 };
|
||||
|
||||
_potato
|
|
@ -0,0 +1,23 @@
|
|||
/*
|
||||
File: fn_protectObject.sqf
|
||||
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
|
||||
Date: 2019-12-03
|
||||
Last Update: 2019-12-03
|
||||
License: MIT License - http://www.opensource.org/licenses/MIT
|
||||
|
||||
Description:
|
||||
No description added yet.
|
||||
|
||||
Parameter(s):
|
||||
_localVariable - Description [DATATYPE, defaults to DEFAULTVALUE]
|
||||
|
||||
Returns:
|
||||
Function reached the end [BOOL]
|
||||
*/
|
||||
// TODO
|
||||
params [ "_obj", "_enable" ];
|
||||
|
||||
_obj allowDamage _enable;
|
||||
_obj enableSimulation _enable;
|
||||
|
||||
true
|
|
@ -0,0 +1,19 @@
|
|||
/*
|
||||
File: fn_rearmVehicle.sqf
|
||||
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
|
||||
Date: 2019-12-03
|
||||
Last Update: 2019-12-03
|
||||
License: MIT License - http://www.opensource.org/licenses/MIT
|
||||
|
||||
Description:
|
||||
No description added yet.
|
||||
|
||||
Parameter(s):
|
||||
_localVariable - Description [DATATYPE, defaults to DEFAULTVALUE]
|
||||
|
||||
Returns:
|
||||
Function reached the end [BOOL]
|
||||
*/
|
||||
// TODO
|
||||
params [ "_veh" ];
|
||||
_veh setVehicleAmmoDef 1;
|
|
@ -1,24 +1,23 @@
|
|||
/*
|
||||
F_removeWeaponCargo
|
||||
File: fn_removeWeaponCargo.sqf
|
||||
Author: Zharf - https://github.com/zharf
|
||||
Date: 2019-06-21
|
||||
Last Update: 2019-12-03
|
||||
License: MIT License - http://www.opensource.org/licenses/MIT
|
||||
|
||||
File: F_kp_removeWeaponCargo.sqf
|
||||
Author: Zharf, based on CBA_fnc_removeWeaponCargo by Jonpas
|
||||
Date: 2019-06-21
|
||||
Last Update: 2019-06-21
|
||||
Description:
|
||||
Removes weapons not found in KP_liberation_allowed_items from a cargo space.
|
||||
|
||||
Description:
|
||||
Removes weapons not found in KP_liberation_allowed_items from a cargo space
|
||||
Warning: All weapon attachments/magazines in container will become detached.
|
||||
Warning: Preset weapons without non-preset parents will get their attachments readded (engine limitation).
|
||||
|
||||
Warning: All weapon attachments/magazines in container will become detached.
|
||||
Warning: Preset weapons without non-preset parents will get their attachments readded (engine limitation).
|
||||
Parameter(s):
|
||||
_container - Object with cargo [OBJECT, defaults to objNull]
|
||||
|
||||
Parameter(s):
|
||||
0: OBJECT - Object with cargo
|
||||
|
||||
Returns:
|
||||
ARRAY
|
||||
Returns:
|
||||
Removed items [ARRAY]
|
||||
*/
|
||||
|
||||
// TODO
|
||||
params [["_container", objNull, [objNull]]];
|
||||
if (isNull _container) exitWith {
|
||||
[]
|
||||
|
@ -38,7 +37,7 @@ clearWeaponCargoGlobal _container;
|
|||
};
|
||||
|
||||
// Some weapons don't have non-preset parents
|
||||
_components = _weapon call F_getWeaponComponents;
|
||||
_components = _weapon call KPLIB_fnc_getWeaponComponents;
|
||||
private _weaponNonPreset = _components select 0;
|
||||
|
||||
if (_weaponNonPreset == "") then {
|
||||
|
@ -106,4 +105,3 @@ clearWeaponCargoGlobal _container;
|
|||
} forEach _weaponsItemsCargo;
|
||||
|
||||
_removed;
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
/*
|
||||
File: fn_secondsToTimer.sqf
|
||||
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
|
||||
Date: 2019-12-03
|
||||
Last Update: 2019-12-03
|
||||
License: MIT License - http://www.opensource.org/licenses/MIT
|
||||
|
||||
Description:
|
||||
No description added yet.
|
||||
|
||||
Parameter(s):
|
||||
_localVariable - Description [DATATYPE, defaults to DEFAULTVALUE]
|
||||
|
||||
Returns:
|
||||
Function reached the end [BOOL]
|
||||
*/
|
||||
// TODO
|
||||
params [ "_timer" ];
|
||||
private [ "_minutes", "_seconds", "_minutes_zero", "_seconds_zero", "_retstr" ];
|
||||
|
||||
_minutes = floor (_timer / 60);
|
||||
_seconds = _timer % 60;
|
||||
_minutes_zero = '';
|
||||
_seconds_zero = '';
|
||||
|
||||
if ( _minutes < 10 ) then { _minutes_zero = '0'; };
|
||||
if ( _seconds < 10 ) then { _seconds_zero = '0'; };
|
||||
|
||||
_retstr = format [ '%1%2:%3%4',_minutes_zero,_minutes,_seconds_zero,_seconds ];
|
||||
|
||||
_retstr
|
|
@ -0,0 +1,29 @@
|
|||
/*
|
||||
File: fn_setFobMass.sqf
|
||||
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
|
||||
Date: 2017-12-02
|
||||
Last Update: 2019-12-03
|
||||
License: MIT License - http://www.opensource.org/licenses/MIT
|
||||
|
||||
Description:
|
||||
Sets mass of FOB box to Max slingload weight of "huron_typename" lowered by 100.
|
||||
If max slingload mass is lower than 1000 its set to 1000.
|
||||
If it is higher than 3000 it's set to 3000.
|
||||
|
||||
Parameter(s):
|
||||
_box - FOB Box on which mass will be set [OBJECT, defaults to objNull]
|
||||
|
||||
Returns:
|
||||
Function reached the end [BOOL]
|
||||
*/
|
||||
// TODO
|
||||
params ["_box"];
|
||||
|
||||
private _boxMass = getNumber(configFile >> "CfgVehicles" >> huron_typename >> "slingLoadMaxCargoMass") - 100;
|
||||
if(_boxMass < 1000) then {
|
||||
_boxMass = 1000;
|
||||
} else {
|
||||
if(_boxMass > 3000) then {_boxMass = 3000;};
|
||||
};
|
||||
|
||||
[_box, _boxMass] remoteExec ["KPLIB_fnc_setMass",_box];
|
|
@ -0,0 +1,19 @@
|
|||
/*
|
||||
File: fn_setFuel.sqf
|
||||
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
|
||||
Date: 2019-12-03
|
||||
Last Update: 2019-12-03
|
||||
License: MIT License - http://www.opensource.org/licenses/MIT
|
||||
|
||||
Description:
|
||||
No description added yet.
|
||||
|
||||
Parameter(s):
|
||||
_localVariable - Description [DATATYPE, defaults to DEFAULTVALUE]
|
||||
|
||||
Returns:
|
||||
Function reached the end [BOOL]
|
||||
*/
|
||||
// TODO
|
||||
params [ "_veh", "_fuelamount" ];
|
||||
_veh setFuel _fuelamount;
|
|
@ -0,0 +1,71 @@
|
|||
/*
|
||||
File: fn_setLoadableViV.sqf
|
||||
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
|
||||
Date: 2019-05-08
|
||||
Last Update: 2019-12-03
|
||||
License: MIT License - http://www.opensource.org/licenses/MIT
|
||||
|
||||
Description:
|
||||
Adds ViV load/unload actions to object.
|
||||
|
||||
Parameter(s):
|
||||
_object - Object to add actions to [OBJECT, defaults to objNull]
|
||||
|
||||
Returns:
|
||||
Function reached the end [BOOL]
|
||||
*/
|
||||
// TODO
|
||||
params [["_object", objNull, [objNull]]];
|
||||
|
||||
private _loadFnc = {
|
||||
params ["_target"];
|
||||
|
||||
(_target call KPLIB_fnc_getNearestViVTransport) setVehicleCargo _target;
|
||||
};
|
||||
|
||||
// Add "Load" action
|
||||
_object addAction [
|
||||
"<t color='#FFFF00'>" + localize "STR_ACTION_LOAD_VIV" + "</t>",
|
||||
_loadFnc,
|
||||
nil,
|
||||
-991,
|
||||
false,
|
||||
true,
|
||||
"",
|
||||
"(isNull objectParent player) && {!isNull (_target call KPLIB_fnc_getNearestViVTransport)}",
|
||||
10
|
||||
];
|
||||
|
||||
// Add "No transports nearby action"
|
||||
_object addAction [
|
||||
"<t color='#FF0000'>" + localize "STR_ACTION_NOTRANSPORT_VIV" + "</t>",
|
||||
{},
|
||||
nil,
|
||||
-991,
|
||||
false,
|
||||
true,
|
||||
"",
|
||||
"(isNull objectParent player) && {isNull (_target call KPLIB_fnc_getNearestViVTransport)} && {isNull isVehicleCargo _target}",
|
||||
10
|
||||
];
|
||||
|
||||
private _unloadFnc = {
|
||||
params ["_target"];
|
||||
|
||||
objNull setVehicleCargo _target;
|
||||
};
|
||||
|
||||
// Add "Unload" action
|
||||
_object addAction [
|
||||
"<t color='#FFFF00'>" + localize "STR_ACTION_UNLOAD_VIV" + "</t>",
|
||||
_unloadFnc,
|
||||
nil,
|
||||
-991,
|
||||
false,
|
||||
true,
|
||||
"",
|
||||
"(isNull objectParent player) && {!isNull isVehicleCargo _target}",
|
||||
10
|
||||
];
|
||||
|
||||
true
|
|
@ -0,0 +1,342 @@
|
|||
/*
|
||||
File: fn_setLoadout.sqf
|
||||
Author: aeroson - https://github.com/aeroson
|
||||
Date: 2014-03-25
|
||||
Last Update: 2019-12-03
|
||||
License: MIT License - http://www.opensource.org/licenses/MIT
|
||||
|
||||
Description:
|
||||
I guarantee backwards compatibility.
|
||||
These scripts allows you set/get (load/save)all of the unit's gear, including:
|
||||
uniform, vest, backpack, contents of it, all quiped items, all three weapons with their attachments, currently loaded magazines and number of ammo in magazines.
|
||||
All this while preserving order of items.
|
||||
Useful for saving/loading loadouts.
|
||||
Ideal for revive scripts where you have to set exactly the same loadout to newly created unit.
|
||||
Uses workaround with placeholders to add vest/backpack items, so items stay where you put them.
|
||||
|
||||
Parameter(s):
|
||||
_localVariable - Description [DATATYPE, defaults to DEFAULTVALUE]
|
||||
|
||||
Returns:
|
||||
Function reached the end [BOOL]
|
||||
*/
|
||||
// TODO
|
||||
private ["_target","_options","_loadMagsAmmo","_data","_loadedMagazines","_placeholderCount","_loadBeforeAdd","_add","_outfit","_addWeapon","_addPrimary","_addHandgun","_addSecondary","_addOrder","_currentWeapon","_currentMode"];
|
||||
|
||||
_options = [];
|
||||
|
||||
// addAction support
|
||||
if(count _this < 4) then {
|
||||
#define PARAM_START private ["_PARAM_INDEX"]; _PARAM_INDEX=0;
|
||||
#define PARAM_REQ(A) if (count _this <= _PARAM_INDEX) exitWith { systemChat format["required param '%1' not supplied in file:'%2' at line:%3", #A ,__FILE__,__LINE__]; }; A = _this select _PARAM_INDEX; _PARAM_INDEX=_PARAM_INDEX+1;
|
||||
#define PARAM(A,B) A = B; if (count _this > _PARAM_INDEX) then { A = _this select _PARAM_INDEX; }; _PARAM_INDEX=_PARAM_INDEX+1;
|
||||
PARAM_START
|
||||
PARAM_REQ(_target)
|
||||
PARAM_REQ(_data)
|
||||
PARAM(_options,[])
|
||||
} else {
|
||||
_target = player;
|
||||
_data = loadout;
|
||||
//playSound3D ["A3\Sounds_F\sfx\ZoomIn.wav", _target];
|
||||
};
|
||||
|
||||
if(isNil{_data}) exitWith {
|
||||
systemChat "you are trying to set/load empty loadout";
|
||||
};
|
||||
if(count _data < 13) exitWith {
|
||||
systemChat "you are trying to set/load corrupted loadout";
|
||||
};
|
||||
|
||||
#define QUOTE(A) #A
|
||||
#define EL(A,B) ((A) select (B))
|
||||
#define _THIS(A) EL(_this,A)
|
||||
|
||||
// placeholders
|
||||
#define PLACEHOLDER_BACKPACK QUOTE(B_Kitbag_mcamo) // any backpack with capacity>0
|
||||
#define PLACEHOLDER_ITEM QUOTE(ItemWatch) // addItem placeholder should be smallest item possible
|
||||
|
||||
_loadMagsAmmo = "ammo" in _options;
|
||||
_loadedMagazines = [];
|
||||
if(count _data > 13) then {
|
||||
if(typeName(_data select 13)=="ARRAY") then {
|
||||
_loadedMagazines = _data select 13;
|
||||
};
|
||||
};
|
||||
|
||||
_currentWeapon = "";
|
||||
if(count _data > 14) then {
|
||||
_currentWeapon = _data select 14;
|
||||
};
|
||||
_currentMode = "";
|
||||
if(count _data > 15) then {
|
||||
_currentMode = _data select 15;
|
||||
};
|
||||
|
||||
_placeholderCount = 0;
|
||||
|
||||
// basic add function intended for use with uniform and vest
|
||||
_add = {
|
||||
private ["_target","_item","_callback"];
|
||||
_target = _this select 0;
|
||||
_item = _this select 1;
|
||||
_callback = _this select 2;
|
||||
if(typename _item == "ARRAY") then {
|
||||
if(_item select 0 != "") then {
|
||||
if(_loadMagsAmmo) then {
|
||||
_target addMagazine _item;
|
||||
} else {
|
||||
(_item select 0) call _callback;
|
||||
};
|
||||
};
|
||||
} else {
|
||||
if(_item != "") then {
|
||||
_item call _callback;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
// remove clothes to prevent incorrect mag loading
|
||||
removeUniform _target;
|
||||
removeVest _target;
|
||||
removeBackpack _target;
|
||||
|
||||
|
||||
_outfit = PLACEHOLDER_BACKPACK; // we need to add items somewhere before we can assign them
|
||||
_target addBackpack _outfit;
|
||||
clearAllItemsFromBackpack _target;
|
||||
removeAllAssignedItems _target;
|
||||
removeHeadgear _target;
|
||||
removeGoggles _target;
|
||||
|
||||
// add loaded magazines of assigned items
|
||||
if(count _loadedMagazines>=3) then {
|
||||
{
|
||||
[_target, _x, { _target addItemToBackpack _x }] call _add;
|
||||
} forEach (_loadedMagazines select 3);
|
||||
};
|
||||
|
||||
// add assigned items
|
||||
{
|
||||
[_target, _x, { _target addItemToBackpack _x }] call _add;
|
||||
_target assignItem _x;
|
||||
} forEach (_data select 0);
|
||||
|
||||
clearAllItemsFromBackpack _target;
|
||||
|
||||
// get assigned items, headgear and goggles is not part of assignedItems
|
||||
private ["_assignedItems","_headgear","_goggles"];
|
||||
_assignedItems = assignedItems _target;
|
||||
_headgear = headgear _target;
|
||||
_goggles = goggles _target;
|
||||
if((_headgear != "") && !(_headgear in _assignedItems)) then {
|
||||
_assignedItems set [count _assignedItems, _headgear];
|
||||
};
|
||||
if((_goggles != "") && !(_goggles in _assignedItems)) then {
|
||||
_assignedItems set [count _assignedItems, _goggles];
|
||||
};
|
||||
// add asigned items that could not be added with assign item
|
||||
// asuming each assigned item can be put only into one slot
|
||||
{
|
||||
if(!(_x in _assignedItems)) then {
|
||||
_target addWeapon _x;
|
||||
}
|
||||
} forEach (_data select 0);
|
||||
|
||||
|
||||
|
||||
// universal add weapon to hands
|
||||
_addWeapon = {
|
||||
private ["_weapon","_magazines","_muzzles"];
|
||||
clearAllItemsFromBackpack _target;
|
||||
_target removeWeapon ([] call _THIS(0));
|
||||
_weapon = _data select _THIS(1);
|
||||
if(_weapon != "") then {
|
||||
if(isClass(configFile>>"CfgWeapons">>_weapon)) then {
|
||||
if (_currentWeapon == "") then {
|
||||
_currentWeapon = _weapon;
|
||||
};
|
||||
if(count _loadedMagazines > 0) then {
|
||||
_magazines = _loadedMagazines select _THIS(5); // get loaded magazines from saved loadout
|
||||
if(typename _magazines != "ARRAY") then { // backwards compatibility, make sure _magazines is array
|
||||
if(_magazines=="") then {
|
||||
_magazines = [];
|
||||
} else {
|
||||
_magazines = [_magazines];
|
||||
};
|
||||
};
|
||||
} else {
|
||||
_magazines = [getArray(configFile>>"CfgWeapons">>_weapon>>"magazines") select 0]; // generate weapon magazine
|
||||
_muzzles = configFile>>"CfgWeapons">>_weapon>>"muzzles";
|
||||
if(isArray(_muzzles)) then { // generate magazine for each muzzle
|
||||
{
|
||||
if (_x != "this") then {
|
||||
_magazines set [count _magazines, toLower(getArray(configFile>>"CfgWeapons">>_weapon>>_x>>"magazines") select 0)];
|
||||
};
|
||||
} forEach getArray(_muzzles);
|
||||
};
|
||||
};
|
||||
{
|
||||
[_target, _x, { _target addItemToBackpack _x }] call _add;
|
||||
} forEach _magazines; // add magazines
|
||||
_target addWeapon _weapon;
|
||||
{
|
||||
if(_x!="" && !(_x in ([] call _THIS(3)))) then {
|
||||
_x call _THIS(4);
|
||||
};
|
||||
} forEach (_data select (1+_THIS(1))); // add weapon items
|
||||
} else {
|
||||
systemchat format["%1 %2 doesn't exist",_THIS(2),_weapon];
|
||||
if (_currentWeapon == _weapon) then {
|
||||
_currentWeapon = "";
|
||||
_currentMode = "";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
// add primary weapon, add primary weapon loaded magazine, add primary weapon items
|
||||
_addPrimary = {
|
||||
[
|
||||
{ primaryWeapon _target }, // 0 // get current weapon
|
||||
1, // 1 //weapon classname index in _data
|
||||
"primary", // 2 // weapon debug type
|
||||
{ primaryWeaponItems _target }, // 3 // weapon items
|
||||
{ _target addPrimaryWeaponItem _this }, // 4 // add weapon item
|
||||
0 // 5 // index in _loadedMagazines
|
||||
] call _addWeapon;
|
||||
};
|
||||
|
||||
// add handgun weapon, add handgun weapon loaded magazine, add handgun weapon items
|
||||
_addHandgun = {
|
||||
[
|
||||
{ handgunWeapon _target }, // 0 // get current weapon
|
||||
3, // 1 //weapon classname index in _data
|
||||
"handgun", // 2 // weapon debug type
|
||||
{ handgunItems _target }, // 3 // weapon items
|
||||
{ _target addHandgunItem _this }, // 4 // add weapon item
|
||||
1 // 5 // index in _loadedMagazines
|
||||
] call _addWeapon;
|
||||
};
|
||||
|
||||
// add secondary weapon, add secondary weapon loaded magazine, add secondary weapon items
|
||||
_addSecondary = {
|
||||
[
|
||||
{ secondaryWeapon _target }, // 0 // get current weapon
|
||||
5, // 1 //weapon classname index in _data in _data
|
||||
"secondary", // 2 // weapon debug type
|
||||
{ secondaryWeaponItems _target }, // 3 // weapon items
|
||||
{ _target addSecondaryWeaponItem _this }, // 4 // add weapon item
|
||||
2 // 5 // index in _loadedMagazines
|
||||
] call _addWeapon;
|
||||
};
|
||||
|
||||
|
||||
// first added weapon is selected weapon, order add functions to firstly add currently selected weapon
|
||||
_addOrder=[_addPrimary,_addHandgun,_addSecondary];
|
||||
if(_currentWeapon!="") then {
|
||||
_addOrder = switch _currentWeapon do {
|
||||
case (_data select 3): {[_addHandgun,_addPrimary,_addSecondary]};
|
||||
case (_data select 5): {[_addSecondary,_addPrimary,_addHandgun]};
|
||||
default {_addOrder};
|
||||
};
|
||||
};
|
||||
{
|
||||
[] call _x;
|
||||
} forEach _addOrder;
|
||||
|
||||
// select weapon and firing mode
|
||||
if(vehicle _target == _target && _currentWeapon != "" && _currentMode != "") then {
|
||||
_muzzles = 0;
|
||||
while { (_currentWeapon != currentMuzzle _target || _currentMode != currentWeaponMode _target ) && _muzzles < 100 } do {
|
||||
_target action ["SWITCHWEAPON", _target, _target, _muzzles];
|
||||
_muzzles = _muzzles + 1;
|
||||
};
|
||||
if(_muzzles >= 100) then {
|
||||
systemchat format["mode %1 for %2 doesn't exist", _currentMode, _currentWeapon];
|
||||
_currentMode = "";
|
||||
};
|
||||
} else {
|
||||
_currentMode = "";
|
||||
};
|
||||
if(_currentMode == "" && _currentWeapon != "") then {
|
||||
_target selectWeapon _currentWeapon;
|
||||
};
|
||||
|
||||
clearAllItemsFromBackpack _target;
|
||||
|
||||
// add uniform, add uniform items and fill uniform with item placeholders
|
||||
_outfit = _data select 7;
|
||||
if(_outfit != "") then {
|
||||
if(isClass(configFile>>"CfgWeapons">>_outfit)) then {
|
||||
_target forceAddUniform _outfit;
|
||||
_target addItem PLACEHOLDER_ITEM;
|
||||
if(loadUniform _target > 0) then {
|
||||
_placeholderCount = _placeholderCount + 1;
|
||||
{
|
||||
[_target, _x, { _target addItemToUniform _x }] call _add;
|
||||
} forEach (_data select 8);
|
||||
while{true} do {
|
||||
_loadBeforeAdd = loadUniform _target;
|
||||
_target addItem PLACEHOLDER_ITEM;
|
||||
if(loadUniform _target == _loadBeforeAdd) exitWith {};
|
||||
_placeholderCount = _placeholderCount + 1;
|
||||
};
|
||||
};
|
||||
} else {
|
||||
systemchat format["uniform %1 doesn't exist",_outfit];
|
||||
};
|
||||
};
|
||||
|
||||
// add vest, add vest items and fill vest with item placeholders
|
||||
_outfit = _data select 9;
|
||||
if(_outfit != "") then {
|
||||
if(isClass(configFile>>"CfgWeapons">>_outfit)) then {
|
||||
_target addVest _outfit;
|
||||
_target addItem PLACEHOLDER_ITEM;
|
||||
if(loadVest _target > 0) then {
|
||||
_placeholderCount = _placeholderCount + 1;
|
||||
{
|
||||
[_target, _x, { _target addItemToVest _x }] call _add;
|
||||
} forEach (_data select 10);
|
||||
while{true} do {
|
||||
_loadBeforeAdd = loadVest _target;
|
||||
_target addItem PLACEHOLDER_ITEM;
|
||||
if(loadVest _target == _loadBeforeAdd) exitWith {};
|
||||
_placeholderCount = _placeholderCount + 1;
|
||||
};
|
||||
};
|
||||
} else {
|
||||
systemchat format["vest %1 doesn't exist",_outfit];
|
||||
};
|
||||
};
|
||||
|
||||
// add backpack and add backpack items
|
||||
removeBackpack _target;
|
||||
_outfit = _data select 11;
|
||||
if(_outfit != "") then {
|
||||
if(getNumber(configFile>>"CfgVehicles">>_outfit>>"isbackpack")==1) then {
|
||||
_target addBackpack _outfit;
|
||||
clearAllItemsFromBackpack _target;
|
||||
_target addItem PLACEHOLDER_ITEM;
|
||||
_placeholderCount = _placeholderCount + 1;
|
||||
if(loadBackpack _target > 0) then {
|
||||
{
|
||||
[_target, _x, { _target addItemToBackpack _x }] call _add;
|
||||
} forEach (_data select 12);
|
||||
};
|
||||
} else {
|
||||
systemchat format["backpack %1 doesn't exist",_outfit];
|
||||
};
|
||||
};
|
||||
|
||||
// remove item placeholders
|
||||
for "_i" from 1 to _placeholderCount do {
|
||||
_target removeItem PLACEHOLDER_ITEM;
|
||||
};
|
||||
|
||||
|
||||
// make loadout visible fix?
|
||||
if(vehicle _target == _target) then {
|
||||
//_target switchMove (getArray(configFile>>"CfgMovesMaleSdr">>"States">>animationState player>>"ConnectTo") select 0);
|
||||
_target setPosATL (getPosATL _target);
|
||||
};
|
|
@ -0,0 +1,19 @@
|
|||
/*
|
||||
File: fn_setMass.sqf
|
||||
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
|
||||
Date: 2019-12-03
|
||||
Last Update: 2019-12-03
|
||||
License: MIT License - http://www.opensource.org/licenses/MIT
|
||||
|
||||
Description:
|
||||
No description added yet.
|
||||
|
||||
Parameter(s):
|
||||
_localVariable - Description [DATATYPE, defaults to DEFAULTVALUE]
|
||||
|
||||
Returns:
|
||||
Function reached the end [BOOL]
|
||||
*/
|
||||
// TODO
|
||||
params [ "_veh", "_mass" ];
|
||||
_veh setMass _mass;
|
|
@ -0,0 +1,41 @@
|
|||
/*
|
||||
File: fn_sortStorage.sqf
|
||||
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
|
||||
Date: 2017-06-09
|
||||
Last Update: 2019-12-03
|
||||
License: MIT License - http://www.opensource.org/licenses/MIT
|
||||
|
||||
Description:
|
||||
Stack and sort the resources inside a storage area.
|
||||
|
||||
Parameter(s):
|
||||
_storage - Storage to sort [OBJECT, defaults to objNull]
|
||||
|
||||
Returns:
|
||||
Function reached the end [BOOL]
|
||||
*/
|
||||
// TODO
|
||||
params ["_storage"];
|
||||
|
||||
private _pos = getPos _storage;
|
||||
|
||||
private _supply = 0;
|
||||
private _ammo = 0;
|
||||
private _fuel = 0;
|
||||
|
||||
{
|
||||
switch ((typeOf _x)) do {
|
||||
case KP_liberation_supply_crate: {_supply = _supply + (_x getVariable ["KP_liberation_crate_value",0]);};
|
||||
case KP_liberation_ammo_crate: {_ammo = _ammo + (_x getVariable ["KP_liberation_crate_value",0]);};
|
||||
case KP_liberation_fuel_crate: {_fuel = _fuel + (_x getVariable ["KP_liberation_crate_value",0]);};
|
||||
default {diag_log format ["[KP LIBERATION] [ERROR] Invalid object (%1) at storage area", (typeOf _x)];};
|
||||
};
|
||||
detach _x;
|
||||
deleteVehicle _x;
|
||||
} forEach (attachedObjects _storage);
|
||||
|
||||
sleep 0.5;
|
||||
|
||||
[_supply, _ammo, _fuel, _storage, true] spawn KPLIB_fnc_fillStorage;
|
||||
|
||||
true
|
|
@ -0,0 +1,63 @@
|
|||
/*
|
||||
File: fn_spawnBuildingSquad.sqf
|
||||
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
|
||||
Date: 2019-12-03
|
||||
Last Update: 2019-12-03
|
||||
License: MIT License - http://www.opensource.org/licenses/MIT
|
||||
|
||||
Description:
|
||||
No description added yet.
|
||||
|
||||
Parameter(s):
|
||||
_localVariable - Description [DATATYPE, defaults to DEFAULTVALUE]
|
||||
|
||||
Returns:
|
||||
Function reached the end [BOOL]
|
||||
*/
|
||||
// TODO
|
||||
params ["_infsquad", "_building_ai_max", "_buildingpositions", "_sectorpos", ["_sector", ""]];
|
||||
|
||||
private _everythingspawned = [];
|
||||
|
||||
private _infsquad_classnames = [];
|
||||
if (_infsquad == "militia") then {
|
||||
_infsquad_classnames = militia_squad;
|
||||
} else {
|
||||
_infsquad_classnames = ([] call KPLIB_fnc_getSquadComp);
|
||||
};
|
||||
|
||||
if (_building_ai_max > floor ((count _buildingpositions) * GRLIB_defended_buildingpos_part)) then {_building_ai_max = floor ((count _buildingpositions) * GRLIB_defended_buildingpos_part)};
|
||||
private _squadtospawn = [];
|
||||
while {(count _squadtospawn) < _building_ai_max} do {_squadtospawn pushback (selectRandom _infsquad_classnames);};
|
||||
|
||||
private _position_indexes = [];
|
||||
private _position_count = count _buildingpositions;
|
||||
while {count _position_indexes < count _squadtospawn} do {
|
||||
private _nextposit = floor (random _position_count);
|
||||
if !(_nextposit in _position_indexes) then {
|
||||
_position_indexes pushback _nextposit;
|
||||
};
|
||||
};
|
||||
|
||||
private _grp = createGroup [GRLIB_side_enemy, true];
|
||||
private _idxposit = 0;
|
||||
{
|
||||
private _nextunit = [_x, _sectorpos, _grp] call KPLIB_fnc_createManagedUnit;
|
||||
|
||||
_nextunit setdir (random 360);
|
||||
_nextunit setpos (_buildingpositions select (_position_indexes select _idxposit));
|
||||
[_nextunit, _sector] spawn building_defence_ai;
|
||||
|
||||
_idxposit = _idxposit + 1;
|
||||
|
||||
if (count units _grp > 10) then {
|
||||
_everythingspawned = _everythingspawned + (units _grp);
|
||||
_grp = createGroup [GRLIB_side_enemy, true];
|
||||
};
|
||||
} forEach _squadtospawn;
|
||||
|
||||
if (!(isNull _grp)) then {
|
||||
_everythingspawned = _everythingspawned + (units _grp);
|
||||
};
|
||||
|
||||
_everythingspawned
|
|
@ -0,0 +1,43 @@
|
|||
/*
|
||||
File: fn_spawnCivilians.sqf
|
||||
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
|
||||
Date: 2019-12-03
|
||||
Last Update: 2019-12-03
|
||||
License: MIT License - http://www.opensource.org/licenses/MIT
|
||||
|
||||
Description:
|
||||
No description added yet.
|
||||
|
||||
Parameter(s):
|
||||
_localVariable - Description [DATATYPE, defaults to DEFAULTVALUE]
|
||||
|
||||
Returns:
|
||||
Function reached the end [BOOL]
|
||||
*/
|
||||
// TODO
|
||||
params ["_sector"];
|
||||
|
||||
private _createdcivs = [];
|
||||
private _sectorpos = getMarkerPos _sector;
|
||||
|
||||
private _idx = 0;
|
||||
private _nbcivs = round ((3 + (floor (random 7))) * GRLIB_civilian_activity);
|
||||
private _spread = 1;
|
||||
if (_sector in sectors_bigtown) then {
|
||||
_nbcivs = _nbcivs + 10;
|
||||
_spread = 2.5;
|
||||
};
|
||||
|
||||
_nbcivs = _nbcivs * (sqrt (GRLIB_unitcap));
|
||||
|
||||
while {_idx < _nbcivs} do {
|
||||
private _spawnpos = [(((_sectorpos select 0) + (75 * _spread)) - (random (150 * _spread))),(((_sectorpos select 1) + (75 * _spread)) - (random (150 * _spread))),0];
|
||||
private _grp = createGroup [GRLIB_side_civilian, true];
|
||||
|
||||
private _nextciv = [selectRandom civilians, _spawnpos, _grp] call KPLIB_fnc_createManagedUnit;
|
||||
_createdcivs pushBack _nextciv;
|
||||
[_grp] call add_civ_waypoints;
|
||||
_idx = _idx + 1;
|
||||
};
|
||||
|
||||
_createdcivs
|
|
@ -0,0 +1,70 @@
|
|||
/*
|
||||
File: fn_spawnGuerillaGroup.sqf
|
||||
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
|
||||
Date: 2017-10-08
|
||||
Last Update: 2019-12-03
|
||||
License: MIT License - http://www.opensource.org/licenses/MIT
|
||||
|
||||
Description:
|
||||
Spawns a group of guerilla units with random gear depending on guerilla strength.
|
||||
|
||||
Parameter(s):
|
||||
_pos - Position where to spawn the group [POSITION, defaults to [0, 0, 0]]
|
||||
_amount - Amount of units for the group. 0 for automatic calculation [NUMBER, defaults to 0]
|
||||
|
||||
Returns:
|
||||
Spawned group [GROUP]
|
||||
*/
|
||||
// TODO
|
||||
params [["_pos", [0, 0, 0]], ["_amount", 0]];
|
||||
|
||||
private _grp = createGroup [GRLIB_side_resistance, true];
|
||||
private _tier = [] call KPLIB_fnc_getResistanceTier;
|
||||
private _cr_multi = [] call KPLIB_fnc_crGetMulti;
|
||||
if (_amount == 0) then {_amount = (6 + (round (random _cr_multi)) + (round (random _tier)));};
|
||||
private _weapons = missionNamespace getVariable ("KP_liberation_guerilla_weapons_" + str _tier);
|
||||
private _uniforms = missionNamespace getVariable ("KP_liberation_guerilla_uniforms_" + str _tier);
|
||||
private _vests = missionNamespace getVariable ("KP_liberation_guerilla_vests_" + str _tier);
|
||||
private _headgear = missionNamespace getVariable ("KP_liberation_guerilla_headgear_" + str _tier);
|
||||
|
||||
while {(count (units _grp) < _amount)} do {
|
||||
private _unit = [selectRandom KP_liberation_guerilla_units, _pos, _grp, "PRIVATE", 5] call KPLIB_fnc_createManagedUnit;
|
||||
|
||||
private _weapon = selectRandom _weapons;
|
||||
|
||||
removeAllWeapons _unit;
|
||||
removeAllItems _unit;
|
||||
removeAllAssignedItems _unit;
|
||||
removeUniform _unit;
|
||||
removeVest _unit;
|
||||
removeBackpack _unit;
|
||||
removeHeadgear _unit;
|
||||
removeGoggles _unit;
|
||||
|
||||
_unit forceAddUniform (selectRandom _uniforms);
|
||||
_unit addItemToUniform "FirstAidKit";
|
||||
_unit addItemToUniform "MiniGrenade";
|
||||
_unit addVest (selectRandom _vests);
|
||||
for "_i" from 1 to (_weapon select 2) do {_unit addItemToVest (_weapon select 1);};
|
||||
_unit addHeadgear (selectRandom _headgear);
|
||||
if (_tier > 1) then {
|
||||
_unit addGoggles (selectRandom KP_liberation_guerilla_facegear);
|
||||
};
|
||||
|
||||
_unit addWeapon (_weapon select 0);
|
||||
_unit addPrimaryWeaponItem (_weapon select 3);
|
||||
_unit addPrimaryWeaponItem (_weapon select 4);
|
||||
|
||||
_unit linkItem "ItemMap";
|
||||
_unit linkItem "ItemCompass";
|
||||
_unit linkItem "ItemWatch";
|
||||
_unit linkItem "ItemRadio";
|
||||
|
||||
if ((_tier > 1) && ((random 100) <= KP_liberation_resistance_at_chance)) then {
|
||||
_unit addBackpack "B_FieldPack_cbr";
|
||||
for "_i" from 1 to 3 do {_unit addItemToBackpack "RPG7_F";};
|
||||
_unit addWeapon "launch_RPG7_F";
|
||||
};
|
||||
};
|
||||
|
||||
_grp
|
|
@ -0,0 +1,63 @@
|
|||
/*
|
||||
File: fn_spawnMilitaryPostSquad.sqf
|
||||
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
|
||||
Date: 2019-12-03
|
||||
Last Update: 2019-12-03
|
||||
License: MIT License - http://www.opensource.org/licenses/MIT
|
||||
|
||||
Description:
|
||||
No description added yet.
|
||||
|
||||
Parameter(s):
|
||||
_localVariable - Description [DATATYPE, defaults to DEFAULTVALUE]
|
||||
|
||||
Returns:
|
||||
Function reached the end [BOOL]
|
||||
*/
|
||||
// TODO
|
||||
params ["_squadpos"];
|
||||
|
||||
private _spawned_units_local = [];
|
||||
|
||||
private _allposts = (nearestObjects [_squadpos, ["Land_Cargo_Patrol_V1_F","Land_Cargo_Patrol_V2_F","Land_Cargo_Patrol_V3_F","Land_Cargo_Patrol_V4_F"], GRLIB_capture_size]) select {alive _x};
|
||||
if (count _allposts > 0) then {
|
||||
private _grp = createGroup [GRLIB_side_enemy, true];
|
||||
|
||||
{
|
||||
private _building_positions = [_x] call BIS_fnc_buildingPositions;
|
||||
private _unitclasspost = opfor_marksman;
|
||||
|
||||
if (random 100 > 60) then {
|
||||
_unitclasspost = opfor_machinegunner;
|
||||
};
|
||||
|
||||
private _nextunit_post = [_unitclasspost, _squadpos, _grp] call KPLIB_fnc_createManagedUnit;
|
||||
_nextunit_post setdir (180 + (getdir _x));
|
||||
_nextunit_post setpos (_building_positions select 1);
|
||||
|
||||
} forEach _allposts;
|
||||
|
||||
private _totalx = 0;
|
||||
private _totaly = 0;
|
||||
|
||||
{
|
||||
[_x] spawn building_defence_ai;
|
||||
_x setUnitPos 'UP';
|
||||
_spawned_units_local pushback _x;
|
||||
_totalx = _totalx + ((getpos _x) select 0);
|
||||
_totaly = _totaly + ((getpos _x) select 1);
|
||||
} forEach (units _grp);
|
||||
|
||||
private _avgx = _totalx / (count (units _grp));
|
||||
private _avgy = _totaly / (count (units _grp));
|
||||
|
||||
{
|
||||
private _vd = (getPosASL _x) vectorDiff [_avgx, _avgy, (getPosASL _x) select 2];
|
||||
private _newdir = (_vd select 0) atan2 (_vd select 1);
|
||||
if (_newdir < 0) then {_dir = 360 + _newdir};
|
||||
_x setdir (_newdir);
|
||||
} forEach (units _grp);
|
||||
|
||||
};
|
||||
|
||||
_spawned_units_local
|
|
@ -0,0 +1,32 @@
|
|||
/*
|
||||
File: fn_spawnMilitiaCrew.sqf
|
||||
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
|
||||
Date: 2019-12-03
|
||||
Last Update: 2019-12-03
|
||||
License: MIT License - http://www.opensource.org/licenses/MIT
|
||||
|
||||
Description:
|
||||
No description added yet.
|
||||
|
||||
Parameter(s):
|
||||
_localVariable - Description [DATATYPE, defaults to DEFAULTVALUE]
|
||||
|
||||
Returns:
|
||||
Function reached the end [BOOL]
|
||||
*/
|
||||
// TODO
|
||||
params ["_vehicle"];
|
||||
|
||||
private _grp = createGroup [GRLIB_side_enemy, true];
|
||||
private _vehcrew = [];
|
||||
while {count units _grp < 3} do {
|
||||
[selectRandom militia_squad, getPos _vehicle, _grp] call KPLIB_fnc_createManagedUnit;
|
||||
};
|
||||
((units _grp) select 0) moveInDriver _vehicle;
|
||||
((units _grp) select 1) moveInGunner _vehicle;
|
||||
((units _grp) select 2) moveInCommander _vehicle;
|
||||
{
|
||||
if (vehicle _x == _x) then {
|
||||
deleteVehicle _x;
|
||||
};
|
||||
} foreach (units _grp);
|
|
@ -0,0 +1,38 @@
|
|||
/*
|
||||
File: fn_spawnRegularSquad.sqf
|
||||
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
|
||||
Date: 2019-12-03
|
||||
Last Update: 2019-12-03
|
||||
License: MIT License - http://www.opensource.org/licenses/MIT
|
||||
|
||||
Description:
|
||||
No description added yet.
|
||||
|
||||
Parameter(s):
|
||||
_localVariable - Description [DATATYPE, defaults to DEFAULTVALUE]
|
||||
|
||||
Returns:
|
||||
Function reached the end [BOOL]
|
||||
*/
|
||||
// TODO
|
||||
params [ "_sector", "_squadies_to_spawn" ];
|
||||
|
||||
private _sectorpos = (getMarkerPos _sector) getPos [random 100, random 360];
|
||||
|
||||
private _spawnpos = zeropos;
|
||||
while {_spawnpos distance zeropos < 1000} do {
|
||||
_spawnpos = (_sectorpos getPos [random 50, random 360]) findEmptyPosition [5, 100, "B_Heli_Light_01_F"];
|
||||
if (count _spawnpos == 0) then {_spawnpos = zeropos;};
|
||||
};
|
||||
|
||||
private _corrected_amount = round ((count _squadies_to_spawn) * ([] call KPLIB_fnc_getOpforFactor));
|
||||
private _grp = createGroup [GRLIB_side_enemy, true];
|
||||
|
||||
{
|
||||
if ((count (units _grp)) < _corrected_amount) then {
|
||||
[_x, _spawnpos, _grp] call KPLIB_fnc_createManagedUnit;
|
||||
};
|
||||
sleep 0.1;
|
||||
} forEach _squadies_to_spawn;
|
||||
|
||||
_grp;
|
|
@ -0,0 +1,77 @@
|
|||
/*
|
||||
File: fn_spawnVehicle.sqf
|
||||
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
|
||||
Date: 2019-12-03
|
||||
Last Update: 2019-12-03
|
||||
License: MIT License - http://www.opensource.org/licenses/MIT
|
||||
|
||||
Description:
|
||||
No description added yet.
|
||||
|
||||
Parameter(s):
|
||||
_localVariable - Description [DATATYPE, defaults to DEFAULTVALUE]
|
||||
|
||||
Returns:
|
||||
Function reached the end [BOOL]
|
||||
*/
|
||||
// TODO
|
||||
params [
|
||||
"_sectorpos",
|
||||
"_classname",
|
||||
[ "_precise_position", false ],
|
||||
[ "_random_rotate", true ]
|
||||
];
|
||||
|
||||
private _newvehicle = objNull;
|
||||
private _spawnpos = zeropos;
|
||||
private _grp = grpNull;
|
||||
|
||||
if ( _precise_position ) then {
|
||||
_spawnpos = [] + _sectorpos;
|
||||
} else {
|
||||
while { _spawnpos distance zeropos < 1000 } do {
|
||||
_spawnpos = (_sectorpos getPos [random 150, random 360]) findEmptyPosition [10, 100, 'B_Heli_Transport_01_F'];
|
||||
if ( count _spawnpos == 0 ) then { _spawnpos = zeropos; };
|
||||
};
|
||||
};
|
||||
|
||||
_newvehicle = objNull;
|
||||
if ( _classname in opfor_choppers ) then {
|
||||
_newvehicle = createVehicle [_classname, _spawnpos, [], 0, 'FLY'];
|
||||
_newvehicle flyInHeight (100 + (random 200));
|
||||
} else {
|
||||
_newvehicle = _classname createVehicle _spawnpos;
|
||||
[_newvehicle] call KPLIB_fnc_allowCrewInImmobile;
|
||||
_newvehicle setpos _spawnpos;
|
||||
};
|
||||
_newvehicle allowdamage false;
|
||||
|
||||
if(KP_liberation_clear_cargo) then {
|
||||
clearWeaponCargoGlobal _newvehicle;
|
||||
clearMagazineCargoGlobal _newvehicle;
|
||||
clearItemCargoGlobal _newvehicle;
|
||||
clearBackpackCargoGlobal _newvehicle;
|
||||
};
|
||||
|
||||
if ( _classname in militia_vehicles ) then {
|
||||
[ _newvehicle ] call KPLIB_fnc_spawnMilitiaCrew;
|
||||
} else {
|
||||
_grp = createGroup [GRLIB_side_enemy, true];
|
||||
createVehicleCrew _newvehicle;
|
||||
(crew _newvehicle) joinSilent _grp;
|
||||
|
||||
sleep 0.1;
|
||||
{ _x addMPEventHandler ['MPKilled', {_this spawn kill_manager}]; } foreach (crew _newvehicle);
|
||||
};
|
||||
|
||||
_newvehicle addMPEventHandler ['MPKilled', {_this spawn kill_manager}];
|
||||
if ( _random_rotate ) then {
|
||||
_newvehicle setdir (random 360);
|
||||
};
|
||||
_newvehicle setVectorUp surfaceNormal position _newvehicle;
|
||||
|
||||
sleep 0.1;
|
||||
_newvehicle allowdamage true;
|
||||
_newvehicle setdamage 0;
|
||||
|
||||
_newvehicle
|
|
@ -0,0 +1,22 @@
|
|||
/*
|
||||
File: fn_swapInventory.sqf
|
||||
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
|
||||
Date: 2019-12-03
|
||||
Last Update: 2019-12-03
|
||||
License: MIT License - http://www.opensource.org/licenses/MIT
|
||||
|
||||
Description:
|
||||
No description added yet.
|
||||
|
||||
Parameter(s):
|
||||
_localVariable - Description [DATATYPE, defaults to DEFAULTVALUE]
|
||||
|
||||
Returns:
|
||||
Function reached the end [BOOL]
|
||||
*/
|
||||
// TODO
|
||||
params [ "_unit1", "_unit2" ];
|
||||
private [ "_loadout" ];
|
||||
|
||||
_loadout = [_unit1, ["repetitive"]] call KPLIB_fnc_getLoadout;
|
||||
[ _unit2, _loadout ] call KPLIB_fnc_setLoadout;
|
|
@ -2,7 +2,6 @@ enableSaving [ false, false ];
|
|||
|
||||
if (isDedicated) then {debug_source = "Server";} else {debug_source = name player;};
|
||||
|
||||
[] call compileFinal preprocessFileLineNumbers "scripts\shared\liberation_functions.sqf";
|
||||
[] call compileFinal preprocessFileLineNumbers "scripts\shared\init_sectors.sqf";
|
||||
if (!isServer) then {waitUntil {!isNil "KP_serverParamsFetched"};};
|
||||
[] call compileFinal preprocessFileLineNumbers "scripts\shared\fetch_params.sqf";
|
||||
|
|
|
@ -20,7 +20,7 @@ KPLIB_objectInits = [
|
|||
[["Helipad_base_F", "LAND_uns_Heli_pad", "Helipad", "LAND_uns_evac_pad", "LAND_uns_Heli_H"], {{[_x, [[_this], true]] remoteExecCall ["addCuratorEditableObjects", 2]} forEach allCurators;}, true],
|
||||
|
||||
// Add ViV action to FOB box
|
||||
[[FOB_box_typename], {_this call F_setFobMass; [_this] remoteExecCall ["F_setLoadableViV", 0, _this];}],
|
||||
[[FOB_box_typename], {[_this] call KPLIB_fnc_setFobMass; [_this] remoteExecCall ["KPLIB_fnc_setLoadableViV", 0, _this];}],
|
||||
|
||||
// Add storage type variable to built storage areas (only for FOB built/loaded ones)
|
||||
[[KP_liberation_small_storage_building, KP_liberation_large_storage_building], {_this setVariable ["KP_liberation_storage_type", 0, true];}],
|
||||
|
|
|
@ -12,5 +12,5 @@ if ( isNil "GRLIB_respawn_loadout" ) then {
|
|||
player linkItem "ItemRadio";
|
||||
} else {
|
||||
sleep 4;
|
||||
[ player, GRLIB_respawn_loadout ] call F_setLoadout;
|
||||
[ player, GRLIB_respawn_loadout ] call KPLIB_fnc_setLoadout;
|
||||
};
|
||||
|
|
|
@ -197,7 +197,7 @@ all_hostile_classnames = (land_vehicles_classnames + opfor_air + opfor_choppers
|
|||
air_vehicles_classnames = [] + opfor_choppers;
|
||||
KP_liberation_friendly_air_classnames = [];
|
||||
{air_vehicles_classnames pushback (_x select 0); KP_liberation_friendly_air_classnames pushback (_x select 0);} foreach air_vehicles;
|
||||
KP_liberation_friendly_air_classnames = KP_liberation_friendly_air_classnames select {!(_x call F_isClassUAV)};
|
||||
KP_liberation_friendly_air_classnames = KP_liberation_friendly_air_classnames select {!(_x call KPLIB_fnc_isClassUAV)};
|
||||
KP_liberation_static_classnames = [];
|
||||
{KP_liberation_static_classnames pushback (_x select 0);} forEach static_vehicles;
|
||||
ai_resupply_sources = ai_resupply_sources + [Respawn_truck_typename, huron_typename, Arsenal_typename];
|
||||
|
|
|
@ -33,17 +33,17 @@ waitUntil {!isNil "one_eco_done"};
|
|||
waitUntil {one_synchro_done};
|
||||
waitUntil {one_eco_done};
|
||||
|
||||
private _nearfob = [] call F_getNearestFob;
|
||||
private _nearfob = [] call KPLIB_fnc_getNearestFob;
|
||||
private _fobdistance = 9999;
|
||||
private _nearest_sector = [GRLIB_fob_range] call F_getNearestSector;
|
||||
private _nearest_sector = [GRLIB_fob_range] call KPLIB_fnc_getNearestSector;
|
||||
private _prod_sector = [];
|
||||
private _directAccess = (getPlayerUID player) in KP_liberation_commander_actions || {player == ([] call KPLIB_fnc_getCommander)} || {[] call F_isAdmin};
|
||||
private _directAccess = (getPlayerUID player) in KP_liberation_commander_actions || {player == ([] call KPLIB_fnc_getCommander)} || {[] call KPLIB_fnc_isAdmin};
|
||||
|
||||
while {true} do {
|
||||
|
||||
_nearfob = [] call F_getNearestFob;
|
||||
_nearfob = [] call KPLIB_fnc_getNearestFob;
|
||||
_fobdistance = 9999;
|
||||
_nearest_sector = [GRLIB_fob_range] call F_getNearestSector;
|
||||
_nearest_sector = [GRLIB_fob_range] call KPLIB_fnc_getNearestSector;
|
||||
_prod_sector = [];
|
||||
|
||||
{
|
||||
|
@ -295,7 +295,7 @@ while {true} do {
|
|||
if (_idact_clearance == -1) then {
|
||||
_idact_clearance = player addAction [
|
||||
"<t color='#FFFF00'>" + localize "STR_CLEARANCE_ACTION" + "</t>",
|
||||
{[_this select 3 select 0, _this select 3 select 1, true] remoteExecCall ["F_createClearance", 2];},
|
||||
{[_this select 3 select 0, _this select 3 select 1, true] remoteExecCall ["KPLIB_fnc_createClearance", 2];},
|
||||
[_nearFob, GRLIB_fob_range * 0.9], -1003, false, true, "", "build_confirmed == 0"
|
||||
];
|
||||
};
|
||||
|
|
|
@ -84,7 +84,7 @@ if (_vehtorecycle getVariable ["KP_liberation_preplaced", false]) exitWith {hint
|
|||
|
||||
if ( dorecycle == 1 && !(isnull _vehtorecycle) && alive _vehtorecycle) then {
|
||||
|
||||
_nearfob = [] call F_getNearestFob;
|
||||
_nearfob = [] call KPLIB_fnc_getNearestFob;
|
||||
|
||||
if (!(KP_liberation_recycle_building_near) && ((_price_s + _price_a + _price_f) > 0)) exitWith {hint localize "STR_NORECBUILDING_ERROR";};
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ if ( dorepackage > 0 ) then {
|
|||
closeDialog 0;
|
||||
waitUntil { !dialog };
|
||||
|
||||
_fob = [] call F_getNearestFob;
|
||||
_fob = [] call KPLIB_fnc_getNearestFob;
|
||||
|
||||
if (count _fob > 0) then {
|
||||
GRLIB_all_fobs = GRLIB_all_fobs - [_fob];
|
||||
|
@ -34,9 +34,9 @@ if ( dorepackage > 0 ) then {
|
|||
|
||||
if ( dorepackage == 1 ) then {
|
||||
_fobbox = FOB_box_typename createVehicle _spawnpos;
|
||||
_fobbox call F_setFobMass;
|
||||
[_fobbox] call KPLIB_fnc_setFobMass;
|
||||
// Add ViV actions to FOB Box
|
||||
[_fobBox] remoteExecCall ["F_setLoadableViV", 0, _fobBox];
|
||||
[_fobBox] remoteExecCall ["KPLIB_fnc_setLoadableViV", 0, _fobBox];
|
||||
};
|
||||
|
||||
if ( dorepackage == 2 ) then {
|
||||
|
|
|
@ -81,7 +81,7 @@ while { dialog && (alive player) && edit_loadout == 0 } do {
|
|||
};
|
||||
|
||||
if (KP_liberation_arsenalUsePreset) then {
|
||||
if ([_backpack] call F_checkGear) then {
|
||||
if ([_backpack] call KPLIB_fnc_checkGear) then {
|
||||
hint format [ localize "STR_HINT_LOADOUT_LOADED", _loaded_loadout param [0]];
|
||||
};
|
||||
} else {
|
||||
|
@ -103,7 +103,7 @@ while { dialog && (alive player) && edit_loadout == 0 } do {
|
|||
if ( load_from_player >= 0 ) then {
|
||||
private _playerselected = ( _loadplayers select load_from_player ) select 1;
|
||||
if ( alive _playerselected ) then {
|
||||
[player, [_playerselected, ["repetitive"]] call KPLIB_fnc_getLoadout] call F_setLoadout;
|
||||
[player, [_playerselected, ["repetitive"]] call KPLIB_fnc_getLoadout] call KPLIB_fnc_setLoadout;
|
||||
hint format [ localize "STR_LOAD_PLAYER_LOADOUT_HINT", name _playerselected ];
|
||||
};
|
||||
load_from_player = -1;
|
||||
|
@ -125,6 +125,6 @@ if ( edit_loadout > 0 ) then {
|
|||
uiSleep 5;
|
||||
private _arsenalDisplay = ["RSCDisplayArsenal", "ace_arsenal_display"] select (KP_liberation_ace && KP_liberation_arsenal_type);
|
||||
waitUntil {sleep 1; isNull (uinamespace getvariable [_arsenalDisplay, displayNull])};
|
||||
[_backpack] call F_checkGear;
|
||||
[_backpack] call KPLIB_fnc_checkGear;
|
||||
};
|
||||
};
|
||||
|
|
|
@ -19,7 +19,7 @@ waitUntil {sleep 1; !isNil "GRLIB_all_fobs"};
|
|||
|
||||
while {true} do {
|
||||
waitUntil {sleep 1; count GRLIB_all_fobs > 0};
|
||||
waitUntil {sleep 2; (player distance ([] call F_getNearestFob)) < GRLIB_fob_range};
|
||||
waitUntil {sleep 2; (player distance ([] call KPLIB_fnc_getNearestFob)) < GRLIB_fob_range};
|
||||
|
||||
if ([4] call KPLIB_fnc_hasPermission) then {
|
||||
private _detected_vehicles = (getPos player) nearObjects veh_action_detect_distance select {
|
||||
|
@ -36,7 +36,7 @@ while {true} do {
|
|||
|| ((typeOf _x) == "rhsusf_mkvsoc")
|
||||
) &&
|
||||
(_x distance startbase > 1000) &&
|
||||
(_x distance ( [] call F_getNearestFob) < GRLIB_fob_range) &&
|
||||
(_x distance ( [] call KPLIB_fnc_getNearestFob) < GRLIB_fob_range) &&
|
||||
(getObjectType _x >= 8)
|
||||
};
|
||||
|
||||
|
|
|
@ -54,8 +54,8 @@ while {true} do {
|
|||
_next_box = _x;
|
||||
if (!(_next_box in _managed_boxes) && ( isNull attachedTo _next_box )) then {
|
||||
_b_action_id1 = _next_box addAction ["<t color='#FFFF00'>" + localize "STR_ACTION_LOAD_BOX" + "</t>","scripts\client\ammoboxes\do_load_box_action.sqf","",-501,true,true,"","build_confirmed == 0 && (_this distance _target < 5) && (vehicle player == player)"];
|
||||
_b_action_id2 = _next_box addAction ["<t color='#FFFF00'>" + localize "STR_ACTION_STORE_CRATE" + "</t>",{[(_this select 0), (nearestObjects [player,KP_liberation_storage_buildings,20]) select 0,true] call F_crateToStorage;},"",-502,true,true,"","build_confirmed == 0 && (_this distance _target < 5) && (vehicle player == player)"];
|
||||
_b_action_id3 = _next_box addAction ["<t color='#FFFF00'>" + localize "STR_ACTION_CRATE_VALUE" + "</t>",{[_this select 0] call F_crateCheckValue;uiSleep 3; hint "";},"",-503,true,true,"","build_confirmed == 0 && (_this distance _target < 5) && (vehicle player == player)"];
|
||||
_b_action_id2 = _next_box addAction ["<t color='#FFFF00'>" + localize "STR_ACTION_STORE_CRATE" + "</t>",{[(_this select 0), (nearestObjects [player,KP_liberation_storage_buildings,20]) select 0,true] call KPLIB_fnc_crateToStorage;},"",-502,true,true,"","build_confirmed == 0 && (_this distance _target < 5) && (vehicle player == player)"];
|
||||
_b_action_id3 = _next_box addAction ["<t color='#FFFF00'>" + localize "STR_ACTION_CRATE_VALUE" + "</t>",{[_this select 0] call KPLIB_fnc_checkCrateValue;uiSleep 3; hint "";},"",-503,true,true,"","build_confirmed == 0 && (_this distance _target < 5) && (vehicle player == player)"];
|
||||
_b_action_id4 = _next_box addAction ["<t color='#FFFF00'>" + localize "STR_ACTION_CRATE_PUSH" + "</t>",{(_this select 0) setPos ((_this select 0) getPos [1, (player getDir (_this select 0))]);},"",-504,true,false,"","build_confirmed == 0 && (_this distance _target < 5) && (vehicle player == player)"];
|
||||
_next_box setVariable ["GRLIB_ammo_box_action", _b_action_id1, false];
|
||||
_next_box setVariable ["KP_crate_store_action", _b_action_id2, false];
|
||||
|
@ -85,13 +85,13 @@ while {true} do {
|
|||
_area_load = count (attachedObjects _x);
|
||||
|
||||
if (!(_next_area in _managed_areas) && (_area_load > 0)) then {
|
||||
_action_id = _next_area addAction ["<t color='#FFFF00'>" + localize "STR_ACTION_UNSTORE_SUPPLY" + "</t>",{[KP_liberation_supply_crate, (_this select 0), true] spawn F_crateFromStorage;},"",-504,true,true,"","build_confirmed == 0 && (_this distance _target < 12) && (vehicle player == player)"];
|
||||
_action_id = _next_area addAction ["<t color='#FFFF00'>" + localize "STR_ACTION_UNSTORE_SUPPLY" + "</t>",{[KP_liberation_supply_crate, (_this select 0), true] spawn KPLIB_fnc_crateFromStorage;},"",-504,true,true,"","build_confirmed == 0 && (_this distance _target < 12) && (vehicle player == player)"];
|
||||
_next_area setVariable ["KP_supply_unstore_action", _action_id, false];
|
||||
_action_id2 = _next_area addAction ["<t color='#FFFF00'>" + localize "STR_ACTION_UNSTORE_AMMO" + "</t>",{[KP_liberation_ammo_crate, (_this select 0), true] spawn F_crateFromStorage;},"",-505,true,true,"","build_confirmed == 0 && (_this distance _target < 12) && (vehicle player == player)"];
|
||||
_action_id2 = _next_area addAction ["<t color='#FFFF00'>" + localize "STR_ACTION_UNSTORE_AMMO" + "</t>",{[KP_liberation_ammo_crate, (_this select 0), true] spawn KPLIB_fnc_crateFromStorage;},"",-505,true,true,"","build_confirmed == 0 && (_this distance _target < 12) && (vehicle player == player)"];
|
||||
_next_area setVariable ["KP_ammo_unstore_action", _action_id2, false];
|
||||
_action_id3 = _next_area addAction ["<t color='#FFFF00'>" + localize "STR_ACTION_UNSTORE_FUEL" + "</t>",{[KP_liberation_fuel_crate, (_this select 0), true] spawn F_crateFromStorage;},"",-506,true,true,"","build_confirmed == 0 && (_this distance _target < 12) && (vehicle player == player)"];
|
||||
_action_id3 = _next_area addAction ["<t color='#FFFF00'>" + localize "STR_ACTION_UNSTORE_FUEL" + "</t>",{[KP_liberation_fuel_crate, (_this select 0), true] spawn KPLIB_fnc_crateFromStorage;},"",-506,true,true,"","build_confirmed == 0 && (_this distance _target < 12) && (vehicle player == player)"];
|
||||
_next_area setVariable ["KP_fuel_unstore_action", _action_id3, false];
|
||||
_action_id4 = _next_area addAction ["<t color='#FFFF00'>" + localize "STR_ACTION_SORT_STORAGE" + "</t>",{[(_this select 0)] spawn F_sortStorage;},"",-507,true,true,"","build_confirmed == 0 && (_this distance _target < 12) && (vehicle player == player)"];
|
||||
_action_id4 = _next_area addAction ["<t color='#FFFF00'>" + localize "STR_ACTION_SORT_STORAGE" + "</t>",{[(_this select 0)] spawn KPLIB_fnc_sortStorage;},"",-507,true,true,"","build_confirmed == 0 && (_this distance _target < 12) && (vehicle player == player)"];
|
||||
_next_area setVariable ["KP_storage_sort_action", _action_id4, false];
|
||||
_managed_areas pushback _next_area;
|
||||
};
|
||||
|
|
|
@ -9,11 +9,11 @@ _offset = 0;
|
|||
|
||||
if ( _truck_to_unload getVariable ["GRLIB_ammo_truck_load", 0] > 0 ) then {
|
||||
_truck_to_unload setVariable ["GRLIB_ammo_truck_load", 0, true];
|
||||
[_truck_to_unload, false] remoteExec ["F_objectProtection"];
|
||||
[_truck_to_unload, false] remoteExec ["KPLIB_fnc_protectObject"];
|
||||
|
||||
{
|
||||
_next_box = _x;
|
||||
[_next_box, false] remoteExec ["F_objectProtection"];
|
||||
[_next_box, false] remoteExec ["KPLIB_fnc_protectObject"];
|
||||
sleep 0.5;
|
||||
detach _next_box;
|
||||
_next_box setpos (_truck_to_unload getpos [_offset, getdir _truck_to_unload]);
|
||||
|
@ -22,15 +22,15 @@ if ( _truck_to_unload getVariable ["GRLIB_ammo_truck_load", 0] > 0 ) then {
|
|||
_next_box setDamage 0;
|
||||
_offset = _offset - 2.2;
|
||||
sleep 0.5;
|
||||
[_next_box, true] remoteExec ["F_objectProtection"];
|
||||
[_next_box, true] remoteExec ["KPLIB_fnc_protectObject"];
|
||||
[_next_box, true] remoteExec ["enableRopeAttach"];
|
||||
} foreach ( attachedObjects _truck_to_unload);
|
||||
|
||||
sleep 0.5;
|
||||
|
||||
[_truck_to_unload, true] remoteExec ["F_objectProtection"];
|
||||
[_truck_to_unload, true] remoteExec ["KPLIB_fnc_protectObject"];
|
||||
|
||||
hint localize "STR_BOX_UNLOADED";
|
||||
uiSleep 2;
|
||||
hint "";
|
||||
};
|
||||
};
|
||||
|
|
|
@ -6,7 +6,7 @@ if (KP_liberation_asymmetric_debug > 0) then {private _text = format ["[KP LIBER
|
|||
|
||||
switch (_notif_id) do {
|
||||
case 0: {
|
||||
["lib_asymm_convoy_ambush", [markertext ([10000, _pos] call F_getNearestSector)]] call BIS_fnc_showNotification;
|
||||
["lib_asymm_convoy_ambush", [markertext ([10000, _pos] call KPLIB_fnc_getNearestSector)]] call BIS_fnc_showNotification;
|
||||
private _ambush_marker = createMarkerLocal ["asymm_ambushmarker", _pos];
|
||||
_ambush_marker setMarkerDirLocal (random 360);
|
||||
_ambush_marker setMarkerColorLocal "ColorIndependent";
|
||||
|
|
|
@ -19,7 +19,7 @@ sleep 2;
|
|||
[_informant] remoteExec ["remote_call_switchmove"];
|
||||
|
||||
waitUntil {sleep 5;
|
||||
_nearestfob = [getpos _informant] call F_getNearestFob;
|
||||
_nearestfob = [getpos _informant] call KPLIB_fnc_getNearestFob;
|
||||
if (count _nearestfob == 3) then {
|
||||
if ((_informant distance _nearestfob) < 30) then {
|
||||
_is_near_fob = true;
|
||||
|
|
|
@ -6,7 +6,7 @@ if (KP_liberation_civinfo_debug > 0) then {private _text = format ["[KP LIBERATI
|
|||
|
||||
switch (_notif_id) do {
|
||||
case 0: {
|
||||
["lib_civ_informant_start", [markertext ([10000, _pos] call F_getNearestSector)]] call BIS_fnc_showNotification;
|
||||
["lib_civ_informant_start", [markertext ([10000, _pos] call KPLIB_fnc_getNearestSector)]] call BIS_fnc_showNotification;
|
||||
private _informant_marker = createMarkerLocal ["informantmarker", _pos];
|
||||
_informant_marker setMarkerColorLocal "ColorCIV";
|
||||
_informant_marker setMarkerShape "ELLIPSE";
|
||||
|
@ -26,7 +26,7 @@ switch (_notif_id) do {
|
|||
deleteMarkerLocal "informantmarker";
|
||||
};
|
||||
case 4: {
|
||||
["lib_civ_hvt_start", [markertext ([10000, _pos] call F_getNearestSector)]] call BIS_fnc_showNotification;
|
||||
["lib_civ_hvt_start", [markertext ([10000, _pos] call KPLIB_fnc_getNearestSector)]] call BIS_fnc_showNotification;
|
||||
private _marker = createMarker ["HVT_marker", _pos];
|
||||
_marker setMarkerColor GRLIB_color_enemy_bright;
|
||||
_marker setMarkerType "hd_unknown";
|
||||
|
|
|
@ -8,7 +8,7 @@ if (isNil "KP_liberation_cr_vehicles") then {
|
|||
|
||||
if (((typeOf _vehicle) in civilian_vehicles) && !(_vehicle in KP_liberation_cr_vehicles)) then {
|
||||
if (KP_liberation_civrep_debug > 0) then {private _text = format ["[KP LIBERATION] [CIVREP] Vehicle was stolen by: %1", debug_source];_text remoteExec ["diag_log",2];};
|
||||
[0] remoteExec ["F_cr_globalMsg"];
|
||||
[0] remoteExec ["KPLIB_fnc_crGlobalMsg"];
|
||||
[KP_liberation_cr_vehicle_penalty, true] remoteExec ["F_cr_changeCR", 2];
|
||||
|
||||
KP_liberation_cr_vehicles pushBack _vehicle;
|
||||
|
|
|
@ -9,7 +9,7 @@ sleep 1;
|
|||
|
||||
_commanderobj = [] call KPLIB_fnc_getCommander;
|
||||
if ( !isNull _commanderobj ) then {
|
||||
if ( player == _commanderobj && !([] call F_isAdmin)) then {
|
||||
if ( player == _commanderobj && !([] call KPLIB_fnc_isAdmin)) then {
|
||||
|
||||
_tagmatch = false;
|
||||
_idmatch = false;
|
||||
|
|
|
@ -9,7 +9,7 @@ _detailControls = [
|
|||
758019,758020,758021,758022,758023,758024,758025,758026,758027,758028,758029,758030,758031,
|
||||
758032,758080,758081
|
||||
];
|
||||
_nearfob = [] call F_getNearestFob;
|
||||
_nearfob = [] call KPLIB_fnc_getNearestFob;
|
||||
_logi_destinations = [];
|
||||
|
||||
{
|
||||
|
@ -128,9 +128,9 @@ while {dialog && (alive player)} do {
|
|||
ctrlEnable [758021, true];
|
||||
|
||||
if ((_selectedGroup select 1) <= 0) then {
|
||||
ctrlEnable [75804, true];
|
||||
ctrlEnable [75804, true];
|
||||
} else {
|
||||
ctrlEnable [758022, true];
|
||||
ctrlEnable [758022, true];
|
||||
ctrlEnable [758024, true];
|
||||
ctrlEnable [758025, true];
|
||||
ctrlEnable [758026, true];
|
||||
|
@ -163,7 +163,7 @@ while {dialog && (alive player)} do {
|
|||
default {ctrlSetText[75809,(format [localize "STR_PRODUCTION_MINUTES",(_selectedGroup select 8)])];};
|
||||
};
|
||||
} else {
|
||||
ctrlSetText[75809, "-"];
|
||||
ctrlSetText[75809, "-"];
|
||||
};
|
||||
|
||||
ctrlSetText [758014, (str (_selectedGroup select 1))];
|
||||
|
@ -187,7 +187,7 @@ while {dialog && (alive player)} do {
|
|||
} forEach _logi_destinations;
|
||||
} else {
|
||||
ctrlShow [758024,true];
|
||||
ctrlShow [758033,false];
|
||||
ctrlShow [758033,false];
|
||||
};
|
||||
|
||||
if (!((_selectedGroup select 3) isEqualTo [0,0,0])) then {
|
||||
|
@ -198,7 +198,7 @@ while {dialog && (alive player)} do {
|
|||
} forEach _logi_destinations;
|
||||
} else {
|
||||
ctrlShow [758029,true];
|
||||
ctrlShow [758034,false];
|
||||
ctrlShow [758034,false];
|
||||
};
|
||||
|
||||
ctrlSetText [758025, (str ((_selectedGroup select 4) select 0))];
|
||||
|
|
|
@ -10,13 +10,13 @@ while {true} do {
|
|||
{deleteMarkerLocal _x;} forEach _kp_markers_array;
|
||||
_kp_markers_array = [];
|
||||
{
|
||||
if ((side _x == GRLIB_side_enemy) && (({!captive _x} count (units _x) ) > 0) && ([(getpos leader _x), GRLIB_side_friendly, GRLIB_radiotower_size] call F_getNearestTower != "")) then {
|
||||
if ((side _x == GRLIB_side_enemy) && (({!captive _x} count (units _x) ) > 0) && ([(getpos leader _x), GRLIB_side_friendly, GRLIB_radiotower_size] call KPLIB_fnc_getNearestTower != "")) then {
|
||||
_kp_markers_pos = getPosATL leader _x;
|
||||
_kp_markers_posx = floor (_kp_markers_pos select 0);
|
||||
_kp_markers_posx = _kp_markers_posx - (_kp_markers_posx mod 500);
|
||||
_kp_markers_posy = floor (_kp_markers_pos select 1);
|
||||
_kp_markers_posy = _kp_markers_posy - (_kp_markers_posy mod 500);
|
||||
|
||||
|
||||
// Chernarus Grid Fix
|
||||
if (worldName == "Chernarus") then {
|
||||
_kp_markers_posy = _kp_markers_posy - 140;
|
||||
|
@ -24,7 +24,7 @@ while {true} do {
|
|||
_kp_markers_posy = _kp_markers_posy + 500;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
// Sahrani Grid Fix
|
||||
if (worldName == "Sara") then {
|
||||
_kp_markers_posy = _kp_markers_posy - 20;
|
||||
|
@ -32,7 +32,7 @@ while {true} do {
|
|||
_kp_markers_posy = _kp_markers_posy + 500;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
_kp_markers_name = format["kp_marker_grid_%1_%2", _kp_markers_posx, _kp_markers_posy];
|
||||
_kp_markers_color = format["Color%1", side _x];
|
||||
|
||||
|
@ -49,4 +49,4 @@ while {true} do {
|
|||
};
|
||||
} forEach allGroups;
|
||||
uiSleep (60 + (random 60));
|
||||
};
|
||||
};
|
||||
|
|
|
@ -3,7 +3,7 @@ private [ "_huronlocal" ];
|
|||
"huronmarker" setMarkerTextLocal "Potato 01";
|
||||
|
||||
while { true } do {
|
||||
_huronlocal = [] call F_spartanScan;
|
||||
_huronlocal = [] call KPLIB_fnc_potatoScan;
|
||||
if ( !( isNull _huronlocal) ) then {
|
||||
"huronmarker" setmarkerposlocal (getpos _huronlocal);
|
||||
} else {
|
||||
|
|
|
@ -11,7 +11,7 @@ if ( isNil "sector_timer" ) then { sector_timer = 0 };
|
|||
while { true } do {
|
||||
sleep 1;
|
||||
if ( sector_timer > 0 ) then {
|
||||
"opfor_capture_marker" setMarkerTextLocal format ["%1",([sector_timer] call F_secondsToTimer)];
|
||||
"opfor_capture_marker" setMarkerTextLocal format ["%1",([sector_timer] call KPLIB_fnc_secondsToTimer)];
|
||||
sector_timer = sector_timer - 1;
|
||||
} else {
|
||||
"opfor_capture_marker" setMarkerTextLocal "VULNERABLE";
|
||||
|
@ -20,4 +20,4 @@ while { true } do {
|
|||
sector_timer > 0
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
if (KP_liberation_arsenalUsePreset) then {
|
||||
private ["_virtualCargo", "_virtualWeapons", "_virtualMagazines", "_virtualItems", "_virtualBackpacks"];
|
||||
_virtualCargo = [] call LARs_fnc_addAllVirtualCargo;
|
||||
_virtualCargo = [] call KPLIB_fnc_getVirtualCargo;
|
||||
_virtualWeapons = [];
|
||||
_virtualMagazines = [];
|
||||
_virtualItems = [];
|
||||
|
|
|
@ -36,14 +36,14 @@ while { true } do {
|
|||
_rearmed = true;
|
||||
_rearm_ticker = _rearm_ticker + 1;
|
||||
if ( _rearm_ticker >= _rearm_time ) then {
|
||||
[_veh] remoteExec ["F_rearmVehicle",_veh];
|
||||
[_veh] remoteExec ["KPLIB_fnc_rearmVehicle",_veh];
|
||||
};
|
||||
};
|
||||
|
||||
if ( count ( (getpos _veh) nearEntities [ vehicle_refuel_sources , _resupply_dist] ) > 0 ) then {
|
||||
if ( fuel _veh < ( 1 - _refuel_amount ) ) then {
|
||||
_refueled = true;
|
||||
[_veh, (fuel _veh + _refuel_amount)] remoteExec ["F_setFuel",_veh];
|
||||
[_veh, (fuel _veh + _refuel_amount)] remoteExec ["KPLIB_fnc_setFuel",_veh];
|
||||
};
|
||||
};
|
||||
} else {
|
||||
|
@ -77,4 +77,4 @@ while { true } do {
|
|||
titleText [ _screenmsg, "PLAIN DOWN" ];
|
||||
|
||||
sleep 1;
|
||||
};
|
||||
};
|
||||
|
|
|
@ -3,8 +3,8 @@ if ( isDedicated ) exitWith {};
|
|||
params [ "_battlegroup_position" ];
|
||||
|
||||
"opfor_bg_marker" setMarkerPosLocal ( getMarkerPos _battlegroup_position );
|
||||
[ "lib_battlegroup", [ markerText ( [ 10000, getMarkerPos _battlegroup_position ] call F_getNearestSector ) ] ] call BIS_fnc_showNotification;
|
||||
[ "lib_battlegroup", [ markerText ( [ 10000, getMarkerPos _battlegroup_position ] call KPLIB_fnc_getNearestSector ) ] ] call BIS_fnc_showNotification;
|
||||
|
||||
sleep 600;
|
||||
|
||||
"opfor_bg_marker" setMarkerPosLocal markers_reset;
|
||||
"opfor_bg_marker" setMarkerPosLocal markers_reset;
|
||||
|
|
|
@ -9,7 +9,7 @@ switch (_notiftype) do {
|
|||
waitUntil {!isNil "secondary_objective_position_marker"};
|
||||
waitUntil {count secondary_objective_position_marker > 0};
|
||||
waitUntil {secondary_objective_position_marker distance zeropos > 1000};
|
||||
["lib_intel_fob", [markertext ([10000, secondary_objective_position_marker] call F_getNearestSector)]] call BIS_fnc_showNotification;
|
||||
["lib_intel_fob", [markertext ([10000, secondary_objective_position_marker] call KPLIB_fnc_getNearestSector)]] call BIS_fnc_showNotification;
|
||||
_secondary_marker = createMarkerLocal ["secondarymarker", secondary_objective_position_marker];
|
||||
_secondary_marker setMarkerColorLocal GRLIB_color_enemy_bright;
|
||||
_secondary_marker setMarkerTypeLocal "hd_unknown";
|
||||
|
@ -26,13 +26,13 @@ switch (_notiftype) do {
|
|||
deleteMarkerLocal "secondarymarkerzone";
|
||||
secondary_objective_position_marker = [];
|
||||
};
|
||||
case 4: {["lib_intel_convoy", [markertext ([10000, _obj_position] call F_getNearestSector)]] call BIS_fnc_showNotification;};
|
||||
case 4: {["lib_intel_convoy", [markertext ([10000, _obj_position] call KPLIB_fnc_getNearestSector)]] call BIS_fnc_showNotification;};
|
||||
case 5: {["lib_secondary_convoy_destroyed"] call BIS_fnc_showNotification;};
|
||||
case 6: {
|
||||
waitUntil {!isNil "secondary_objective_position_marker"};
|
||||
waitUntil {count secondary_objective_position_marker > 0};
|
||||
waitUntil {secondary_objective_position_marker distance zeropos > 1000};
|
||||
["lib_intel_sar", [markertext ([10000, secondary_objective_position_marker] call F_getNearestSector)]] call BIS_fnc_showNotification;
|
||||
["lib_intel_sar", [markertext ([10000, secondary_objective_position_marker] call KPLIB_fnc_getNearestSector)]] call BIS_fnc_showNotification;
|
||||
_secondary_marker = createMarkerLocal ["secondarymarker", secondary_objective_position_marker];
|
||||
_secondary_marker setMarkerColorLocal GRLIB_color_enemy_bright;
|
||||
_secondary_marker setMarkerTypeLocal "hd_unknown";
|
||||
|
|
|
@ -21,7 +21,7 @@ if ( typeof _unit == pilot_classname ) exitWith {};
|
|||
|
||||
waitUntil { sleep 5;
|
||||
|
||||
_nearestfob = [ getpos _unit ] call F_getNearestFob;
|
||||
_nearestfob = [ getpos _unit ] call KPLIB_fnc_getNearestFob;
|
||||
if ( count _nearestfob == 3) then {
|
||||
if ( ( _unit distance _nearestfob ) < 30 ) then {
|
||||
_is_near_fob = true;
|
||||
|
|
|
@ -198,7 +198,7 @@ while {true} do {
|
|||
};
|
||||
|
||||
if (KP_liberation_arsenalUsePreset) then {
|
||||
[_backpack] call F_checkGear;
|
||||
[_backpack] call KPLIB_fnc_checkGear;
|
||||
};
|
||||
|
||||
if (KP_liberation_mobilerespawn && (KP_liberation_respawn_time > time)) then {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
private [ "_nearest_sector", "_leadingzero_hour", "_leadingzero_minute", "_startpos0", "_startpos1", "_endpos1", "_startpos2", "_endpos2", "_startpos3", "_endpos3", "_spawn_camera", "_datestring" ];
|
||||
params [ "_spawn_str" ];
|
||||
|
||||
_nearest_sector = [2000] call F_getNearestSector;
|
||||
_nearest_sector = [2000] call KPLIB_fnc_getNearestSector;
|
||||
if ( _nearest_sector != "" ) then { _nearest_sector = format ["%1 %2",localize "STR_SPAWN_NEAR", markertext _nearest_sector]; };
|
||||
_leadingzero_hour = "";
|
||||
_leadingzero_minute = "";
|
||||
|
@ -74,4 +74,4 @@ if ( GRLIB_deployment_cinematic ) then {
|
|||
_spawn_camera cameraEffect ["Terminate","back"];
|
||||
camDestroy _spawn_camera;
|
||||
camUseNVG false;
|
||||
};
|
||||
};
|
||||
|
|
|
@ -252,7 +252,7 @@ while { cinematic_camera_started } do {
|
|||
if ( _position distance startbase < 300 ) then {
|
||||
_nearest_sector = "BEGIN OF OPERATION";
|
||||
} else {
|
||||
_nearest_sector = [300, _position ] call F_getNearestSector;
|
||||
_nearest_sector = [300, _position ] call KPLIB_fnc_getNearestSector;
|
||||
if ( _nearest_sector != "" ) then {
|
||||
_nearest_sector = markertext _nearest_sector;
|
||||
} else {
|
||||
|
|
|
@ -33,7 +33,7 @@ while { dialog && alive player } do {
|
|||
lbClear 101;
|
||||
{
|
||||
if ( alive _x ) then {
|
||||
_unitname = format ["%1. ", [ _x ] call F_getUnitPositionId];
|
||||
_unitname = format ["%1. ", [ _x ] call KPLIB_fnc_getUnitPositionId];
|
||||
if(isPlayer _x) then {
|
||||
if ( count (squadParams _x ) != 0) then {
|
||||
_unitname = "[" + ((squadParams _x select 0) select 0) + "] ";
|
||||
|
@ -78,7 +78,7 @@ while { dialog && alive player } do {
|
|||
};
|
||||
_squad_camera camcommit 0;
|
||||
|
||||
_unitname = format ["%1. ", [ _selectedmember ] call F_getUnitPositionId];
|
||||
_unitname = format ["%1. ", [ _selectedmember ] call KPLIB_fnc_getUnitPositionId];
|
||||
if(isPlayer _selectedmember) then {
|
||||
if ( count (squadParams _selectedmember ) != 0) then {
|
||||
_unitname = "[" + ((squadParams _selectedmember select 0) select 0) + "] ";
|
||||
|
@ -176,7 +176,7 @@ while { dialog && alive player } do {
|
|||
|
||||
if ( GRLIB_squadaction == 1 ) then {
|
||||
|
||||
_nearfob = [ getpos _selectedmember ] call F_getNearestFob;
|
||||
_nearfob = [ getpos _selectedmember ] call KPLIB_fnc_getNearestFob;
|
||||
_fobdistance = 9999;
|
||||
if ( count _nearfob == 3 ) then {
|
||||
_fobdistance = _selectedmember distance _nearfob;
|
||||
|
@ -188,7 +188,7 @@ while { dialog && alive player } do {
|
|||
|
||||
_tempgmp = createGroup [GRLIB_side_friendly, true];
|
||||
(typeof _selectedmember) createUnit [ markers_reset, _tempgmp,''];
|
||||
[ (units _tempgmp) select 0, _selectedmember ] call F_swapInventory;
|
||||
[ (units _tempgmp) select 0, _selectedmember ] call KPLIB_fnc_swapInventory;
|
||||
deleteVehicle ((units _tempgmp) select 0);
|
||||
_selectedmember setDamage 0;
|
||||
|
||||
|
@ -210,7 +210,7 @@ while { dialog && alive player } do {
|
|||
closeDialog 0;
|
||||
|
||||
if ( primaryWeapon player == "" && secondaryWeapon player == "" ) then {
|
||||
[ _selectedmember, player ] call F_swapInventory;
|
||||
[ _selectedmember, player ] call KPLIB_fnc_swapInventory;
|
||||
};
|
||||
|
||||
_destpos = getposATL _selectedmember;
|
||||
|
@ -246,4 +246,4 @@ while { dialog && alive player } do {
|
|||
"spawn_marker" setMarkerPosLocal markers_reset;
|
||||
_squad_camera cameraEffect ["terminate","back"];
|
||||
camDestroy _squad_camera;
|
||||
deleteVehicle _targetobject;
|
||||
deleteVehicle _targetobject;
|
||||
|
|
|
@ -85,7 +85,7 @@ while { true } do {
|
|||
_first_iteration = true;
|
||||
};
|
||||
|
||||
_nearfob = [] call F_getNearestFob;
|
||||
_nearfob = [] call KPLIB_fnc_getNearestFob;
|
||||
_fobdistance = 9999;
|
||||
_actual_fob = [];
|
||||
if ( count _nearfob == 3 ) then {
|
||||
|
@ -149,7 +149,7 @@ while { true } do {
|
|||
((uiNamespace getVariable 'GUI_OVERLAY') displayCtrl (758007)) ctrlSetText format ["%1", (floor KP_liberation_supplies)];
|
||||
((uiNamespace getVariable 'GUI_OVERLAY') displayCtrl (758010)) ctrlSetText format ["%1", (floor KP_liberation_ammo)];
|
||||
((uiNamespace getVariable 'GUI_OVERLAY') displayCtrl (758013)) ctrlSetText format ["%1", (floor KP_liberation_fuel)];
|
||||
((uiNamespace getVariable 'GUI_OVERLAY') displayCtrl (758016)) ctrlSetText format ["%1/%2", unitcap,([] call F_localCap)];
|
||||
((uiNamespace getVariable 'GUI_OVERLAY') displayCtrl (758016)) ctrlSetText format ["%1/%2", unitcap,([] call KPLIB_fnc_getLocalCap)];
|
||||
((uiNamespace getVariable 'GUI_OVERLAY') displayCtrl (758019)) ctrlSetText format ["%1/%2", KP_liberation_heli_count, KP_liberation_heli_slots];
|
||||
((uiNamespace getVariable 'GUI_OVERLAY') displayCtrl (758022)) ctrlSetText format ["%1/%2", KP_liberation_plane_count, KP_liberation_plane_slots];
|
||||
((uiNamespace getVariable 'GUI_OVERLAY') displayCtrl (758025)) ctrlSetText format ["%1%2", round(combat_readiness),"%"];
|
||||
|
@ -181,7 +181,7 @@ while { true } do {
|
|||
|
||||
if ( _uiticks % 25 == 0 ) then {
|
||||
|
||||
if (!isNil "active_sectors" && ( [] call F_opforCap >= GRLIB_sector_cap)) then {
|
||||
if (!isNil "active_sectors" && ( [] call KPLIB_fnc_getOpforCap >= GRLIB_sector_cap)) then {
|
||||
|
||||
((uiNamespace getVariable 'GUI_OVERLAY') displayCtrl (517)) ctrlShow true;
|
||||
|
||||
|
@ -202,7 +202,7 @@ while { true } do {
|
|||
((uiNamespace getVariable 'GUI_OVERLAY') displayCtrl (517)) ctrlShow false;
|
||||
};
|
||||
|
||||
_nearest_active_sector = [ GRLIB_sector_size ] call F_getNearestSector;
|
||||
_nearest_active_sector = [ GRLIB_sector_size ] call KPLIB_fnc_getNearestSector;
|
||||
if ( _nearest_active_sector != "" ) then {
|
||||
_zone_size = GRLIB_capture_size;
|
||||
if ( _nearest_active_sector in sectors_bigtown ) then {
|
||||
|
@ -211,9 +211,9 @@ while { true } do {
|
|||
|
||||
"zone_capture" setmarkerposlocal (markerpos _nearest_active_sector);
|
||||
_colorzone = "ColorGrey";
|
||||
if ( [ markerpos _nearest_active_sector, _zone_size ] call F_sectorOwnership == GRLIB_side_friendly ) then { _colorzone = GRLIB_color_friendly };
|
||||
if ( [ markerpos _nearest_active_sector, _zone_size ] call F_sectorOwnership == GRLIB_side_enemy ) then { _colorzone = GRLIB_color_enemy };
|
||||
if ( [ markerpos _nearest_active_sector, _zone_size ] call F_sectorOwnership == GRLIB_side_resistance ) then { _colorzone = "ColorCivilian" };
|
||||
if ( [ markerpos _nearest_active_sector, _zone_size ] call KPLIB_fnc_getSectorOwnership == GRLIB_side_friendly ) then { _colorzone = GRLIB_color_friendly };
|
||||
if ( [ markerpos _nearest_active_sector, _zone_size ] call KPLIB_fnc_getSectorOwnership == GRLIB_side_enemy ) then { _colorzone = GRLIB_color_enemy };
|
||||
if ( [ markerpos _nearest_active_sector, _zone_size ] call KPLIB_fnc_getSectorOwnership == GRLIB_side_resistance ) then { _colorzone = "ColorCivilian" };
|
||||
"zone_capture" setmarkercolorlocal _colorzone;
|
||||
|
||||
_ratio = [_nearest_active_sector] call KPLIB_fnc_getForceRatio;
|
||||
|
|
|
@ -7,7 +7,7 @@ if (isNil "reset_battlegroups_ai") then {reset_battlegroups_ai = false};
|
|||
|
||||
sleep (5 + (random 5));
|
||||
|
||||
private _objPos = ([getPos (leader _grp)] call F_getNearestBluforObjective) select 0;
|
||||
private _objPos = ([getPos (leader _grp)] call KPLIB_fnc_getNearestBluforObjective) select 0;
|
||||
|
||||
[_objPos] remoteExec ["remote_call_incoming"];
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ sleep 1;
|
|||
|
||||
private _transGrp = (group (driver _transVeh));
|
||||
private _start_pos = getpos _transVeh;
|
||||
private _objPos = ([getpos _transVeh] call F_getNearestBluforObjective) select 0;
|
||||
private _objPos = ([getpos _transVeh] call KPLIB_fnc_getNearestBluforObjective) select 0;
|
||||
private _unload_distance = 500;
|
||||
private _crewcount = count crew _transVeh;
|
||||
|
||||
|
@ -22,7 +22,7 @@ if ((alive _transVeh) && (alive (driver _transVeh))) then {
|
|||
_infGrp = createGroup [GRLIB_side_enemy, true];
|
||||
|
||||
{
|
||||
[_x, _start_pos, _infGrp, "PRIVATE", 0.5] call F_createManagedUnit;
|
||||
[_x, _start_pos, _infGrp, "PRIVATE", 0.5] call KPLIB_fnc_createManagedUnit;
|
||||
} foreach ([] call KPLIB_fnc_getSquadComp);
|
||||
|
||||
{_x moveInCargo _transVeh} forEach (units _infGrp);
|
||||
|
|
|
@ -21,7 +21,7 @@ while {GRLIB_endgame == 0} do {
|
|||
{
|
||||
private _sector = _x;
|
||||
private _blocked = false;
|
||||
private _units_at_sector = [getmarkerpos _sector, GRLIB_sector_size, GRLIB_side_friendly] call F_getUnitsCount;
|
||||
private _units_at_sector = [getmarkerpos _sector, GRLIB_sector_size, GRLIB_side_friendly] call KPLIB_fnc_getUnitsCount;
|
||||
|
||||
{
|
||||
if ((_x select 0) == _sector) exitWith {
|
||||
|
@ -39,8 +39,8 @@ while {GRLIB_endgame == 0} do {
|
|||
KP_liberation_asymmetric_sectors pushBack _sector;
|
||||
|
||||
if ((random 100) <= KP_liberation_resistance_ambush_chance) then {
|
||||
private _hc = [] call F_lessLoadedHC;
|
||||
private _ieds = round (([] call F_cr_getMulti) * GRLIB_difficulty_modifier);
|
||||
private _hc = [] call KPLIB_fnc_getLessLoadedHC;
|
||||
private _ieds = round (([] call KPLIB_fnc_crGetMulti) * GRLIB_difficulty_modifier);
|
||||
|
||||
if (isNull _hc) then {
|
||||
[_sector, _ieds] spawn manage_asymIED;
|
||||
|
|
|
@ -54,7 +54,7 @@ while {_supplies > 0} do {
|
|||
_amount = _supplies;
|
||||
};
|
||||
_supplies = _supplies - _amount;
|
||||
private _crate = [KP_liberation_supply_crate, _amount, getPos _roadObj] call F_createCrate;
|
||||
private _crate = [KP_liberation_supply_crate, _amount, getPos _roadObj] call KPLIB_fnc_createCrate;
|
||||
_crate setPos (_crate getPos [random 60, random 360]);
|
||||
_crateArray pushBack [_crate];
|
||||
};
|
||||
|
@ -65,7 +65,7 @@ while {_ammo > 0} do {
|
|||
_amount = _ammo;
|
||||
};
|
||||
_ammo = _ammo - _amount;
|
||||
private _crate = [KP_liberation_ammo_crate, _amount, getPos _roadObj] call F_createCrate;
|
||||
private _crate = [KP_liberation_ammo_crate, _amount, getPos _roadObj] call KPLIB_fnc_createCrate;
|
||||
_crate setPos (_crate getPos [random 60, random 360]);
|
||||
_crateArray pushBack [_crate];
|
||||
};
|
||||
|
@ -76,13 +76,13 @@ while {_fuel > 0} do {
|
|||
_amount = _fuel;
|
||||
};
|
||||
_fuel = _fuel - _amount;
|
||||
private _crate = [KP_liberation_fuel_crate, _amount, getPos _roadObj] call F_createCrate;
|
||||
private _crate = [KP_liberation_fuel_crate, _amount, getPos _roadObj] call KPLIB_fnc_createCrate;
|
||||
_crate setPos (_crate getPos [random 60, random 360]);
|
||||
_crateArray pushBack [_crate];
|
||||
};
|
||||
if (KP_liberation_asymmetric_debug > 0) then {diag_log format ["[KP LIBERATION] [ASYMMETRIC] Logistic convoy %1 ambush: resource spawning done", (_convoy select 0)];};
|
||||
|
||||
private _grp = [getPos _roadObj] call F_spawnGuerillaGroup;
|
||||
private _grp = [getPos _roadObj] call KPLIB_fnc_spawnGuerillaGroup;
|
||||
|
||||
private _waypoint = _grp addWaypoint [getPos _roadObj, 150];
|
||||
_waypoint setWaypointType "SAD";
|
||||
|
@ -101,7 +101,7 @@ if (KP_liberation_asymmetric_debug > 0) then {diag_log format ["[KP LIBERATION]
|
|||
private _waitingTime = KP_liberation_convoy_ambush_duration;
|
||||
|
||||
while {(({alive _x} count (units _grp)) > 0) && (_waitingTime > 0)} do {
|
||||
uiSleep 1;
|
||||
uiSleep 1;
|
||||
private _player_near = false;
|
||||
{
|
||||
if (((_x distance _roadObj) < 250) && (alive _x)) exitWith {_player_near = true};
|
||||
|
|
|
@ -21,7 +21,7 @@ while {count _position_indexes < 10} do {
|
|||
};
|
||||
};
|
||||
|
||||
private _grp = [(markerPos _sector)] call F_spawnGuerillaGroup;
|
||||
private _grp = [(markerPos _sector)] call KPLIB_fnc_spawnGuerillaGroup;
|
||||
_grp setBehaviour "STEALTH";
|
||||
private _idxposit = 0;
|
||||
{
|
||||
|
|
|
@ -4,7 +4,7 @@ if (KP_liberation_asymmetric_debug > 0) then {private _text = format ["[KP LIBER
|
|||
|
||||
private _startpos = (markerPos _sector) getPos [(1200 + (round (random 400))), (random 360)];
|
||||
|
||||
while {(([_startpos, 500, GRLIB_side_friendly] call F_getUnitsCount) > 0) || (surfaceIsWater _startpos)} do {
|
||||
while {(([_startpos, 500, GRLIB_side_friendly] call KPLIB_fnc_getUnitsCount) > 0) || (surfaceIsWater _startpos)} do {
|
||||
_startpos = (markerPos _sector) getPos [(1200 + (round (random 400))), (random 360)];
|
||||
};
|
||||
|
||||
|
@ -45,10 +45,10 @@ if (_incDir < 23) then {
|
|||
};
|
||||
};
|
||||
|
||||
[5, [(markerText _sector), _incString]] remoteExec ["F_cr_globalMsg"];
|
||||
[5, [(markerText _sector), _incString]] remoteExec ["KPLIB_fnc_crGlobalMsg"];
|
||||
|
||||
private _spawnedGroups = [];
|
||||
private _grp = [_startpos] call F_spawnGuerillaGroup;
|
||||
private _grp = [_startpos] call KPLIB_fnc_spawnGuerillaGroup;
|
||||
|
||||
while {(count (waypoints _grp)) != 0} do {deleteWaypoint ((waypoints _grp) select 0);};
|
||||
{_x doFollow (leader _grp)} forEach (units _grp);
|
||||
|
@ -78,9 +78,9 @@ sleep 30;
|
|||
|
||||
if (((random 100) <= 25) && !(KP_liberation_guerilla_vehicles isEqualTo [])) then {
|
||||
private _vehicle = (selectRandom KP_liberation_guerilla_vehicles) createVehicle _startpos;
|
||||
_vehicle call F_allowCrewInImmobile;
|
||||
[_vehicle] call KPLIB_fnc_allowCrewInImmobile;
|
||||
|
||||
private _grp = [_startpos, 2] call F_spawnGuerillaGroup;
|
||||
private _grp = [_startpos, 2] call KPLIB_fnc_spawnGuerillaGroup;
|
||||
((units _grp) select 0) moveInDriver _vehicle;
|
||||
((units _grp) select 1) moveInGunner _vehicle;
|
||||
|
||||
|
|
|
@ -37,9 +37,9 @@ if (count GRLIB_all_fobs == 0) then {
|
|||
clearItemCargoGlobal _fobbox;
|
||||
|
||||
if (!KP_liberation_fob_vehicle) then {
|
||||
_fobbox call F_setFobMass;
|
||||
[_fobbox] call KPLIB_fnc_setFobMass;
|
||||
// Add ViV actions to FOB Box
|
||||
[_fobBox] remoteExecCall ["F_setLoadableViV", 0, _fobBox];
|
||||
[_fobBox] remoteExecCall ["KPLIB_fnc_setLoadableViV", 0, _fobBox];
|
||||
};
|
||||
|
||||
sleep 3;
|
||||
|
@ -72,7 +72,7 @@ if (count GRLIB_all_fobs == 0) then {
|
|||
clearItemCargoGlobal _crate;
|
||||
clearBackpackCargoGlobal _crate;
|
||||
_crate setVariable ["KP_liberation_crate_value", 100, true];
|
||||
[_crate, 500] remoteExec ["F_setMass",_crate];
|
||||
[_crate, 500] remoteExec ["KPLIB_fnc_setMass",_crate];
|
||||
[objNull, _crate] call BIS_fnc_curatorObjectEdited;
|
||||
if(KP_liberation_ace) then {[_crate, true, [0, 1.5, 0], 0] remoteExec ["ace_dragging_fnc_setCarryable"];};
|
||||
_crateArray pushBack _crate;
|
||||
|
|
|
@ -38,7 +38,7 @@ while { GRLIB_csat_aggressivity >= 0.9 && GRLIB_endgame == 0 } do {
|
|||
} foreach (allPlayers - entities "HeadlessClient_F");
|
||||
|
||||
if (!(isNull _target_player)) then {
|
||||
_target_pos = [99999, getpos _target_player ] call F_getNearestSector;
|
||||
_target_pos = [99999, getpos _target_player ] call KPLIB_fnc_getNearestSector;
|
||||
if ( _target_pos != "" ) then {
|
||||
[ _target_pos ] spawn spawn_air;
|
||||
};
|
||||
|
|
|
@ -20,7 +20,7 @@ while {GRLIB_csat_aggressivity > 0.9 && GRLIB_endgame == 0} do {
|
|||
|
||||
if (
|
||||
(count (allPlayers - entities "HeadlessClient_F") >= (10 / GRLIB_csat_aggressivity)) &&
|
||||
([] call F_opforCap < GRLIB_battlegroup_cap) &&
|
||||
([] call KPLIB_fnc_getOpforCap < GRLIB_battlegroup_cap) &&
|
||||
(combat_readiness >= 70) &&
|
||||
(diag_fps > 15.0)
|
||||
) then {
|
||||
|
|
|
@ -30,13 +30,13 @@ if !(_spawn_marker isEqualTo "") then {
|
|||
[_spawn_marker] remoteExec ["remote_call_battlegroup"];
|
||||
|
||||
if (worldName in KP_liberation_battlegroup_clearance) then {
|
||||
[markerpos _spawn_marker, 15] call F_createClearance;
|
||||
[markerpos _spawn_marker, 15] call KPLIB_fnc_createClearance;
|
||||
};
|
||||
|
||||
private ["_nextgrp", "_vehicle"];
|
||||
{
|
||||
_nextgrp = createGroup [GRLIB_side_enemy, true];
|
||||
_vehicle = [markerpos _spawn_marker, _x] call F_libSpawnVehicle;
|
||||
_vehicle = [markerpos _spawn_marker, _x] call KPLIB_fnc_spawnVehicle;
|
||||
|
||||
sleep 0.5;
|
||||
|
||||
|
@ -44,9 +44,9 @@ if !(_spawn_marker isEqualTo "") then {
|
|||
[_nextgrp] spawn battlegroup_ai;
|
||||
_bg_groups pushback _nextgrp;
|
||||
|
||||
if ((_x in opfor_troup_transports) && ([] call F_opforCap < GRLIB_battlegroup_cap)) then {
|
||||
if ((_x in opfor_troup_transports) && ([] call KPLIB_fnc_getOpforCap < GRLIB_battlegroup_cap)) then {
|
||||
if (_vehicle isKindOf "Air") then {
|
||||
[([markerPos _spawn_marker] call F_getNearestBluforObjective) select 0, _vehicle] spawn send_paratroopers;
|
||||
[([markerPos _spawn_marker] call KPLIB_fnc_getNearestBluforObjective) select 0, _vehicle] spawn send_paratroopers;
|
||||
} else {
|
||||
[_vehicle] spawn troup_transport;
|
||||
};
|
||||
|
@ -56,7 +56,7 @@ if !(_spawn_marker isEqualTo "") then {
|
|||
} forEach _selected_opfor_battlegroup;
|
||||
|
||||
if (GRLIB_csat_aggressivity > 0.9) then {
|
||||
[([markerpos _spawn_marker] call F_getNearestBluforObjective) select 0] spawn spawn_air;
|
||||
[([markerpos _spawn_marker] call KPLIB_fnc_getNearestBluforObjective) select 0] spawn spawn_air;
|
||||
};
|
||||
|
||||
sleep 5;
|
||||
|
@ -68,7 +68,7 @@ if !(_spawn_marker isEqualTo "") then {
|
|||
|
||||
{
|
||||
if (local _x) then {
|
||||
_headless_client = [] call F_lessLoadedHC;
|
||||
_headless_client = [] call KPLIB_fnc_getLessLoadedHC;
|
||||
if (!isNull _headless_client) then {
|
||||
_x setGroupOwner (owner _headless_client);
|
||||
};
|
||||
|
|
|
@ -4,16 +4,16 @@ if (isServer && alive _informant) then {
|
|||
resources_intel = resources_intel + KP_liberation_civinfo_intel;
|
||||
[2] spawn F_cr_changeCR;
|
||||
[1] remoteExec ["civinfo_notifications"];
|
||||
|
||||
|
||||
sleep 6;
|
||||
|
||||
|
||||
if ((random 100) <= KP_liberation_civinfo_task_chance) then {
|
||||
private _hc = [] call F_lessLoadedHC;
|
||||
private _hc = [] call KPLIB_fnc_getLessLoadedHC;
|
||||
|
||||
if (isNull _hc) then {
|
||||
[] spawn civinfo_task;
|
||||
} else {
|
||||
[] remoteExec ["civinfo_task", _hc];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue