Network - Enhance fnc_globalsay3d to allow for multiple sounds being played in parallel#1810
Conversation
|
| private _sound = _source say3D _params; | ||
| if (_attach) then { | ||
| _source attachTo [_object]; | ||
| _sound attachTo [_source]; |
There was a problem hiding this comment.
This does attachment chain sound->helper->source
would sound->source
be any better?
Just curious, this probably doesn't matter
There was a problem hiding this comment.
🤔 the only thing that comes to mind is that, the sound might not be audible if the _source if outside of render distance for some god forsaken reason or something while the _sound is but 🤷
I never noticed any issues that could have been resolved by _attach so idk. just felt cleaner this way.
| if (_parallel) then { | ||
| [ | ||
| { ! alive (_this#0) || { ! alive (_this#1) } }, | ||
| { deleteVehicle (_this#2) }, | ||
| [_sound, _object, _source] | ||
| ] call CBA_fnc_waitUntilAndExecute; | ||
| }; |
There was a problem hiding this comment.
What about using 'Killed' EH instead?
There was a problem hiding this comment.
guess it would look something like
class CfgVehicles {
class Helper_Base_F; // scope = 1
class GVAR(soundHelper): Helper_Base_F { };
};
onKilled object:
{
if (typeOf == QGVAR(soundHelpe) delete it and sound attached to it
} forEach attachedObjects;
do sounds make a killed event?
There was a problem hiding this comment.
The "#soundsorce" entity which is returned vom say3d or what it's called cannot have setVars on it, so I kinda expect it not triggering eh, but I don't know for sure.
There was a problem hiding this comment.
this is always something we can change later
Adds new parameter (default: false) to create a local helperObject, to bypass the "one sound at once" limitation of say3d per object and removes it once the sound is done or the object dies.