Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explosives - Improve Support for custom IED ringtones #10731

Open
wants to merge 18 commits into
base: master
Choose a base branch
from

Conversation

tuntematonjr
Copy link
Contributor

When merged this pull request will:

  • Add support for custom IED ringtones.
  • Slight randomness for ringtone before detonation.
  • Some code tweaks.

IMPORTANT

  • If the contribution affects the documentation, please include your changes in this pull request so the documentation will appear on the website.
  • Development Guidelines are read, understood and applied.
  • Title of this PR uses our standard template Component - Add|Fix|Improve|Change|Make|Remove {changes}.

@tuntematonjr tuntematonjr marked this pull request as ready for review February 8, 2025 14:10
@PabstMirror PabstMirror added the kind/enhancement Release Notes: **IMPROVED:** label Feb 8, 2025
@tuntematonjr
Copy link
Contributor Author

I was wondering whether it would be better to use a variable for the sounds instead of the config, or at least provide that option as well. It would make it easier to use in mission files.

addons/explosives/functions/fnc_dialPhone.sqf Outdated Show resolved Hide resolved
* Dials the number passed and detonates the explosive.
*
Copy link
Contributor

Choose a reason for hiding this comment

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

Rogue change.

Comment on lines -18 to -20

params ["_unit", "_code"];
TRACE_2("params",_unit,_code);
Copy link
Contributor

Choose a reason for hiding this comment

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

Same.

addons/explosives/functions/fnc_dialPhone.sqf Outdated Show resolved Hide resolved
addons/explosives/functions/fnc_dialPhone.sqf Outdated Show resolved Hide resolved
addons/explosives/functions/fnc_dialingPhone.sqf Outdated Show resolved Hide resolved
addons/explosives/functions/fnc_dialingPhone.sqf Outdated Show resolved Hide resolved
_ringtone params ["_ringtonePath", "_ringtoneLenght"];

//Calculate the ringtone duration before detonation with slight randomness
private _ringtoneDuration = round(count _arr - (_ringtoneLenght + (random 1.5)- 0.75) / 0.25) max 4;
Copy link
Contributor

Choose a reason for hiding this comment

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

_ringtoneLenght + (random 1.5)- 0.75 seems to be too specific to the existing ringtone. Why not just use random _ringtoneLength instead?

Or even better: Why not use the config attribute to add randomness on line 24?

Copy link
Contributor Author

@tuntematonjr tuntematonjr Feb 12, 2025

Choose a reason for hiding this comment

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

I think random _ringtoneLength might have issues with longer ringtones. 4s ringtone could blow up after 2s of the ringtone end.

Or even better: Why not use the config attribute to add randomness on line 24?

not sure what you mean? Do you mean that add new config for (ceil(random 8)) + 1, so instead of this this random 9s calling time, make it config entry with min1 check?

if ([_unit, -1, (_item # 0), (_item # 2), "ACE_Cellphone"] call FUNC(checkDetonateHandlers)) then {
playSound3D [QUOTE(PATHTO_R(Data\Audio\Cellphone_Ring.wss)), objNull, false, (getPosASL (_item # 0)), 3.16228, 1, 75];
playSound3D [_ringtonePath, objNull, false, (getPosASL (_item # 0)), 3.16228, 1, 75];
Copy link
Contributor

Choose a reason for hiding this comment

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

If we are adding the ability to play custom sound files, then adding the pitch, volume and distance to the config should be an option.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement Release Notes: **IMPROVED:**
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants