Incoming Guerilla Notification

Not tested yet as I'm not on my own machine.
This commit is contained in:
Christian Schubert 2018-04-04 09:13:45 +02:00
parent 586958c6f8
commit d40950c936
5 changed files with 51 additions and 0 deletions

View File

@ -8,6 +8,46 @@ while {(([_startpos, 500, GRLIB_side_friendly] call F_getUnitsCount) > 0) || (su
_startpos = (markerPos _sector) getPos [(1200 + (round (random 400))), (random 360)];
};
private _incDir = (markerPos _sector) getDir _startpos;
private _incString = "unknown";
// Have to check if a switch with value range cases work in sqf as this looks horrible. (not at my own pc currently)
if (_incDir < 23) then {
_incString = "N";
} else {
if (_incDir < 68) then {
_incString = "NE";
} else {
if (_incDir < 113) then {
_incString = "E";
} else {
if (_incDir < 158) then {
_incString = "SE";
} else {
if (_incDir < 203) then {
_incString = "S";
} else {
if (_incDir < 248) then {
_incString = "SW";
} else {
if (_incDir < 293) then {
_incString = "W";
} else {
if (_incDir < 338) then {
_incString = "NW";
} else {
_incString = "N";
};
};
};
};
};
};
};
};
[5, [(markerText _sector), _incString]] remoteExec ["F_cr_globalMsg"];
private _grp = [_startpos] call F_spawnGuerillaGroup;
while {(count (waypoints _grp)) != 0} do {deleteWaypoint ((waypoints _grp) select 0);};

View File

@ -8,5 +8,6 @@ switch (_msgType) do {
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];};
};

View File

@ -5562,5 +5562,9 @@
<Original>-- Lower</Original>
<German>-- Niedriger</German>
</Key>
<Key ID="STR_NOTIFICATION_GUERILLA_INCOMING">
<Original>Guerilla forces are incoming to %1 from the %2.</Original>
<German>Guerillakräfte nähern sich %1 aus %2.</German>
</Key>
</Package>
</Project>

View File

@ -185,4 +185,9 @@ class CfgNotifications {
color[] = {1, 0, 0, 1};
sound = "taskFailed";
};
class lib_asymm_guerilla_incoming : lib_battlegroup {
description = $STR_NOTIFICATION_GUERILLA_INCOMING;
color[] = {0, 0.5, 0, 1};
sound = "taskUpdated";
};
};

View File

@ -162,6 +162,7 @@ class Missions
* Added: Tanks DLC classnames for presets.
* Added: Group diag output for serverlog.
* Added: Debug output for group count and amount of active scripts. Liberation starts with [13,70,0,1].
* Added: Notification for incoming guerilla forces when attacking a sector.
* Removed: Some old scripts which aren't needed anymore.
* Tweaked: All `spawn compileFinal preprocessFileLineNumbers` replaced with `execVM`.
* Tweaked: All `createGroup` now with activated `deleteWhenEmpty`.