Search the Commands

Home  All  a  b  c  d  e  f  g  h  i  j  k  l  m  n  o  p  q  r  s  t  u  v  w  x  y  z 

Details for command soundeffect:
 
* soundeffect "effect filename",<number>;
* soundeffectall "effect filename",<number>{,<coverage>{,"mapname",<x0>,<y0>,<x1>,<y2>}};
 
These two commands will play a sound effect to either the invoking character
only 'soundeffect' or everyone around ('soundeffectall'). If the running code
does not have an object ID (a 'floating' npc) or is not running from an NPC
object at all (an item script) the sound will be centered on the character who's
RID got attached to the script, if any. If it does, it will be centered on that
object. (an NPC sprite)

Effect filename is the filename of the wav in GRF. It must have an extension.

It's not quite certain what the number actually does, it is sent to the client
directly, probably it determines which directory of the GRF the effect is played
from - the sound effect type. It's certain that giving 0 for the number will
play sound files from 'data/wav', but where the other numbers will read from is
unclear.

You can add your own effects this way, naturally.

At some point, [Lance] improved the soundeffectall by adding some optional arguments. Coverage is probably the amount of cells around the attached person in which people will hear the sound. I (Dj-Yhn) assume this, because when it is bigger then 22, it uses the other optional arguments, the mapname and x0,y0,x1,y1 area. Thus, when coverage is 23 or higher, everyone inside the square defined by x0,y0,x1,y1 on the given map will hear the sound. This works kinda like areaannounce.

Valid XHTML 1.0 Strict Valid CSS!