The Daily Click ::. Forums ::. Klik Coding Help ::. Zombie moaning depending on crowd size.
 

Post Reply  Post Oekaki 
 

Posted By Message

AsparagusTrevor

Mine's a pint of the black stuff

Registered
  20/08/2002
Points
  2364

Game of the Week WinnerHas Donated, Thank You!VIP MemberEvil kliker
24th November, 2004 at 21:29:57 -

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.

Image Edited by the Author.

 
Image

Radix

hot for teacher

Registered
  01/10/2003
Points
  3139

Has Donated, Thank You!VIP MemberGOTW WINNER CUP 1!GOTW WINNER CUP 2!GOTW WINNER CUP 3!GOTW WINNER CUP 4!
24th November, 2004 at 21:54:01 -

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.

Image Edited by the Author.

 
n/a

AsparagusTrevor

Mine's a pint of the black stuff

Registered
  20/08/2002
Points
  2364

Game of the Week WinnerHas Donated, Thank You!VIP MemberEvil kliker
24th November, 2004 at 22:03:41 -

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.

EDIT: That works great, cheers.

Image Edited by the Author.

 
Image

jast



Registered
  03/01/2014 01:12:19
Points
  186
25th November, 2004 at 02:11:43 -

You could just set an alterable value of the zombie to some random value and play the sound each time the alt val is = 0. Easy.

 
n/a

AsparagusTrevor

Mine's a pint of the black stuff

Registered
  20/08/2002
Points
  2364

Game of the Week WinnerHas Donated, Thank You!VIP MemberEvil kliker
25th November, 2004 at 09:59:18 -

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.

Image Edited by the Author.

 
Image
   

Post Reply



 



Advertisement

Worth A Click