about bgm

Kei

New member
Messages
101
Points
0
can someone help/make me a script that the player will able to play a custom bgm i have ..?

thanks

 
Code:
*soundeffect "<effect filename>",<type>;*soundeffectall "<effect filename>",<type>{,"<map name>"}{,<x0>,<y0>,<x1>,<y1>};These two commands will play a sound effect to either the invokingcharacter only ('soundeffect') or multiple characters ('soundeffectall').If the running code does not have an object ID (a 'floating' NPC) or isnot running from an NPC object at all (an item script) the sound will becentered 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 in a GRF. It must have the .wav extension.It's not quite certain what the 'type' actually does, it is sent to theclient directly. It probably determines which directory to play the effectfrom. It's certain that giving 0 for the number will play sound files from'datawav', but where the other numbers will read from is unclear.The sound files themselves must be in the PCM format, and file namesshould also have a maximum length of 23 characters including the .wavextension:soundeffect "1234567890123456789.wav", 0; // will play the soundeffectsoundeffect "12345678901234567890.wav", 0; // throws gravity errorYou can add your own effects this way, naturally.
 
*soundeffect "<effect filename>",<type>;*soundeffectall "<effect filename>",<type>{,"<map name>"}{,<x0>,<y0>,<x1>,<y1>};These two commands will play a sound effect to either the invokingcharacter only ('soundeffect') or multiple characters ('soundeffectall').If the running code does not have an object ID (a 'floating' NPC) or isnot running from an NPC object at all (an item script) the sound will becentered 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 in a GRF. It must have the .wav extension.It's not quite certain what the 'type' actually does, it is sent to theclient directly. It probably determines which directory to play the effectfrom. It's certain that giving 0 for the number will play sound files from'datawav', but where the other numbers will read from is unclear.The sound files themselves must be in the PCM format, and file namesshould also have a maximum length of 23 characters including the .wavextension:soundeffect "1234567890123456789.wav", 0; // will play the soundeffectsoundeffect "12345678901234567890.wav", 0; // throws gravity errorYou can add your own effects this way, naturally.
can i change the extension to mp3 instead of wav?

 
Nope. You can also use playbgm, but keep in mind they do different things:

Code:
*playBGM "<BGM filename>";*playBGMall "<BGM filename>"{,"<map name>"{,<x0>,<y0>,<x1>,<y1>}};These two commands will play a Background Music to either the invoking character only ('playBGM') or multiple characters ('playBGMall').BGM filename is the filename in /BGM/ folder. It has to be in .mp3 extension, but it's not required to specify the extension in the script. If coordinates are omitted, BGM will be broadcasted on the entire map. If the map name is also omitted the BGM will be played for the entire server.You can add your own BGMs this way, naturally.
 
Nope. You can also use playbgm, but keep in mind they do different things:

*playBGM "<BGM filename>";*playBGMall "<BGM filename>"{,"<map name>"{,<x0>,<y0>,<x1>,<y1>}};These two commands will play a Background Music to either the invoking character only ('playBGM') or multiple characters ('playBGMall').BGM filename is the filename in /BGM/ folder. It has to be in .mp3 extension, but it's not required to specify the extension in the script. If coordinates are omitted, BGM will be broadcasted on the entire map. If the map name is also omitted the BGM will be played for the entire server.You can add your own BGMs this way, naturally.
thanks also is it possible to make a playlist for it? like when the first song finished playing another song will play and so on..

 
Yes and no. Not as the scripting language is, but you can make an array that specifies how many milliseconds a sonw will take to play, then when it's finished make it autoplay the next or another one.

 
Answered already,

.wav = data/wav

.mp3 = /BGM

and if you read Mumbles description it says

Description:

A radio NPC that plays preset selection of client-side songs (these songs are to be placed in the 'BGM' folder).
Sometimes try to read first
default_smile.png


 
Last edited by a moderator:
sorry i didn't see that .. btw i have a error

Code:
[Warning]: Unexpected type for argument 1. Expected variable, got C_STR.[Debug]: Data: string value="'As long as you love me' by Ohayou:"[Debug]: Function: set[Debug]: Source (NPC): Hercules Radio at prontera (164,158)[Error]: script:set: not a variable[Debug]: Data: string value="'As long as you love me' by Ohayou:"[Debug]: Source (NPC): Hercules Radio at prontera (164,158)
 
Sorry to bump this but it seems like with the recent builds all playbgm does is remove the currently played bgm instead of playing a new one.

Nevermind, apparently extension needs to be deleted.

 
Last edited by a moderator:
Back
Top