Create clearance around FOB as action

This commit is contained in:
Wyqer 2019-07-25 15:30:25 +02:00
parent 8467163d7c
commit b5161dae25
No known key found for this signature in database
GPG Key ID: D7E2F8BD7F1E48FA
9 changed files with 300 additions and 235 deletions

View File

@ -16,6 +16,7 @@ private _idact_sectorstorage = -1;
private _idact_supplyfacility = -1;
private _idact_ammofacility = -1;
private _idact_fuelfacility = -1;
private _idact_clearance = -1;
private _distfob = (GRLIB_fob_range * 0.8);
private _distarsenal = 5;
private _distbuildfob = 10;
@ -34,254 +35,269 @@ waitUntil {one_eco_done};
while {true} do {
private _nearfob = [] call F_getNearestFob;
private _fobdistance = 9999;
private _nearest_sector = [GRLIB_fob_range] call F_getNearestSector;
private _prod_sector = [];
{
if ((_x select 1) == _nearest_sector) exitWith {_prod_sector = _x};
} forEach KP_liberation_production;
private _nearfob = [] call F_getNearestFob;
private _fobdistance = 9999;
private _nearest_sector = [GRLIB_fob_range] call F_getNearestSector;
private _prod_sector = [];
{
if ((_x select 1) == _nearest_sector) exitWith {_prod_sector = _x};
} forEach KP_liberation_production;
if (count _nearfob == 3) then {
_fobdistance = player distance _nearfob;
};
if (count _nearfob == 3) then {
_fobdistance = player distance _nearfob;
};
if (KP_liberation_mobilearsenal) then {
if (KP_liberation_mobilearsenal) then {
KP_liberation_neararsenal = ((getpos player) nearobjects [Arsenal_typename, _distarsenal]) select {getObjectType _x >= 8};
} else {
KP_liberation_neararsenal = [];
};
_nearfobbox = ((getpos player) nearEntities [[FOB_box_typename, FOB_truck_typename], _distbuildfob]);
_nearfobbox = ((getpos player) nearEntities [[FOB_box_typename, FOB_truck_typename], _distbuildfob]);
if (KP_liberation_mobilerespawn) then {
if (KP_liberation_mobilerespawn) then {
KP_liberation_nearspawn = ((getpos player) nearEntities [[Respawn_truck_typename, huron_typename], _distspawn]);
} else {
KP_liberation_nearspawn = [];
};
if (GRLIB_removefobboxes) then {
GRLIB_removefobboxes = false;
if (count _nearfobbox > 0) then {
deletevehicle (_nearfobbox select 0);
};
};
if (GRLIB_removefobboxes) then {
GRLIB_removefobboxes = false;
if (count _nearfobbox > 0) then {
deletevehicle (_nearfobbox select 0);
};
};
if ( (player distance startbase) < 200 && alive player && vehicle player == player ) then {
if (_idact_tutorial == -1) then {
_idact_tutorial = player addAction ["<t color='#80FF80'>" + localize "STR_TUTO_ACTION" + "</t>","howtoplay = 1","",-740,false,true,"",""];
};
} else {
if (_idact_tutorial != -1) then {
player removeAction _idact_tutorial;
_idact_tutorial = -1;
};
};
if ( (player distance startbase) < 200 && alive player && vehicle player == player ) then {
if (_idact_tutorial == -1) then {
_idact_tutorial = player addAction ["<t color='#80FF80'>" + localize "STR_TUTO_ACTION" + "</t>","howtoplay = 1","",-740,false,true,"",""];
};
} else {
if (_idact_tutorial != -1) then {
player removeAction _idact_tutorial;
_idact_tutorial = -1;
};
};
if ((_fobdistance < _distredeploy || (player distance startbase) < 200) && alive player && vehicle player == player && GRLIB_halo_param > 0) then {
if (_idact_halo == -1) then {
_idact_halo = player addAction ["<t color='#80FF80'>" + localize "STR_HALO_ACTION" + "</t> <img size='2' image='res\ui_redeploy.paa'/>","scripts\client\spawn\do_halo.sqf","",-749,false,true,"","build_confirmed == 0"];
};
} else {
if (_idact_halo != -1) then {
player removeAction _idact_halo;
_idact_halo = -1;
};
};
if ((_fobdistance < _distredeploy || (player distance startbase) < 200) && alive player && vehicle player == player && GRLIB_halo_param > 0) then {
if (_idact_halo == -1) then {
_idact_halo = player addAction ["<t color='#80FF80'>" + localize "STR_HALO_ACTION" + "</t> <img size='2' image='res\ui_redeploy.paa'/>","scripts\client\spawn\do_halo.sqf","",-749,false,true,"","build_confirmed == 0"];
};
} else {
if (_idact_halo != -1) then {
player removeAction _idact_halo;
_idact_halo = -1;
};
};
if ((_fobdistance < _distredeploy || count KP_liberation_nearspawn != 0 || (player distance startbase) < 200) && alive player && vehicle player == player) then {
if (_idact_redeploy == -1) then {
_idact_redeploy = player addAction ["<t color='#80FF80'>" + localize "STR_DEPLOY_ACTION" + "</t> <img size='2' image='res\ui_redeploy.paa'/>","scripts\client\actions\redeploy.sqf","",-750,false,true,"","build_confirmed == 0"];
};
} else {
if (_idact_redeploy != -1) then {
player removeAction _idact_redeploy;
_idact_redeploy = -1;
};
};
if ((_fobdistance < _distredeploy || count KP_liberation_nearspawn != 0 || (player distance startbase) < 200) && alive player && vehicle player == player) then {
if (_idact_redeploy == -1) then {
_idact_redeploy = player addAction ["<t color='#80FF80'>" + localize "STR_DEPLOY_ACTION" + "</t> <img size='2' image='res\ui_redeploy.paa'/>","scripts\client\actions\redeploy.sqf","",-750,false,true,"","build_confirmed == 0"];
};
} else {
if (_idact_redeploy != -1) then {
player removeAction _idact_redeploy;
_idact_redeploy = -1;
};
};
if ((leader group player == player) && (count units group player > 1) && alive player && vehicle player == player) then {
if (_idact_squad == -1) then {
_idact_squad = player addAction ["<t color='#80FF80'>" + localize "STR_SQUAD_MANAGEMENT_ACTION" + "</t> <img size='2' image='\a3\Ui_F_Curator\Data\Displays\RscDisplayCurator\modeGroups_ca.paa'/>","scripts\client\ui\squad_management.sqf","",-760,false,true,"","build_confirmed == 0"];
};
} else {
if (_idact_squad != -1) then {
player removeAction _idact_squad;
_idact_squad = -1;
};
};
if ((leader group player == player) && (count units group player > 1) && alive player && vehicle player == player) then {
if (_idact_squad == -1) then {
_idact_squad = player addAction ["<t color='#80FF80'>" + localize "STR_SQUAD_MANAGEMENT_ACTION" + "</t> <img size='2' image='\a3\Ui_F_Curator\Data\Displays\RscDisplayCurator\modeGroups_ca.paa'/>","scripts\client\ui\squad_management.sqf","",-760,false,true,"","build_confirmed == 0"];
};
} else {
if (_idact_squad != -1) then {
player removeAction _idact_squad;
_idact_squad = -1;
};
};
if ((_fobdistance < _distredeploy || count KP_liberation_neararsenal != 0 || count KP_liberation_nearspawn != 0 || (player distance startbase) < 200) && alive player && vehicle player == player) then {
if (_idact_arsenal == -1) then {
_idact_arsenal = player addAction ["<t color='#FFFF00'>" + localize "STR_ARSENAL_ACTION" + "</t> <img size='2' image='res\ui_arsenal.paa'/>","scripts\client\actions\open_arsenal.sqf","",-980,true,true,"","build_confirmed == 0"];
};
} else {
if (_idact_arsenal != -1) then {
player removeAction _idact_arsenal;
_idact_arsenal = -1;
};
};
if ((_fobdistance < _distredeploy || count KP_liberation_neararsenal != 0 || count KP_liberation_nearspawn != 0 || (player distance startbase) < 200) && alive player && vehicle player == player) then {
if (_idact_arsenal == -1) then {
_idact_arsenal = player addAction ["<t color='#FFFF00'>" + localize "STR_ARSENAL_ACTION" + "</t> <img size='2' image='res\ui_arsenal.paa'/>","scripts\client\actions\open_arsenal.sqf","",-980,true,true,"","build_confirmed == 0"];
};
} else {
if (_idact_arsenal != -1) then {
player removeAction _idact_arsenal;
_idact_arsenal = -1;
};
};
if (_fobdistance < _distfob && alive player && vehicle player == player && (([ player, 3] call F_fetchPermission) || (player == ([] call F_getCommander) || [] call F_isAdmin))) then {
if (_idact_build == -1) then {
_idact_build = player addAction ["<t color='#FFFF00'>" + localize "STR_BUILD_ACTION" + "</t> <img size='2' image='res\ui_build.paa'/>","scripts\client\build\open_build_menu.sqf","",-985,false,true,"","build_confirmed == 0"];
};
} else {
if (_idact_build != -1) then {
player removeAction _idact_build;
_idact_build = -1;
};
};
if (_fobdistance < _distfob && alive player && vehicle player == player && (([ player, 3] call F_fetchPermission) || (player == ([] call F_getCommander) || [] call F_isAdmin))) then {
if (_idact_build == -1) then {
_idact_build = player addAction ["<t color='#FFFF00'>" + localize "STR_BUILD_ACTION" + "</t> <img size='2' image='res\ui_build.paa'/>","scripts\client\build\open_build_menu.sqf","",-985,false,true,"","build_confirmed == 0"];
};
} else {
if (_idact_build != -1) then {
player removeAction _idact_build;
_idact_build = -1;
};
};
if ((count _nearfobbox != 0) && (alive player) && (vehicle player == player) && !(surfaceIsWater getpos player) && ((player distance startbase) > 1000) && (([player, 3] call F_fetchPermission) || (player == ([] call F_getCommander) || [] call F_isAdmin)) && !FOB_build_in_progress) then {
if (_idact_buildfob == -1) then {
_idact_buildfob = player addAction ["<t color='#FFFF00'>" + localize "STR_FOB_ACTION" + "</t> <img size='2' image='res\ui_deployfob.paa'/>","scripts\client\build\do_build_fob.sqf","",-990,false,true,"","build_confirmed == 0"];
};
} else {
if (_idact_buildfob != -1) then {
player removeAction _idact_buildfob;
_idact_buildfob = -1;
};
};
if ((count _nearfobbox != 0) && (alive player) && (vehicle player == player) && !(surfaceIsWater getpos player) && ((player distance startbase) > 1000) && (([player, 3] call F_fetchPermission) || (player == ([] call F_getCommander) || [] call F_isAdmin)) && !FOB_build_in_progress) then {
if (_idact_buildfob == -1) then {
_idact_buildfob = player addAction ["<t color='#FFFF00'>" + localize "STR_FOB_ACTION" + "</t> <img size='2' image='res\ui_deployfob.paa'/>","scripts\client\build\do_build_fob.sqf","",-990,false,true,"","build_confirmed == 0"];
};
} else {
if (_idact_buildfob != -1) then {
player removeAction _idact_buildfob;
_idact_buildfob = -1;
};
};
if (_fobdistance < _distredeploy && alive player && vehicle player == player && (player == ([] call F_getCommander) || [] call F_isAdmin)) then {
if (_idact_repackage == -1) then {
_idact_repackage = player addAction ["<t color='#FFFF00'>" + localize "STR_FOB_REPACKAGE" + "</t> <img size='2' image='res\ui_deployfob.paa'/>","scripts\client\actions\do_repackage_fob.sqf","",-991,false,true,"","build_confirmed == 0"];
};
} else {
if (_idact_repackage != -1) then {
player removeAction _idact_repackage;
_idact_repackage = -1;
};
};
if (_fobdistance < _distredeploy && alive player && vehicle player == player && (player == ([] call F_getCommander) || [] call F_isAdmin)) then {
if (_idact_repackage == -1) then {
_idact_repackage = player addAction ["<t color='#FFFF00'>" + localize "STR_FOB_REPACKAGE" + "</t> <img size='2' image='res\ui_deployfob.paa'/>","scripts\client\actions\do_repackage_fob.sqf","",-991,false,true,"","build_confirmed == 0"];
};
} else {
if (_idact_repackage != -1) then {
player removeAction _idact_repackage;
_idact_repackage = -1;
};
};
if ((count GRLIB_all_fobs > 0) && (GRLIB_endgame == 0) && (_fobdistance < _distredeploy || (player distance startbase) < 200) && alive player && vehicle player == player && (([player, 5] call F_fetchPermission) || (player == ([] call F_getCommander) || [] call F_isAdmin))) then {
if (_idact_secondary == -1) then {
_idact_secondary = player addAction ["<t color='#FFFF00'>" + localize "STR_SECONDARY_OBJECTIVES" + "</t>","scripts\client\ui\secondary_ui.sqf","",-992,false,true,"","build_confirmed == 0"];
};
} else {
if (_idact_secondary != -1) then {
player removeAction _idact_secondary;
_idact_secondary = -1;
};
};
if ((count GRLIB_all_fobs > 0) && (GRLIB_endgame == 0) && (_fobdistance < _distredeploy || (player distance startbase) < 200) && alive player && vehicle player == player && (([player, 5] call F_fetchPermission) || (player == ([] call F_getCommander) || [] call F_isAdmin))) then {
if (_idact_secondary == -1) then {
_idact_secondary = player addAction ["<t color='#FFFF00'>" + localize "STR_SECONDARY_OBJECTIVES" + "</t>","scripts\client\ui\secondary_ui.sqf","",-992,false,true,"","build_confirmed == 0"];
};
} else {
if (_idact_secondary != -1) then {
player removeAction _idact_secondary;
_idact_secondary = -1;
};
};
if ((count _prod_sector) == 12) then {
if (alive player && vehicle player == player && ([player, 3] call F_fetchPermission) && ((count (_prod_sector select 3)) == 0)) then {
if (_idact_sectorstorage == -1) then {
_idact_sectorstorage = player addAction ["<t color='#FFFF00'>" + localize "STR_SECSTORAGEBUILD_ACTION" + "</t>","scripts\client\build\do_sector_build.sqf",[KP_liberation_small_storage_building, _prod_sector],-993,false,true,"","build_confirmed == 0"];
};
} else {
if (_idact_sectorstorage != -1) then {
player removeAction _idact_sectorstorage;
_idact_sectorstorage = -1;
};
};
if (alive player && vehicle player == player && ([player, 3] call F_fetchPermission) && ((count (_prod_sector select 3)) == 3) && !(_prod_sector select 4)) then {
if (_idact_supplyfacility == -1) then {
_idact_supplyfacility = player addAction ["<t color='#FFFF00'>" + localize "STR_SECSUPPLYBUILD_ACTION" + "</t>","scripts\client\build\do_sector_build.sqf",["supply", _prod_sector],-994,false,true,"","build_confirmed == 0"];
};
} else {
if (_idact_supplyfacility != -1) then {
player removeAction _idact_supplyfacility;
_idact_supplyfacility = -1;
};
};
if (alive player && vehicle player == player && ([player, 3] call F_fetchPermission) && ((count (_prod_sector select 3)) == 3) && !(_prod_sector select 5)) then {
if (_idact_ammofacility == -1) then {
_idact_ammofacility = player addAction ["<t color='#FFFF00'>" + localize "STR_SECAMMOBUILD_ACTION" + "</t>","scripts\client\build\do_sector_build.sqf",["ammo", _prod_sector],-995,false,true,"","build_confirmed == 0"];
};
} else {
if (_idact_ammofacility != -1) then {
player removeAction _idact_ammofacility;
_idact_ammofacility = -1;
};
};
if (alive player && vehicle player == player && ([player, 3] call F_fetchPermission) && ((count (_prod_sector select 3)) == 3) && !(_prod_sector select 6)) then {
if (_idact_fuelfacility == -1) then {
_idact_fuelfacility = player addAction ["<t color='#FFFF00'>" + localize "STR_SECFUELBUILD_ACTION" + "</t>","scripts\client\build\do_sector_build.sqf",["fuel", _prod_sector],-996,false,true,"","build_confirmed == 0"];
};
} else {
if (_idact_fuelfacility != -1) then {
player removeAction _idact_fuelfacility;
_idact_fuelfacility = -1;
};
};
} else {
if (_idact_sectorstorage != -1) then {
player removeAction _idact_sectorstorage;
_idact_sectorstorage = -1;
};
if (_idact_supplyfacility != -1) then {
player removeAction _idact_supplyfacility;
_idact_supplyfacility = -1;
};
if (_idact_ammofacility != -1) then {
player removeAction _idact_ammofacility;
_idact_ammofacility = -1;
};
if (_idact_fuelfacility != -1) then {
player removeAction _idact_fuelfacility;
_idact_fuelfacility = -1;
};
};
if ((count _prod_sector) == 12) then {
if (alive player && vehicle player == player && ([player, 3] call F_fetchPermission) && ((count (_prod_sector select 3)) == 0)) then {
if (_idact_sectorstorage == -1) then {
_idact_sectorstorage = player addAction ["<t color='#FFFF00'>" + localize "STR_SECSTORAGEBUILD_ACTION" + "</t>","scripts\client\build\do_sector_build.sqf",[KP_liberation_small_storage_building, _prod_sector],-993,false,true,"","build_confirmed == 0"];
};
} else {
if (_idact_sectorstorage != -1) then {
player removeAction _idact_sectorstorage;
_idact_sectorstorage = -1;
};
};
if (alive player && vehicle player == player && ([player, 3] call F_fetchPermission) && ((count (_prod_sector select 3)) == 3) && !(_prod_sector select 4)) then {
if (_idact_supplyfacility == -1) then {
_idact_supplyfacility = player addAction ["<t color='#FFFF00'>" + localize "STR_SECSUPPLYBUILD_ACTION" + "</t>","scripts\client\build\do_sector_build.sqf",["supply", _prod_sector],-994,false,true,"","build_confirmed == 0"];
};
} else {
if (_idact_supplyfacility != -1) then {
player removeAction _idact_supplyfacility;
_idact_supplyfacility = -1;
};
};
if (alive player && vehicle player == player && ([player, 3] call F_fetchPermission) && ((count (_prod_sector select 3)) == 3) && !(_prod_sector select 5)) then {
if (_idact_ammofacility == -1) then {
_idact_ammofacility = player addAction ["<t color='#FFFF00'>" + localize "STR_SECAMMOBUILD_ACTION" + "</t>","scripts\client\build\do_sector_build.sqf",["ammo", _prod_sector],-995,false,true,"","build_confirmed == 0"];
};
} else {
if (_idact_ammofacility != -1) then {
player removeAction _idact_ammofacility;
_idact_ammofacility = -1;
};
};
if (alive player && vehicle player == player && ([player, 3] call F_fetchPermission) && ((count (_prod_sector select 3)) == 3) && !(_prod_sector select 6)) then {
if (_idact_fuelfacility == -1) then {
_idact_fuelfacility = player addAction ["<t color='#FFFF00'>" + localize "STR_SECFUELBUILD_ACTION" + "</t>","scripts\client\build\do_sector_build.sqf",["fuel", _prod_sector],-996,false,true,"","build_confirmed == 0"];
};
} else {
if (_idact_fuelfacility != -1) then {
player removeAction _idact_fuelfacility;
_idact_fuelfacility = -1;
};
};
} else {
if (_idact_sectorstorage != -1) then {
player removeAction _idact_sectorstorage;
_idact_sectorstorage = -1;
};
if (_idact_supplyfacility != -1) then {
player removeAction _idact_supplyfacility;
_idact_supplyfacility = -1;
};
if (_idact_ammofacility != -1) then {
player removeAction _idact_ammofacility;
_idact_ammofacility = -1;
};
if (_idact_fuelfacility != -1) then {
player removeAction _idact_fuelfacility;
_idact_fuelfacility = -1;
};
};
if (_fobdistance < _distfob && alive player && vehicle player == player) then {
if (_idact_resources == -1) then {
_idact_resources = player addAction ["<t color='#FFFF00'>" + localize "STR_RESOURCE_GLOBAL_ACTION" + "</t>",{KP_liberation_resources_global = !KP_liberation_resources_global},"",-997,false,true,"","build_confirmed == 0"];
};
} else {
if (_idact_resources != -1) then {
player removeAction _idact_resources;
_idact_resources = -1;
};
};
if (_fobdistance < _distfob && alive player && vehicle player == player) then {
if (_idact_resources == -1) then {
_idact_resources = player addAction ["<t color='#FFFF00'>" + localize "STR_RESOURCE_GLOBAL_ACTION" + "</t>",{KP_liberation_resources_global = !KP_liberation_resources_global},"",-997,false,true,"","build_confirmed == 0"];
};
} else {
if (_idact_resources != -1) then {
player removeAction _idact_resources;
_idact_resources = -1;
};
};
if (((_fobdistance < _distfob) || ((count _prod_sector) == 12)) && (player == ([] call F_getCommander) || [] call F_isAdmin) && alive player && vehicle player == player && ((count KP_liberation_production) > 0)) then {
if (_idact_production == -1) then {
_idact_production = player addAction ["<t color='#FF8000'>" + localize "STR_PRODUCTION_ACTION" + "</t>","scripts\client\commander\open_production.sqf","",-998,false,true,"","build_confirmed == 0"];
};
} else {
if (_idact_production != -1) then {
player removeAction _idact_production;
_idact_production = -1;
};
};
if (((_fobdistance < _distfob) || ((count _prod_sector) == 12)) && (player == ([] call F_getCommander) || [] call F_isAdmin) && alive player && vehicle player == player && ((count KP_liberation_production) > 0)) then {
if (_idact_production == -1) then {
_idact_production = player addAction ["<t color='#FF8000'>" + localize "STR_PRODUCTION_ACTION" + "</t>","scripts\client\commander\open_production.sqf","",-998,false,true,"","build_confirmed == 0"];
};
} else {
if (_idact_production != -1) then {
player removeAction _idact_production;
_idact_production = -1;
};
};
if (KP_liberation_ailogistics) then {
if ((_fobdistance < _distfob) && (player == ([] call F_getCommander) || [] call F_isAdmin) && alive player && vehicle player == player && (((count GRLIB_all_fobs) + (count KP_liberation_production)) > 1)) then {
if (_idact_logistic == -1) then {
_idact_logistic = player addAction ["<t color='#FF8000'>" + localize "STR_LOGISTIC_ACTION" + "</t>","scripts\client\commander\open_logistic.sqf","",-999,false,true,"","build_confirmed == 0"];
};
} else {
if (_idact_logistic != -1) then {
player removeAction _idact_logistic;
_idact_logistic = -1;
};
};
};
if (KP_liberation_ailogistics) then {
if ((_fobdistance < _distfob) && (player == ([] call F_getCommander) || [] call F_isAdmin) && alive player && vehicle player == player && (((count GRLIB_all_fobs) + (count KP_liberation_production)) > 1)) then {
if (_idact_logistic == -1) then {
_idact_logistic = player addAction ["<t color='#FF8000'>" + localize "STR_LOGISTIC_ACTION" + "</t>","scripts\client\commander\open_logistic.sqf","",-999,false,true,"","build_confirmed == 0"];
};
} else {
if (_idact_logistic != -1) then {
player removeAction _idact_logistic;
_idact_logistic = -1;
};
};
};
if ((player == ([] call F_getCommander) || [] call F_isAdmin) && alive player && vehicle player == player && GRLIB_permissions_param) then {
if (_idact_commander == -1) then {
_idact_commander = player addAction ["<t color='#FF8000'>" + localize "STR_COMMANDER_ACTION" + "</t> <img size='2' image='\a3\Ui_F_Curator\Data\Displays\RscDisplayCurator\modeGroups_ca.paa'/>","scripts\client\commander\open_permissions.sqf","",-1001,false,true,"","build_confirmed == 0"];
};
} else {
if (_idact_commander != -1) then {
player removeAction _idact_commander;
_idact_commander = -1;
};
};
if ((player == ([] call F_getCommander) || [] call F_isAdmin) && alive player && vehicle player == player && GRLIB_permissions_param) then {
if (_idact_commander == -1) then {
_idact_commander = player addAction ["<t color='#FF8000'>" + localize "STR_COMMANDER_ACTION" + "</t> <img size='2' image='\a3\Ui_F_Curator\Data\Displays\RscDisplayCurator\modeGroups_ca.paa'/>","scripts\client\commander\open_permissions.sqf","",-1001,false,true,"","build_confirmed == 0"];
};
} else {
if (_idact_commander != -1) then {
player removeAction _idact_commander;
_idact_commander = -1;
};
};
if (!isNil("commandant")) then {
if ((player == commandant) && (isNull(getAssignedCuratorLogic commandant))) then {
if ( _idact_zeus == -1 ) then {
_idact_zeus = player addAction ["<t color='#FF0000'>" + localize "STR_REASSIGN_ZEUS" + "</t>",{[] remoteExec ["zeus_remote_call",2];},"",-1002,false,true,"","build_confirmed == 0"];
};
} else {
player removeAction _idact_zeus;
_idact_zeus = -1;
};
};
if (!isNil("commandant")) then {
if ((player == commandant) && (isNull(getAssignedCuratorLogic commandant))) then {
if ( _idact_zeus == -1 ) then {
_idact_zeus = player addAction ["<t color='#FF0000'>" + localize "STR_REASSIGN_ZEUS" + "</t>",{[] remoteExec ["zeus_remote_call",2];},"",-1002,false,true,"","build_confirmed == 0"];
};
} else {
player removeAction _idact_zeus;
_idact_zeus = -1;
};
};
uiSleep 1;
if (_fobdistance < _distfob && alive player && vehicle player == player && (player == ([] call F_getCommander) || [] call F_isAdmin)) then {
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];},
[_nearFob, GRLIB_fob_range * 0.9], -1003, false, true, "", "build_confirmed == 0"
];
};
} else {
if (_idact_clearance != -1) then {
player removeAction _idact_clearance;
_idact_clearance = -1;
};
};
uiSleep 1;
};

View File

@ -58,6 +58,8 @@ GRLIB_vehicle_to_military_base_links = [];
infantry_weight = 33;
// Civilian reputation value (-100 - +100)
KP_liberation_civ_rep = 0;
// Clearances
KP_liberation_clearances = [];
// Captured civilian vehicles
KP_liberation_cr_vehicles = [];
// Strength value of the resistance forces
@ -70,6 +72,8 @@ KP_liberation_production = [];
KP_liberation_production_markers = [];
// Global Intel resource
resources_intel = 0;
// State if the save is fully loaded
save_is_loaded = false;
// Trigger to start a saving process
doSaveTrigger = false;
@ -158,11 +162,12 @@ if (!isNil "greuh_liberation_savegame") then {
GRLIB_permissions = greuh_liberation_savegame select 10;
GRLIB_vehicle_to_military_base_links = greuh_liberation_savegame select 11;
KP_liberation_civ_rep = greuh_liberation_savegame select 12;
KP_liberation_guerilla_strength = greuh_liberation_savegame select 13;
KP_liberation_logistics = greuh_liberation_savegame select 14;
KP_liberation_production = greuh_liberation_savegame select 15;
KP_liberation_production_markers = greuh_liberation_savegame select 16;
resources_intel = greuh_liberation_savegame select 17;
KP_liberation_clearances = greuh_liberation_savegame select 13;
KP_liberation_guerilla_strength = greuh_liberation_savegame select 14;
KP_liberation_logistics = greuh_liberation_savegame select 15;
KP_liberation_production = greuh_liberation_savegame select 16;
KP_liberation_production_markers = greuh_liberation_savegame select 17;
resources_intel = greuh_liberation_savegame select 18;
stats_ammo_produced = _stats select 0;
stats_ammo_spent = _stats select 1;
@ -279,6 +284,11 @@ if (!isNil "greuh_liberation_savegame") then {
setDate [2045, 6, 6, _dateTime, 0]; // Compatibility for older save data
};
// Create clearances
{
[_x select 0, _x select 1] call F_createClearance;
} forEach KP_liberation_clearances;
// Collection array for all objects which are loaded
private _spawnedObjects = [];
@ -670,6 +680,7 @@ while {true} do {
GRLIB_permissions,
GRLIB_vehicle_to_military_base_links,
KP_liberation_civ_rep,
KP_liberation_clearances,
KP_liberation_guerilla_strength,
KP_liberation_logistics,
KP_liberation_production,

View File

@ -8,6 +8,7 @@ publicVariable "GRLIB_all_fobs";
if ( _create_fob_building ) then {
_fob_pos = [ (_new_fob select 0) + 15, (_new_fob select 1) + 2, 0 ];
[_fob_pos, 20, true] call F_createClearance;
_fob_building = FOB_typename createVehicle _fob_pos;
_fob_building setpos _fob_pos;
_fob_building setVectorUp [0,0,1];

View File

@ -1,15 +1,23 @@
if ( !isServer ) exitWith {};
if ( isNil "GRLIB_secondary_starting" ) then { GRLIB_secondary_starting = false; };
if ( GRLIB_secondary_starting ) exitWith { diag_log "[KP LIBERATION] [ERROR] Multiple calls to start secondary mission : shouldn't be possible, isn't allowed"; };
if ( isNil "used_positions" ) then { used_positions = []; };
if (!isServer) exitWith {false};
params [
["_mission_index", -1, [0]]
];
if (_mission_index < 0) exitWith {false};
if (isNil "GRLIB_secondary_starting") then { GRLIB_secondary_starting = false;};
if (GRLIB_secondary_starting) exitWith {diag_log "[KP LIBERATION] [ERROR] Multiple calls to start secondary mission : shouldn't be possible, isn't allowed";};
if (isNil "used_positions") then {used_positions = [];};
GRLIB_secondary_starting = true; publicVariable "GRLIB_secondary_starting";
params [ "_mission_index" ];
resources_intel = resources_intel - ( GRLIB_secondary_missions_costs select _mission_index );
if ( _mission_index == 0 ) then { [] call fob_hunting; };
if ( _mission_index == 1 ) then { [] call convoy_hijack; };
if ( _mission_index == 2 ) then { [] call search_and_rescue; };
if (_mission_index == 0) then {[] spawn fob_hunting;};
if (_mission_index == 1) then {[] spawn convoy_hijack;};
if (_mission_index == 2) then {[] spawn search_and_rescue;};
GRLIB_secondary_starting = false; publicVariable "GRLIB_secondary_starting";
true

View File

@ -17,6 +17,8 @@ _base_defenders = [];
"_base_corners"
];
[_base_position, 50] call F_createClearance;
private _nextobject = objNull;
{
@ -59,7 +61,7 @@ sleep 1;
_nextobject setdir _nextdir;
_nextobject lock 2;
_base_objects pushBack _nextobject;
_base_objectives pushBack _nextobject;
} forEach _objectives_to_build;
sleep 1;

View File

@ -0,0 +1,21 @@
if (!isServer) exitWith {false};
params [
["_centerPos", [0, 0, 0], [[]], [3]],
["_radius", 0, [0]],
["_save", false, [false]]
];
if (save_is_loaded && {(KP_liberation_clearances findIf {(_x select 0) isEqualTo _centerPos}) != -1}) exitWith {false};
private _objects = nearestTerrainObjects [_centerPos, [], _radius, false, true];
{
_x hideObjectGlobal true;
_x enableSimulationGlobal false;
_x allowDamage false;
} forEach _objects;
if (_save) then {KP_liberation_clearances pushBackUnique [_centerPos, _radius];};
true

View File

@ -67,3 +67,4 @@ F_setLoadableViV = compileFinal preprocessFileLineNumbers "scripts\shared\functi
F_getNearestViVTransport = compileFinal preprocessFileLineNumbers "scripts\shared\functions\F_kp_getNearestViVTransport.sqf";
F_addObjectInit = compileFinal preprocessFileLineNumbers "scripts\shared\functions\F_kp_addObjectInit.sqf";
F_isRadio = compileFinal preprocessFileLineNumbers "scripts\shared\functions\F_kp_isRadio.sqf";
F_createClearance = compileFinal preprocessFileLineNumbers "scripts\shared\functions\F_kp_createClearance.sqf";

View File

@ -6154,5 +6154,9 @@
<Turkish>(ESC'ye basıp çıkabilirsiniz.)</Turkish>
<Portuguese>(Aperte ESC para sair)</Portuguese>
</Key>
<Key ID="STR_CLEARANCE_ACTION">
<Original>-- Clear FOB area</Original>
<German>-- FOB Gebiet räumen</German>
</Key>
</Package>
</Project>

View File

@ -190,6 +190,7 @@ class Missions
* Added: Livonia building ignore list.
* Added: [Panthera](https://steamcommunity.com/sharedfiles/filedetails/?id=708278910) basefile. Thanks to [Eogos](https://github.com/Eogos)
* Added: [Panthera](https://steamcommunity.com/sharedfiles/filedetails/?id=708278910) building ignore list. Thanks to [Eogos](https://github.com/Eogos)
* Added: "Create Clearance" Action at FOB for Commander or logged in Admin. Clears all terrain objects (no built objects) in FOB radius.
* Removed: Vanilla player score saving.
* Removed: Old garbage collection script, as there are now engine solutions available.
* Tweaked: Changed default recycle building from carservice building to tanks repair depot building.