A_StartSound not playing in netevent

Is there something that doesn't work right in the latest GZDoom? Post about it here.

Moderator: GZDoom Developers

Forum rules
Please construct and post a simple demo whenever possible for all bug reports. Please provide links to everything.

If you can include a wad demonstrating the problem, please do so. Bug reports that include fully-constructed demos have a much better chance of being investigated in a timely manner than those that don't.

Please make a new topic for every bug. Don't combine multiple bugs into a single topic. Thanks!
User avatar
arookas
Posts: 265
Joined: Mon Jan 24, 2011 6:04 pm

A_StartSound not playing in netevent

Post by arookas »

If you call A_StartSound on an actor in a manual netevent in single player, the sound fails to start unless you specify the CHANF_LOOP or CHANF_NOPAUSE flags.

Code: Select all

actor.A_StopSound(CHAN_VOICE);

actor.A_StartSound(
  "misc/secret",
  slot: CHAN_VOICE,
  flags: CHANF_DEFAULT,
  attenuation: ATTN_NONE
);

Console.Printf("working? %s",
  actor.IsActorPlayingSound(CHAN_VOICE)
  ? "yes" : "no"
);
If the above code runs inside a NetworkProcess, the console will print "working? no" and the sound will not play once you close the console. However, just by changing the flags to CHANF_LOOP (or CHANF_NOPAUSE) the console will now print "working? yes" and the sound will play once you close the console (or immediately if CHANF_NOPAUSE).

This could be behaving as expected but I'd expect the intuitive behavior would be to start the sound paused until you close the console, as it does for CHANF_LOOP, just minus the looping at the end of course.

The included demo.zip includes a minimal zscript.txt + mapinfo.txt to load on DOOM 2 MAP01. You can try calling netevent test in the console to see the sound not play, and try binding it to a key to see it working outside the console.
You do not have the required permissions to view the files attached to this post.

Return to “Bugs [GZDoom]”