||This article or section is outdated and has not been updated to reflect the release of SRB2 v2.2.
Please help the Wiki by correcting or removing any misinformation, as well as adding any new information to the page.
Update for 2.2.0:
- Var2 upper 16 bits determines if sound should play during preticker or not
A_PlaySound is an action that plays a sound effect. Var1 determines the sound ID. If Var2 is set to 0, the sound is played without an origin, if set to 1, the actor is used as the sound's origin.
Code – A_PlaySound
// Function: A_PlaySound
// Description: Plays a sound
// var1 = sound # to play
// lower 16 bits = If 1, play sound using calling object as origin. If 0, play sound without an origin
// upper 16 bits = If 1, do not play sound during preticker.
void A_PlaySound(mobj_t *actor)
INT32 locvar1 = var1;
INT32 locvar2 = var2;
if (LUA_CallAction("A_PlaySound", actor))
if (leveltime < 2 && (locvar2 >> 16))
S_StartSound((locvar2 & 65535) ? actor : NULL, locvar1);