Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Kaotac
Beginner


Joined: 26 Mar 2007
Posts: 16
Location: Australia

PostPosted: Sun Jan 06, 2008 12:49 am   

#playing random sounds?
 
Is it possible to set a trigger to #play a random sound from a list?

Would it be something like #play {num1.wav|num2.wav|num3.wav}
Or like #play %random num1.wav|num2.wav|num3.wav

Also, will Zmud play .ogg files?
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Sun Jan 06, 2008 1:11 am   
 
Yes, use #case or %case with %random as a value for the number. For example:

#play %case(%random,num1.wav,num2.wav,num3.wav)

As for ogg files, I believe it can play anything you have a codec for, but the easiest way to find out is to try it and see.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Sun Jan 06, 2008 6:34 am   
 
Or, as I've suggested in the past...

#VAR sounds {num1.wav|num2.wav|num3.wav}
#ALIAS addsound {#additem sounds {%1}}
#play %item(@sounds, %random(1, %numitems(@sounds)))

That way, when you have another sound to add, you don't have to edit the trigger, just type "addsound num4.wav" and everything will be set up correctly.

Charneus
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net