Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Graal Main Forum (English) (https://forums.graalonline.com/forums/forumdisplay.php?f=4)
-   -   How do I add music (https://forums.graalonline.com/forums/showthread.php?t=134269158)

Xadis 04-14-2014 12:17 PM

How do I add music
 
How can I add music to a server..

Jakov_the_Jakovasaur 04-14-2014 05:13 PM

hello!

first you need to ensure that custom music files can be downloaded by the clients of other players, to do this you need to add an entry to your servers 'Folderconfig'

for the sake of an example, i am currently creating a server called Lardene (after my great grandmother, bless her soul :cry:), so in folder config i have added:

file music/lardene_*.mp3

'file' means that this is a custom file rather than a level/sword/shield/head/body, 'music' is the name of the folder i have assigned for music because i like to keep my server organised, 'lardene_' is the prefix i use because you should always identify your servers files to avoid conflict (and force them to download to a convenient folder), and the '*' is a wildcard which allows any filename beyond the prefix, and ending it with 'mp3' means this only works for mp3 files

then you want to ensure that you can actually upload music files to this folder, so in rc type '/openrights', then click the 'Folder Rights' tab, and add a line such as 'rw levels/music/lardene_*.mp3', and finally save your rights

once this is setup and you have uploaded the file to the specified folder you can now play the music file clientside through script, a very basic example of how to do this within a singular level npc is as follows:

PHP Code:

//#CLIENTSIDE
function onPlayerEnters()
  
playlooped("lardene_inside_01.mp3"); 

i personally recommend joining a class script to npcs rather than playing files directly, so that if you want to change the way music plays you dont then have to go back and edit a lot of different npcs, an alternative would be to play music within a weapon npc according to what level you are within, which is helpful for playing music on gmaps

happy to be of help!


All times are GMT +2. The time now is 10:08 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.