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

Fix for overlapping voicelines when a squadmate dies and prevent incapacitated units from playing voicelines #1421

Merged

Conversation

BlackDog86
Copy link
Contributor

@BlackDog86 BlackDog86 commented Dec 7, 2024

Fixes #1398

@BlackDog86 BlackDog86 force-pushed the 1398-Overlapping-Voicelines-Fix branch 4 times, most recently from 089b375 to a930944 Compare December 7, 2024 16:11
@BlackDog86 BlackDog86 self-assigned this Dec 7, 2024
@BlackDog86 BlackDog86 added this to the 1.30.0 milestone Dec 7, 2024
@BlackDog86 BlackDog86 force-pushed the 1398-Overlapping-Voicelines-Fix branch from f96892e to 7765a8f Compare December 7, 2024 16:23
@BlackDog86
Copy link
Contributor Author

BlackDog86 commented Dec 7, 2024

Happy with the checks on X2Action_ApplyWeaponDamageToUnit is working properly but not happy with checking the visualizer state for the the delayed 'SquadMemberDead' line. If the visualizer progresses immediately onto something else (e.g. if alien unit 1 kills xcom unit 1 then alien unit 2 does something straight afterwards), then it can progress onto the next action seamlessly before playing the squadmemberdead line (which usually means waiting until the start of the next turn for the line to play) - ultimately, relying on idle state of the visualizer was not very effective. I had tried with static delays earlier in testing, which worked reasonably well, in any case much better than overlapping with the death screams, but with long visualization blocks it can still overlap a little with other stuff that's going on. I've tested this with several delay times and foun ~2.5 seconds to be around the sweet spot so I've set that directly in the PR for now. We could make it a configurable variable in CHHelpers if preferred.

@BlackDog86 BlackDog86 force-pushed the 1398-Overlapping-Voicelines-Fix branch 3 times, most recently from a1c22e8 to d1bb889 Compare December 7, 2024 18:15
@BlackDog86 BlackDog86 added the ready-to-review A pull request is ready to be reviewed label Dec 7, 2024
@BlackDog86 BlackDog86 changed the title Adjust voiceline checks in X2Action_ApplyWeaponDamageToUnit and add a dynamic delay to the 'SquadMemberDead' voiceline Adjust voiceline checks in X2Action_ApplyWeaponDamageToUnit and add a delay to the 'SquadMemberDead' voiceline Dec 8, 2024
@BlackDog86 BlackDog86 force-pushed the 1398-Overlapping-Voicelines-Fix branch 2 times, most recently from c7fa5f4 to 34b6042 Compare December 8, 2024 10:36
Copy link
Contributor

@Iridar Iridar left a comment

Choose a reason for hiding this comment

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

This is mostly good to go, just needs minor docs / styling changes.

@Iridar
Copy link
Contributor

Iridar commented Dec 10, 2024

Tested, works great.

@Iridar Iridar added waiting-on-author A pull request is waiting on changes from the author and removed ready-to-review A pull request is ready to be reviewed labels Dec 10, 2024
@BlackDog86
Copy link
Contributor Author

Pushed a new version with your requests - Just need to test it after making that function private before finalising.

@BlackDog86 BlackDog86 force-pushed the 1398-Overlapping-Voicelines-Fix branch 3 times, most recently from 5e906a1 to 70992c9 Compare December 10, 2024 19:38
@BlackDog86 BlackDog86 added ready-to-review A pull request is ready to be reviewed and removed waiting-on-author A pull request is waiting on changes from the author labels Dec 10, 2024
@@ -264,6 +264,9 @@ var config bool bDisableAimAssist;
var config bool bForce24hClock;
var config bool bForce24hclockLeadingZero;

// Variable for Issue #1398 - Number of seconds to wait after a unit is killed before playing the 'OnSquadMemberDead' voiceline
var config int fSquadMemberDeadVoicelineDelay;
Copy link
Contributor

Choose a reason for hiding this comment

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

This is int now? Was this always int? It should be float.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Think it was, changed now

Copy link
Contributor

@Iridar Iridar left a comment

Choose a reason for hiding this comment

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

Needs just a bit more hair-licking.

@Iridar Iridar added waiting-on-author A pull request is waiting on changes from the author and removed ready-to-review A pull request is ready to be reviewed labels Dec 10, 2024
… voicelines playing when unit is killed. Added a delay to the SquadMemberDead voiceline in XGUnit so it doesn't overlap the death voicelines & other visualization.
@BlackDog86 BlackDog86 force-pushed the 1398-Overlapping-Voicelines-Fix branch from 70992c9 to 9e012b2 Compare December 11, 2024 01:13
@BlackDog86
Copy link
Contributor Author

Should be good to go - did a quick test and making the function private and changing the variable to float type hasn't effected anything functionally that I could notice.

@BlackDog86 BlackDog86 added ready-to-review A pull request is ready to be reviewed and removed waiting-on-author A pull request is waiting on changes from the author labels Dec 11, 2024
@Iridar Iridar added ready-for-merge the pull request was reviewed and is ready to be merged. and removed ready-to-review A pull request is ready to be reviewed labels Dec 11, 2024
@Iridar Iridar merged commit b0c60b8 into X2CommunityCore:master Dec 16, 2024
4 checks passed
@Iridar Iridar changed the title Adjust voiceline checks in X2Action_ApplyWeaponDamageToUnit and add a delay to the 'SquadMemberDead' voiceline Fix for overlapping voicelines when a squadmate dies and prevent incapacitated units from playing voicelines Dec 16, 2024
@BlackDog86 BlackDog86 deleted the 1398-Overlapping-Voicelines-Fix branch January 7, 2025 03:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-basegame ready-for-merge the pull request was reviewed and is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Overlapping voicelines on squadmate death
2 participants