I've come to a point in Zombies Now where preciseness (or 'precision' to normal people) is paramount.
I have my zombies moaning 5 different wav sounds. What I want to happen is the moan to be chosen randomly at random intervals, but I want the frequency of the random intervals to be dependent on the number of zombies.
In other words, the more zombies there is, the more moaning. I know how to do this in rough fashion, but I'd rather it be precise to the number of zombies.
So does anyone know a magical equation that could help me out, or just some kinda cool method I could use?
Thanks in advance.
Yeah. Have an event that randomly decides whether or not to play a sound and which one, ie set some value to random(50), with values 1,2,3,4,5 playing a zombie noise and resetting it to 0, and values 6-49 doing nothing. Stick the trigger for this event in a fastloop (with the condition that none of these noises are playing) and then:
every 00"-30 (or whatever)
- Start loop [whatever] for NObjects( "zombies" ) loops
Add em, if you've got more'n one zombie object:
every 00"-30 (or whatever)
- Start loop [whatever] for (NObjects( "zomb1" )+NObjects( "zomb2 )+NObjects( "zomb3" )) loops
Edit:
Tpyos, oh and values 1-5 would each play a different noise, obviously.
Thanks a lot dude, I'll try that. Never even thought of using fastloops for it. I do actually have 5 zombie objects, but they're grouped as Enemies, so it should be okay.
I tried that actually, but it didn't seem to work. I dunno if it was because I have 5 different zombie sprites or what, or cos I'm using Tigerwork's Directsound for positional audio.