Question about $limit and random sounds

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
User avatar
Enjay
 
 
Posts: 26535
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland

Question about $limit and random sounds

Post by Enjay »

Graf Zahl wrote:I doubt that will help. They are already limited to 2 by default but the Hammerhound's sounds are all random so the $limit will have little to no effect.
That's reminded me of something that I have been wondering about for some time. I'm not sure how much effect $limit has on random sounds. I wondered if, perhaps, if you limited the randomised sound name it would only ever play the $limit number of sounds from those possible. ie

Code: Select all

$random sounds {sound1 sound2 sound3 sound4}
$limit sounds 1
Would only ever allow 1 choice from the 4 possible to play at the same place at any one time.


However, judging by what you said, you can only $limit the sub-sounds ie

Code: Select all

$limit sound1 1
$limit sound2 1
$limit sound3 1
$limit sound4 1
Which presumably means that, potentially, the $random sound could theoretically be playing 1 copy of each of the 4 sounds at any one time?
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49095
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Question about $limit and random sounds

Post by Graf Zahl »

Limits and random sounds are a bit tricky.

If the random sound had its own limit that is applied to the sound being played - separately for each sub-sound because sounds don't know if they were picked out of a random list.

What's more important is that the limit is not absolute. Internally it's called NearLimit. In other words that means that only $limit sounds are allowed within a certain distance of each other. If the same sound is made in a large enough distance (256 map units) the limit does not apply.
User avatar
Enjay
 
 
Posts: 26535
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland

Re: Question about $limit and random sounds

Post by Enjay »

OK, I understand what's going on now. I knew about the 256 map unit part, but wasn't sure about the rest. Thank you.

Return to “Editing (Archive)”