|
@@ -2,17 +2,17 @@
|
|
params["_object", "_loopSound", "_loopDuration", "_totalDuration", "_distance"];
|
|
params["_object", "_loopSound", "_loopDuration", "_totalDuration", "_distance"];
|
|
|
|
|
|
if(!hasInterface) exitWith {
|
|
if(!hasInterface) exitWith {
|
|
- diag_log "No Interface to play sounds from";
|
|
|
|
|
|
+ diag_log "[RD501][Fired Deployable][Loop Sound Local] No Interface to play sounds from";
|
|
};
|
|
};
|
|
|
|
|
|
if(isNil "_object" || !alive _object) exitWith {
|
|
if(isNil "_object" || !alive _object) exitWith {
|
|
- diag_log "No target object to play remote sound";
|
|
|
|
|
|
+ diag_log "[RD501][Fired Deployable][Loop Sound Local] No target object to play remote sound";
|
|
};
|
|
};
|
|
|
|
|
|
private _currentSource = _object getVariable ["rd501_fired_deployable_loopSoundSource", objNull];
|
|
private _currentSource = _object getVariable ["rd501_fired_deployable_loopSoundSource", objNull];
|
|
|
|
|
|
if(!(isNil "_currentSource") && !(_currentSource isEqualTo objNull)) exitWith {
|
|
if(!(isNil "_currentSource") && !(_currentSource isEqualTo objNull)) exitWith {
|
|
- diag_log "Source already exists, removing";
|
|
|
|
|
|
+ diag_log "[RD501][Fired Deployable][Loop Sound Local] Source already exists, removing";
|
|
detach _currentSource;
|
|
detach _currentSource;
|
|
deleteVehicle _currentSource;
|
|
deleteVehicle _currentSource;
|
|
_object setVariable ["rd501_fired_deployable_loopSoundSource", objNull, false];
|
|
_object setVariable ["rd501_fired_deployable_loopSoundSource", objNull, false];
|
|
@@ -27,14 +27,14 @@ private _repeats = ceil (_totalDuration / _loopDuration);
|
|
for "_i" from 0 to _repeats step 1 do {
|
|
for "_i" from 0 to _repeats step 1 do {
|
|
private _delay = ((_loopDuration * _i) - 0.1) max 0.1; //offset by a bit to ensure loop doesn't have a hitch
|
|
private _delay = ((_loopDuration * _i) - 0.1) max 0.1; //offset by a bit to ensure loop doesn't have a hitch
|
|
private _last = _repeats == _i;
|
|
private _last = _repeats == _i;
|
|
- diag_log format["Queuing Up Repeat %1 for delay %2", _i, _delay];
|
|
|
|
|
|
+ diag_log format["[RD501][Fired Deployable][Loop Sound Local] Queuing Up Repeat %1 for delay %2", _i, _delay];
|
|
[
|
|
[
|
|
{
|
|
{
|
|
params["_currentSource", "_loopSound", "_distance", "_last"];
|
|
params["_currentSource", "_loopSound", "_distance", "_last"];
|
|
if(isNil "_currentSource" || !alive _currentSource) exitWith { diag_log "No Source, Exiting." };
|
|
if(isNil "_currentSource" || !alive _currentSource) exitWith { diag_log "No Source, Exiting." };
|
|
[_currentSource, player] say3D [_loopSound, _distance, 1, false];
|
|
[_currentSource, player] say3D [_loopSound, _distance, 1, false];
|
|
if(_last) then {
|
|
if(_last) then {
|
|
- diag_log "Last Loop, Deleting";
|
|
|
|
|
|
+ diag_log "[RD501][Fired Deployable][Loop Sound Local] Last Loop, Deleting";
|
|
detach _currentSource;
|
|
detach _currentSource;
|
|
deleteVehicle _currentSource;
|
|
deleteVehicle _currentSource;
|
|
};
|
|
};
|