Skip to content

Network - Enhance fnc_globalsay3d to allow for multiple sounds being played in parallel#1810

Merged
PabstMirror merged 4 commits intoCBATeam:masterfrom
OverlordZorn:globalsay3d-parallell
Feb 25, 2026
Merged

Network - Enhance fnc_globalsay3d to allow for multiple sounds being played in parallel#1810
PabstMirror merged 4 commits intoCBATeam:masterfrom
OverlordZorn:globalsay3d-parallell

Conversation

@OverlordZorn
Copy link
Copy Markdown
Contributor

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.

@OverlordZorn
Copy link
Copy Markdown
Contributor Author

Making network-----------------------------------------------------
Missing PBO file cba_network.pbo. Building...
Building: P:\x\cba\addons\network
Destination: P:\x\cba\release\@CBA_A3\addons
pboProject return code == 0
Signing with P:\private_keys\cba_3.18.5.260119-d8e102d4.biprivatekey.

private _sound = _source say3D _params;
if (_attach) then {
_source attachTo [_object];
_sound attachTo [_source];
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does attachment chain sound->helper->source
would sound->source
be any better?

Just curious, this probably doesn't matter

Copy link
Copy Markdown
Contributor Author

@OverlordZorn OverlordZorn Jan 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔 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.

Comment on lines +28 to +34
if (_parallel) then {
[
{ ! alive (_this#0) || { ! alive (_this#1) } },
{ deleteVehicle (_this#2) },
[_sound, _object, _source]
] call CBA_fnc_waitUntilAndExecute;
};
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about using 'Killed' EH instead?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is always something we can change later

@PabstMirror PabstMirror added this to the 3.18.6 milestone Feb 9, 2026
@PabstMirror PabstMirror disabled auto-merge February 25, 2026 23:19
@PabstMirror PabstMirror merged commit 83ee1ab into CBATeam:master Feb 25, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants