Skip to content

UserTrackSkip button detection and removal of duplicate definitions in eSoundID - #327

Closed
KharonGitHub wants to merge 4 commits into
DK22Pac:masterfrom
KharonGitHub:Pull-Request-branch
Closed

UserTrackSkip button detection and removal of duplicate definitions in eSoundID#327
KharonGitHub wants to merge 4 commits into
DK22Pac:masterfrom
KharonGitHub:Pull-Request-branch

Conversation

@KharonGitHub

@KharonGitHub KharonGitHub commented Aug 16, 2026

Copy link
Copy Markdown

CPad:
Added the User Track Skip button (F5, only in radio mode) press detection.
eSoundID:
Whenever there was an explicit value assigned, i kept that definition

Added the User Track Skip button (F5, only in radio mode) press detection.
Added the User Track Skip button (F5, only in radio mode) press detection.
Parity with rest of the functions.
@KharonGitHub KharonGitHub changed the title UserTrackSkip button detection. UserTrackSkip button detection and removal of duplicate definitions in eSoundID Aug 16, 2026
@MiranDMC

Copy link
Copy Markdown
Contributor

Can you create some example plugin showing usage of eSoundID?


void CPad::ClearMouseHistory() {
plugin::Call<0x541BD0>();
} No newline at end of file

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 are these unrelated changes?

Comment thread plugin_sa/game_sa/CPad.h
VALIDATE_OFFSET(CPad, AverageEntries, 0x128);
VALIDATE_OFFSET(CPad, NoShakeBeforeThis, 0x12C);
VALIDATE_OFFSET(CPad, NoShakeFreq, 0x130);
VALIDATE_SIZE(CPad, 0x134); No newline at end of file

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.

Same here.

@KharonGitHub

Copy link
Copy Markdown
Author

Thanks for asking for clarification as that eSoundID would've been completely wrong!
I've updated the enum to what i believe is now correct and verified it with the provided code.

eSoundID - Testing Verison.txt

In this version I've renamed every "repeating" definition to use prefix _2 as it would not compile with redefinitions.

eSoundIDTest.txt

Overview:
Switch the definition pairs using 1/2.
Play first definition using 3.
Play _2 definition using 4.
Play known good ID using 5.

Key 3 uses "CommandCommands::LOAD_MISSION_AUDIO"
Both key 2/5 use "CommandCommands::ADD_ONE_OFF_SOUND" as they share same id ranges.

Results:
Known good ID plays a sound.
First instances of redefinition do not.
_2 instance plays a sound.

All _2 instances seem to be playing the right sound that corresponds to their names.

From my understanding, what I've learned over at GTA SA Reversed repo, is that the ids are hardcoded into functions themselves, so a lot of ids can actually be unused, it's not just these 42 that i've found.
These however stop the header from compiling so my best resolution to this issue is just rename them with a _UNUSED prefix to allow it to compile.

One outlier was SOUND_SECURITY_ALARM, as it was defined as ID 41800 and 42801.
Both of these IDs worked, they are 2 different alarms so i renamed the last id as SOUND_SECURITY_ALARM_2.
If we want to be more descriptive we could go with SOUND_SECURITY_ALARM_MILITARY as this is the alarm that's used in the mission Black Project inside the area 69.

@MiranDMC

Copy link
Copy Markdown
Contributor

You get there and start randomly renaming stuff. That is no improvement of any kind, and if so you would need to update breaking changes readme file.

I still do not see example project showing usage of the enum. Unused probably does not mean there is nothing to play.

@KharonGitHub

KharonGitHub commented Aug 17, 2026

Copy link
Copy Markdown
Author

Valid concern, once I have some time I'll update the breaking changes readme file and show you an example of my radio mod I've been working on which needed another native to SA audio classes which use eSoundID.h.

I didn't try to just change it for the sake of it, at the moment whenever i would include this enum anywhere it would stop the SDK from compiling at all due to redefinition hence why i created that test to verify if these are actually getting played.

@KharonGitHub
KharonGitHub marked this pull request as draft August 17, 2026 06:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants