At least, if I understand correctly what it is supposed to do. From the description in wiki I get the impression that if I limit the amount of instances to 1, then while this sound is playing, another instance would not be played within the limitdistance.
However, in the example I present below, multiple instances clearly overlap. I'm gonna both paste the code and attach a zip file. I used "caco/sight" as the test sound because it's relatively long and illustrates the issue well.
SNDINFO:
Code: Select all
$alias Test_Sound caco/sight
$limit Test_Sound 1 256
// $singular Test_Sound
ZSCIPT
Code: Select all
version "3.3"
class TestActor : Actor
{
Default
{
+NOINTERACTION;
}
States
{
Spawn:
TNT1 A 3 A_StartSound("Test_Sound");
Loop;
Death:
Stop;
}
}
class TestActor2 : Actor
{
Default
{
+NOINTERACTION;
}
States
{
Spawn:
TNT1 A 3 A_StartSound("Test_Sound", flags: CHANF_NOSTOP);
Loop;
Death:
Stop;
}
}
Steps to reproduce (with GZDoom launched and Test1.zip in your mod folder):
1. Start a new game.
2. Open console and execute "summon TestActor". Hear the sounds.
3. Start a new game.
4. Open console and execute "summon TestActor2". Hear the sounds.
Expected results: both actors to sound the same: 1 sound plays until it ends, only then the next sound starts playing.
Actual results: TestActor1 starts playing the next sound each 3rd frame, despite "$limit Test_Sound 1 256" in the SNDINFO.
BTW, $singular in this example does not limit the sound instance to 1 either, which can be tested by commenting the line 3 and uncommenting the line 4 in the SNDINFO.
If I misunderstand what $limit is supposed to do, is it possible add a feature that implements such behavior? Using A_StartSound with CHANF_NOSTOP flag is not always possible. For example, see this topic: viewtopic.php?f=122&t=73990. Also, I'm sure there are other cases when it is simpler to achieve this limitation through SNDINFO rather than by using A_StartSound with CHANF_NOSTOP flag.
At least, if I understand correctly what it is supposed to do. From the description in wiki I get the impression that if I limit the amount of instances to 1, then while this sound is playing, another instance would not be played within the limitdistance.
However, in the example I present below, multiple instances clearly overlap. I'm gonna both paste the code and attach a zip file. I used "caco/sight" as the test sound because it's relatively long and illustrates the issue well.
SNDINFO:
[code]
$alias Test_Sound caco/sight
$limit Test_Sound 1 256
// $singular Test_Sound
[/code]
ZSCIPT
[code]
version "3.3"
class TestActor : Actor
{
Default
{
+NOINTERACTION;
}
States
{
Spawn:
TNT1 A 3 A_StartSound("Test_Sound");
Loop;
Death:
Stop;
}
}
class TestActor2 : Actor
{
Default
{
+NOINTERACTION;
}
States
{
Spawn:
TNT1 A 3 A_StartSound("Test_Sound", flags: CHANF_NOSTOP);
Loop;
Death:
Stop;
}
}
[/code]
Steps to reproduce (with GZDoom launched and Test1.zip in your mod folder):
1. Start a new game.
2. Open console and execute "summon TestActor". Hear the sounds.
3. Start a new game.
4. Open console and execute "summon TestActor2". Hear the sounds.
Expected results: both actors to sound the same: 1 sound plays until it ends, only then the next sound starts playing.
Actual results: TestActor1 starts playing the next sound each 3rd frame, despite "$limit Test_Sound 1 256" in the SNDINFO.
BTW, $singular in this example does not limit the sound instance to 1 either, which can be tested by commenting the line 3 and uncommenting the line 4 in the SNDINFO.
If I misunderstand what $limit is supposed to do, is it possible add a feature that implements such behavior? Using A_StartSound with CHANF_NOSTOP flag is not always possible. For example, see this topic: viewtopic.php?f=122&t=73990. Also, I'm sure there are other cases when it is simpler to achieve this limitation through SNDINFO rather than by using A_StartSound with CHANF_NOSTOP flag.