From dd853d4ceec59ed179165e800c9cc7374f4076c5 Mon Sep 17 00:00:00 2001 From: nomisum Date: Tue, 15 Mar 2016 23:23:53 +0100 Subject: [PATCH] civ hint timer --- player/civKilledMarker.sqf | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/player/civKilledMarker.sqf b/player/civKilledMarker.sqf index 7f046700..ca730146 100644 --- a/player/civKilledMarker.sqf +++ b/player/civKilledMarker.sqf @@ -1,4 +1,6 @@ _pos = _this select 0; +_delay = 120; // 120 default + showCivKilledHint = { playSound "signal_lost"; @@ -15,5 +17,20 @@ createCivKilledMarker = { diag_log format ["CivKills: Marker %1 created", _marker]; }; +_closesttown = (nearestLocations [_pos,["NameCityCapital","NameCity","NameVillage"],10000]) select 0; + +if (count _closesttown > 0) then { + _town_pos = position _closesttown; + _distance = floor (_town_pos distance _pos); + _delay = _distance / 5; +}; + +diag_log format ["distance of killed civ to next town %2 is %1, delay is %3 secs.",_distance,text _closesttown,_delay]; + + + + +sleep _delay; + [_pos] call createCivKilledMarker; call showCivKilledHint; \ No newline at end of file