Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Major Update 240724 #28

Merged
merged 11 commits into from
Jul 24, 2024
4 changes: 2 additions & 2 deletions Missionframework/KPLIB_config.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -300,8 +300,8 @@ KPLIB_civinfo_duration = 1800;
// Chance (0-100) that the delivered informant will spawn a time critical task
KPLIB_civinfo_task_chance = 35;

// Time until the task will despawn if no player is near. (seconds, default 15 min)
KPLIB_civinfo_task_duration = 900;
// Time until the task will despawn if no player is near. (seconds, default 30 min)
KPLIB_civinfo_task_duration = 1800;


/*
Expand Down
47 changes: 23 additions & 24 deletions Missionframework/scripts/client/civinformant/civinfo_escort.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -19,30 +19,29 @@ waitUntil {
};

if (alive _informant) then {
if (_is_near_fob) then {
sleep 5;
_grp = createGroup [KPLIB_side_civilian, true];
[_informant] joinSilent _grp;
if (KPLIB_ace) then {
private _isCuffed = _informant getVariable ["ace_captives_isHandcuffed", false];
if (_isCuffed) then {
["ace_captives_setHandcuffed", [_informant, false], _informant] remoteExecCall ["CBA_fnc_targetEvent", 2];
} else {
["ace_captives_setSurrendered", [_informant, false], _informant] remoteExecCall ["CBA_fnc_targetEvent", 2];
};
sleep 1;
sleep 5;
_grp = createGroup [KPLIB_side_civilian, true];
[_informant] joinSilent _grp;
if (KPLIB_ace) then {
private _isCuffed = _informant getVariable ["ace_captives_isHandcuffed", false];
if (_isCuffed) then {
["ace_captives_setHandcuffed", [_informant, false], _informant] remoteExecCall ["CBA_fnc_targetEvent", 2];
} else {
["ace_captives_setSurrendered", [_informant, false], _informant] remoteExecCall ["CBA_fnc_targetEvent", 2];
};
_informant playmove "AmovPercMstpSnonWnonDnon_AmovPsitMstpSnonWnonDnon_ground";
_informant disableAI "ANIM";
_informant disableAI "MOVE";
sleep 5;
[_informant, "AidlPsitMstpSnonWnonDnon_ground00"] remoteExecCall ["switchMove"];
[_informant] remoteExec ["civinfo_delivered",2];
if (KPLIB_civinfo_debug > 0) then {["civinfo_escort -> Informant at FOB", "CIVINFO"] remoteExecCall ["KPLIB_fnc_log", 2];};
KPLIB_civinfo_under_control = true;
sleep 600;
if (isNull objectParent _informant) then {deleteVehicle _informant} else {(objectParent _informant) deleteVehicleCrew _informant};
if (KPLIB_civinfo_debug > 0) then {[format ["civinfo_escort finished by: %1", debug_source], "CIVINFO"] remoteExecCall ["KPLIB_fnc_log", 2];};
sleep 1;
};
_informant playmove "AmovPercMstpSnonWnonDnon_AmovPsitMstpSnonWnonDnon_ground";
_informant disableAI "ANIM";
_informant disableAI "MOVE";
sleep 5;
[_informant, "AidlPsitMstpSnonWnonDnon_ground00"] remoteExecCall ["switchMove"];
[_informant] remoteExec ["civinfo_delivered",2];
if (KPLIB_civinfo_debug > 0) then {["civinfo_escort -> Informant at FOB", "CIVINFO"] remoteExecCall ["KPLIB_fnc_log", 2];};
sleep 600;
if (isNull objectParent _informant) then {deleteVehicle _informant} else {(objectParent _informant) deleteVehicleCrew _informant};
if (KPLIB_civinfo_debug > 0) then {[format ["civinfo_escort finished by: %1", debug_source], "CIVINFO"] remoteExecCall ["KPLIB_fnc_log", 2];};
} else {
if (KPLIB_civinfo_debug > 0) then {[format ["civinfo_escort failed by: %1 - Informant isn't alive", debug_source], "CIVINFO"] remoteExecCall ["KPLIB_fnc_log", 2];};
[3] remoteExec ["civinfo_notifications"];
};
KPLIB_civinfo_under_control = false;
10 changes: 8 additions & 2 deletions Missionframework/scripts/server/civinformant/civinfo_loop.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,11 @@ while {true} do {
_informant setUnitPos "UP";
sleep 1;

private _chemlight = objNull;
private _chemClass = "Chemlight_blue";
if (KPLIB_ace) then {
["ace_captives_setSurrendered", [_informant, true], _informant] remoteExecCall ["CBA_fnc_targetEvent", 2];
_chemClass = "ACE_Chemlight_HiBlue";
} else {
_informant disableAI "ANIM";
_informant disableAI "MOVE";
Expand All @@ -47,6 +50,7 @@ while {true} do {
_informant setCaptive true;
};
_informant setVariable ["KPLIB_prisonner_surrendered", true, true];
_chemlight = _chemClass createVehicle (getPos _informant);

if (KPLIB_civinfo_debug > 0) then {[format ["Informant %1 spawned on: %2 - Position: %3", name _informant, debug_source, getPos _informant], "CIVINFO"] remoteExecCall ["KPLIB_fnc_log", 2];};

Expand Down Expand Up @@ -86,7 +90,7 @@ while {true} do {

private _isCaptured = _informant getVariable ["KPLIB_prisonner_captured", false];
private _isCuffed = _informant getVariable ["ace_captives_isHandcuffed", false];
KPLIB_civinfo_under_control = false;
private _not_under_control = true;
if (_isCaptured || _isCuffed) then {
private _capturedPlayer = _informant getVariable ["KPLIB_prisonner_whois", objNull];
if (isNull _capturedPlayer) then {
Expand Down Expand Up @@ -121,13 +125,15 @@ while {true} do {
doStop _informant;
_informant doFollow _capturedPlayer;

_not_under_control = false;
[_informant] remoteExec ["civinfo_escort", _informant];
[7, [0,0,0], _capturedPlayer] remoteExec ["civinfo_notifications"];
};
deleteVehicle _chemlight;

waitUntil {!alive _informant || _timeover};

if (!alive _informant && !KPLIB_civinfo_under_control) exitWith {
if (!alive _informant && _not_under_control) exitWith {
if (KPLIB_civinfo_debug > 0) then {[format ["civinfo_loop is reset by: %1 - Informant isn't alive", debug_source], "CIVINFO"] remoteExecCall ["KPLIB_fnc_log", 2];};
[3] remoteExec ["civinfo_notifications"];
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ private _count = 2 + (ceil (random 2));
private _grp = creategroup [KPLIB_side_civilian, true];
private _civs = [];
private _markers = [];
private _chemlight = objNull;
private _chemlights = [];
private _chemClass = "Chemlight_blue";
if (KPLIB_ace) then {_chemClass = "ACE_Chemlight_HiBlue";};

for "_i" from 1 to _count do {
private _pos = (markerPos _sector) getPos [(50 + (random 150)), (random 360)];
Expand All @@ -17,7 +21,9 @@ for "_i" from 1 to _count do {
private _civ = [selectRandom KPLIB_c_units, _pos, _grp] call KPLIB_fnc_createManagedUnit;
_civ setDamage 0.75;
_civs pushBack _civ;
private _marker = createMarker ["wounded_marker_" + str _i, [((_pos select 0) - 20 + (random 40)),((_pos select 1) - 20 + (random 40))]];
_chemlight = _chemClass createVehicle (getPos _civ);
_chemlights pushBack _chemlight;
private _marker = createMarker [format ["wounded_marker_%1_%2", round time, _i], [((_pos select 0) - 20 + (random 40)),((_pos select 1) - 20 + (random 40))]];
_marker setMarkerShape "ELLIPSE";
_marker setMarkerSize [25,25];
_marker setMarkerColor "ColorCIV";
Expand Down Expand Up @@ -88,13 +94,14 @@ while {true} do {
};
} forEach _civs;
if ((count _healed_civs) isEqualTo (count _civs)) exitWith {
if (KPLIB_civrep_debug > 0) then {["civrep_wounded_civs.sqf -> all wounded units healed. exit heal wait loop", "CIVREP"] remoteExecCall ["KPLIB_fnc_log", 2]};
if (KPLIB_civrep_debug > 0) then {["civrep_wounded_civs.sqf -> all wounded units healed or died. exit heal wait loop", "CIVREP"] remoteExecCall ["KPLIB_fnc_log", 2]};
sleep 60;
};
sleep 1;
};

{deleteVehicle _x} forEach _civs;
{deleteVehicle _x} forEach _chemlights;
{deleteMarker _x} forEach _markers;

if (KPLIB_civrep_debug > 0) then {[format ["civrep_wounded_civs.sqf -> dropped at %1", markerText _sector], "CIVREP"] remoteExecCall ["KPLIB_fnc_log", 2]};
14 changes: 14 additions & 0 deletions Missionframework/scripts/server/resources/unit_cap.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,20 @@ while {true} do {
private _local_plane_count = 0;
private _local_units = (units KPLIB_side_player) select {alive _x && !(captive _x) && ((_x distance startbase) > 250 || (isPlayer _x))};
private _local_vehicles = (entities "AIR") select {alive _x && (toLowerANSI (typeOf _x)) in KPLIB_b_air_classes && !(_x getVariable ["KPLIB_preplaced", false])};
{
_class = typeOf _x;
_isNotCaptured = false;
if ((toLowerANSI _class) in KPLIB_o_allVeh_classes) then {
_isCaptured = _x getVariable ["KPLIB_captured", false];
if !(_isCaptured) then {_isNotCaptured = true;};
};
_isNotSeized = false;
if (_class in KPLIB_c_vehicles) then {
_isSeized = _x getVariable ["KPLIB_seized", false];
if !(_isSeized) then {_isNotSeized = true;};
};
if (_isNotCaptured || _isNotSeized) then {_local_vehicles deleteAt _forEachIndex;};
} forEachReversed _local_vehicles;
{
_local_unitcap = _local_unitcap + 1;
} forEach _local_units;
Expand Down
34 changes: 16 additions & 18 deletions Missionframework/scripts/server/secondary/bingo_fuel.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ _objective_factory = selectRandom _player_factory;
secondary_objective_position = getMarkerPos _objective_factory;
secondary_objective_position_marker = secondary_objective_position;
publicVariable "secondary_objective_position_marker";
sleep 1;
uiSleep 1;

// Start the secondary mission
KPLIB_secondary_in_progress = 3; publicVariable "KPLIB_secondary_in_progress";
Expand Down Expand Up @@ -57,7 +57,7 @@ while {!_fuels_present} do {
// If there are no fuels, wait for a period of time and check again
if (count _fuels_in_zone isEqualTo 0) then {
hintSilent "";
sleep 5;
uiSleep 5;
} else {

// Loop through all fuel crates in the zone and add up their values
Expand All @@ -67,18 +67,18 @@ while {!_fuels_present} do {
if (_total_value < _required_value) then {

// Notify players of current fuel status in area
hintSilent format ["Fuels in area: %1/%2\nNext check will run after %3 seconds...", _total_value, _required_value, 5];
sleep 1;
hintSilent format ["Fuels in area: %1/%2\nNext check will run after %3 seconds...", _total_value, _required_value, 4];
sleep 1;
hintSilent format ["Fuels in area: %1/%2\nNext check will run after %3 seconds...", _total_value, _required_value, 3];
sleep 1;
hintSilent format ["Fuels in area: %1/%2\nNext check will run after %3 seconds...", _total_value, _required_value, 2];
sleep 1;
hintSilent format ["Fuels in area: %1/%2\nNext check will run after %3 seconds...", _total_value, _required_value, 1];
sleep 1;
hintSilent format ["Fuels in area: %1/%2\nChecking...", _total_value, _required_value];
sleep 1;
hintSilent format [localize "STR_SECONDARY_LOGIMISSION_WAITING", _total_value, _required_value, 5, localize "STR_FUEL"];
uiSleep 1;
hintSilent format [localize "STR_SECONDARY_LOGIMISSION_WAITING", _total_value, _required_value, 4, localize "STR_FUEL"];
uiSleep 1;
hintSilent format [localize "STR_SECONDARY_LOGIMISSION_WAITING", _total_value, _required_value, 3, localize "STR_FUEL"];
uiSleep 1;
hintSilent format [localize "STR_SECONDARY_LOGIMISSION_WAITING", _total_value, _required_value, 2, localize "STR_FUEL"];
uiSleep 1;
hintSilent format [localize "STR_SECONDARY_LOGIMISSION_WAITING", _total_value, _required_value, 1, localize "STR_FUEL"];
uiSleep 1;
hintSilent format [localize "STR_SECONDARY_LOGIMISSION_CHECKING", _total_value, _required_value, localize "STR_FUEL"];
uiSleep 1;

} else {

Expand All @@ -101,7 +101,7 @@ while {!_fuels_present} do {
};
};
};
hintSilent "Secondary Objective Completed!";
hintSilent "";

private _amount = 6;
private _spawnPos = [];
Expand All @@ -125,8 +125,6 @@ for "_i" from 1 to _amount do {
[13] remoteExec ["remote_call_intel"];
stats_secondary_objectives = stats_secondary_objectives + 1;
KPLIB_secondary_in_progress = -1; publicVariable "KPLIB_secondary_in_progress";
sleep 1;
uiSleep 1;
[] spawn KPLIB_fnc_doSave;
[format ["Bingo Fuel secondary objective complete at %1.",_objective_factory], "NOTIFICATION"] call KPLIB_fnc_log;
sleep 5;
hintSilent "";
34 changes: 16 additions & 18 deletions Missionframework/scripts/server/secondary/civ_supplies.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ _objective_town = selectRandom _player_towns;
secondary_objective_position = getMarkerPos _objective_town;
secondary_objective_position_marker = secondary_objective_position;
publicVariable "secondary_objective_position_marker";
sleep 1;
uiSleep 1;

// Start the secondary mission
KPLIB_secondary_in_progress = 3; publicVariable "KPLIB_secondary_in_progress";
Expand Down Expand Up @@ -66,7 +66,7 @@ while {!_supplies_present} do {
// If there are no supplies, wait for a period of time and check again
if (count _supplies_in_zone isEqualTo 0) then {
hintSilent "";
sleep 5;
uiSleep 5;
} else {

// Loop through all supply crates in the zone and add up their values
Expand All @@ -76,18 +76,18 @@ while {!_supplies_present} do {
if (_total_value < _required_value) then {

// Notify players of current supply status in area
hintSilent format ["Supplies in area: %1/%2\nNext check will run after %3 seconds...", _total_value, _required_value, 5];
sleep 1;
hintSilent format ["Supplies in area: %1/%2\nNext check will run after %3 seconds...", _total_value, _required_value, 4];
sleep 1;
hintSilent format ["Supplies in area: %1/%2\nNext check will run after %3 seconds...", _total_value, _required_value, 3];
sleep 1;
hintSilent format ["Supplies in area: %1/%2\nNext check will run after %3 seconds...", _total_value, _required_value, 2];
sleep 1;
hintSilent format ["Supplies in area: %1/%2\nNext check will run after %3 seconds...", _total_value, _required_value, 1];
sleep 1;
hintSilent format ["Supplies in area: %1/%2\nChecking...", _total_value, _required_value];
sleep 1;
hintSilent format [localize "STR_SECONDARY_LOGIMISSION_WAITING", _total_value, _required_value, 5, localize "STR_MANPOWER"];
uiSleep 1;
hintSilent format [localize "STR_SECONDARY_LOGIMISSION_WAITING", _total_value, _required_value, 4, localize "STR_MANPOWER"];
uiSleep 1;
hintSilent format [localize "STR_SECONDARY_LOGIMISSION_WAITING", _total_value, _required_value, 3, localize "STR_MANPOWER"];
uiSleep 1;
hintSilent format [localize "STR_SECONDARY_LOGIMISSION_WAITING", _total_value, _required_value, 2, localize "STR_MANPOWER"];
uiSleep 1;
hintSilent format [localize "STR_SECONDARY_LOGIMISSION_WAITING", _total_value, _required_value, 1, localize "STR_MANPOWER"];
uiSleep 1;
hintSilent format [localize "STR_SECONDARY_LOGIMISSION_CHECKING", _total_value, _required_value, localize "STR_MANPOWER"];
uiSleep 1;

} else {

Expand All @@ -110,7 +110,7 @@ while {!_supplies_present} do {
};
};
};
hintSilent "Secondary Objective Completed!";
hintSilent "";

// Add civilian rep for a completed mission based on value in KPLIB_config
[KPLIB_secondary_objective_civ_supplies_impact] spawn F_cr_changeCR;
Expand All @@ -125,10 +125,8 @@ stats_secondary_objectives = stats_secondary_objectives + 1;
KPLIB_secondary_in_progress = -1; publicVariable "KPLIB_secondary_in_progress";

// execute a save
sleep 1;
uiSleep 1;
[] spawn KPLIB_fnc_doSave;

//create note in log
[format ["Humanitarian Aid secondary objective complete at %1. Increasing civ rep by %2",_objective_town, KPLIB_secondary_objective_civ_supplies_impact], "NOTIFICATION"] call KPLIB_fnc_log;
sleep 5;
hintSilent "";
34 changes: 16 additions & 18 deletions Missionframework/scripts/server/secondary/rearm_outpost.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ _objective_outpost = selectRandom _player_outpost;
secondary_objective_position = getMarkerPos _objective_outpost;
secondary_objective_position_marker = secondary_objective_position;
publicVariable "secondary_objective_position_marker";
sleep 1;
uiSleep 1;

// Start the secondary mission
KPLIB_secondary_in_progress = 3; publicVariable "KPLIB_secondary_in_progress";
Expand Down Expand Up @@ -57,7 +57,7 @@ while {!_ammo_present} do {
// If there are no ammo, wait for a period of time and check again
if (count _ammo_in_zone isEqualTo 0) then {
hintSilent "";
sleep 5;
uiSleep 5;
} else {

// Loop through all ammo crates in the zone and add up their values
Expand All @@ -67,18 +67,18 @@ while {!_ammo_present} do {
if (_total_value < _required_value) then {

// Notify players of current ammo status in area
hintSilent format ["Ammo in area: %1/%2\nNext check will run after %3 seconds...", _total_value, _required_value, 5];
sleep 1;
hintSilent format ["Ammo in area: %1/%2\nNext check will run after %3 seconds...", _total_value, _required_value, 4];
sleep 1;
hintSilent format ["Ammo in area: %1/%2\nNext check will run after %3 seconds...", _total_value, _required_value, 3];
sleep 1;
hintSilent format ["Ammo in area: %1/%2\nNext check will run after %3 seconds...", _total_value, _required_value, 2];
sleep 1;
hintSilent format ["Ammo in area: %1/%2\nNext check will run after %3 seconds...", _total_value, _required_value, 1];
sleep 1;
hintSilent format ["Ammo in area: %1/%2\nChecking...", _total_value, _required_value];
sleep 1;
hintSilent format [localize "STR_SECONDARY_LOGIMISSION_WAITING", _total_value, _required_value, 5, localize "STR_AMMO"];
uiSleep 1;
hintSilent format [localize "STR_SECONDARY_LOGIMISSION_WAITING", _total_value, _required_value, 4, localize "STR_AMMO"];
uiSleep 1;
hintSilent format [localize "STR_SECONDARY_LOGIMISSION_WAITING", _total_value, _required_value, 3, localize "STR_AMMO"];
uiSleep 1;
hintSilent format [localize "STR_SECONDARY_LOGIMISSION_WAITING", _total_value, _required_value, 2, localize "STR_AMMO"];
uiSleep 1;
hintSilent format [localize "STR_SECONDARY_LOGIMISSION_WAITING", _total_value, _required_value, 1, localize "STR_AMMO"];
uiSleep 1;
hintSilent format [localize "STR_SECONDARY_LOGIMISSION_CHECKING", _total_value, _required_value, localize "STR_AMMO"];
uiSleep 1;

} else {

Expand All @@ -101,14 +101,12 @@ while {!_ammo_present} do {
};
};
};
hintSilent "Secondary Objective Completed!";
hintSilent "";

KPLIB_enemyReadiness = round (KPLIB_enemyReadiness - 8);
[16] remoteExec ["remote_call_intel"];
stats_secondary_objectives = stats_secondary_objectives + 1;
KPLIB_secondary_in_progress = -1; publicVariable "KPLIB_secondary_in_progress";
sleep 1;
uiSleep 1;
[] spawn KPLIB_fnc_doSave;
[format ["Rearm Outpost secondary objective complete at %1. reduced enemy readiness to %2",_objective_outpost, KPLIB_enemyReadiness], "NOTIFICATION"] call KPLIB_fnc_log;
sleep 5;
hintSilent "";
2 changes: 1 addition & 1 deletion Missionframework/scripts/shared/kill_manager.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ params ["_unit", "_killer"];
// Killed by BLUFOR
if (side _killer == KPLIB_side_player) then {
if (KPLIB_asymmetric_debug > 0) then {[format ["Guerilla unit killed by: %1", name _killer], "ASYMMETRIC"] call KPLIB_fnc_log;};
[3, [(name _unit)]] remoteExec ["KPLIB_fnc_crGlobalMsg"];
[3, [(name _unit), (name _killer)]] remoteExec ["KPLIB_fnc_crGlobalMsg"];
stats_resistance_teamkills = stats_resistance_teamkills + 1;
[KPLIB_cr_resistance_penalty, true] spawn F_cr_changeCR;
};
Expand Down
Loading