Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Music on level with weapon (https://forums.graalonline.com/forums/showthread.php?t=134256826)

sssssssssss 11-06-2009 03:42 AM

Music on level with weapon
 
I have this script, that should be playing the music.
When it was in the level scripts, the mp3 file just needed to be in the base part of the main graal folder, e.g. C:/Graal. I put the mp3 in the music folder and the main folder, and nothing plays. It does say in F3 options that it has the right name to play, and changes as I go to the levels needed, but no sound comes out. One of the mp3's is the same that used to work fine on a level npc.

PHP Code:

//#CLIENTSIDE
function onCreated()
{
  
setTimer(0.05);
}
// Music
function onTimeout(){
  if (
player.level.name == "crosscastle_1c10.nw"){
    
playlooped("armageddon-saljiut.mp3");
  }
  if (
player.level.name == "crosscastle_1d10.nw"){
    
playlooped("armageddon-saljiut.mp3");
  }
  if (
player.level.name == "crosscastle_1b05.nw"){
    
playlooped("armageddon-lystra.mp3");
  }
  if (
player.level.name == "crosscastle_1b04.nw"){
    
playlooped("armageddon-lystra.mp3");
  }
  if (
player.level.name == "crosscastle_1c05.nw"){
    
playlooped("armageddon-lystra.mp3");
  }
  if (
player.level.name == "crosscastle_1c04.nw"){
    
playlooped("armageddon-lystra.mp3");
  }

  
setTimer(0.05);



fowlplay4 11-06-2009 04:10 AM

I know this doesn't help your problem but you should consider using arrays and get rid of the timeout loop, onPlayerEnters will work fine.

PHP Code:

//#CLIENTSIDE 
// Music 
function onPlayerEnters(){ 
  
temp.saljiut = {
    
"crosscastle_1c10.nw""crosscastle_1d10.nw"
  
}
  
temp.lystra = {
    
"crosscastle_1b05.nw""crosscastle_1b04.nw",
    
"crosscastle_1c05.nw""crosscastle_1c04.nw"
  
}
  if (
player.level.name in temp.saljiut) { 
    
playlooped("armageddon-saljiut.mp3"); 
  } 
  else if (
player.level.name in temp.lystra) { 
    
playlooped("armageddon-lystra.mp3"); 
  } 


Try placing the files in the music folder, then delete your filenamecache file, and reload Graal so it has to go through your Graal folder and files again.

salesman 11-06-2009 04:17 AM

Are you getting any failed downloads in the F2 console?

Make sure you have .mp3 listed in the folder config where the files are saved, i think

sssssssssss 11-06-2009 05:15 AM

yeah, its saying its not found in f2, but its in the main root graal folder for sure, and its the same name in the script as the name of the mp3. Its not on rc, shouldnt have to be, on the level npc script it worked fine when the file was in my C:/Graal folder without being on rc.

Quote:

Originally Posted by fowlplay4 (Post 1536806)
Try placing the files in the music folder, then delete your filenamecache file, and reload Graal so it has to go through your Graal folder and files again.

Tried doing that and placing in levels/music, then in just C:/Graal, no go.

sssssssssss 11-07-2009 02:34 AM

Any other ideas why it wouldnt find it? it makes no sense to me. :(

salesman 11-07-2009 06:17 AM

You should really try uploading it on RC...if it's saying file not found, that's more than likely the problem.

sssssssssss 11-07-2009 09:24 PM

thats why :/

sssssssssss 11-08-2009 01:03 AM

We were gonna use mp3, but this is graal, so screw it midis it is. :)

LoneAngelIbesu 11-08-2009 01:12 AM

I would imagine your problem is that it starts playing every 0.05 seconds. Stop using a timeout.

sssssssssss 11-08-2009 01:29 AM

I did, i changed that. My problem isnt that it starts playing every 0.05 seconds, because....

Quote:

Originally Posted by sssssssssss (Post 1536817)
yeah, its saying its not found in f2, but its in the main root graal folder for sure, and its the same name in the script as the name of the mp3. Its not on rc, shouldnt have to be, on the level npc script it worked fine when the file was in my C:/Graal folder without being on rc.


Tried doing that and placing in levels/music, then in just C:/Graal, no go.

...like i stated before, the file isnt being found.

LoneAngelIbesu 11-08-2009 01:42 AM

Quote:

Originally Posted by sssssssssss (Post 1537205)
I did, i changed that.

It would help if you updated your script in the OP. ^^

Anyways, have you tried putting your files in the /sounds/ directory?

Why are you doing it this way, anyways? Nobody but you is going to be able to hear the music...

fowlplay4 11-08-2009 01:49 AM

I'd recommend finding a web-host that people could stream the music files from, than just use a url like so:

playlooped("http://www.somewhere.com/else/audio.mp3");

OR

Request an increase in download-able file sizes, so you can upload them to your server and just use the play command like normal.

sssssssssss 11-08-2009 02:13 AM

It's really not a big deal, b/c most people play w/o sound anyways. I thought about streaming it after these problems started, but decided that its just easier to use midis, at least for now. ty though peoples. :)

sssssssssss 11-08-2009 02:19 AM

Something else strange has happened now. I have this weapon playing the midis.

PHP Code:

//#CLIENTSIDE
// Music  
function onPlayerEnters(){  
  
temp.saljiut = { 
    
"crosscastle_1c10.nw""crosscastle_1d10.nw" 
  
};
  
temp.lystra = { 
    
"crosscastle_1b05.nw""crosscastle_1b04.nw"
    
"Crosscastle_1c05.nw""crosscastle_1c04.nw" 
  
};
  
temp.onlinestart "armageddon-onlinestart.nw";
  if (
player.level.name in temp.saljiut) {  
    
playlooped("armageddon-saljiut.mid");  
  }  
  else if (
player.level.name in temp.lystra) {  
    
playlooped("armageddon-lystra.mid");  
  }  
  else if (
player.level.name == temp.onlinestart){
    
playlooped("armageddon-onlinestart.mid");
  }


and took out all the level npcs that were playing music before. but I keep having the music stop in 1 level, and get this error in F2.

Quote:

Data directory: C:/Program Files/Graal/
Scanning folder structure of C:/Program Files/Graal/...
Done.File download: shopglobal_gelat.png not found
File download: 0.wav not found
File download: sde-armageddon-town1.mp3 not found
File download: 0.wav not found
File download: sde-armageddon-town1.mp3 not found
File download: 0.wav not found
File download: sde-armageddon-town1.mp3 not found
File download: armageddon-lystra.mid (size: 7173) done
File download: 0.wav not found
File download: sde-armageddon-town1.mp3 not found
File download: 0.wav not found
File download: sde-armageddon-town1.mp3 not found
File download: rc_graalonline.jpg not found
No clue what 0.wav is, never had anything like that, and sde-armageddon-town1.mp3 was taken out of the level a long long time ago.

I double checked the level, and did a scan on all levels, weapons, and classes in rc, and it said it didnt fine "sde-armageddon-town1" in any of them. So any other ideas anyone may have would be helpful, because its really annoying.

Mark Sir Link 11-08-2009 02:35 AM

Quote:

Originally Posted by sssssssssss (Post 1537205)
...like i stated before, the file isnt being found.

upload it on RC and make sure you have in the folder options

file folder/folder/*.mp3

probably levels/music?

LoneAngelIbesu 11-08-2009 03:20 AM

Quote:

Originally Posted by sssssssssss (Post 1537235)
I double checked the level, and did a scan on all levels, weapons, and classes in rc, and it said it didnt fine "sde-armageddon-town1" in any of them. So any other ideas anyone may have would be helpful, because its really annoying.

Not sure how scanning works. Have you opened the level as text and checked?

sssssssssss 11-08-2009 03:29 AM

I checked in notepad, nothings there.

Quote:

Originally Posted by Mark Sir Link (Post 1537240)
upload it on RC and make sure you have in the folder options

file folder/folder/*.mp3

probably levels/music?

Im not wanting it to work, and it thinks its there for some reason. Its out of everything.

sssssssssss 11-10-2009 09:49 PM

Is there any other thing i can check? any other possibility it would be doing this?

sssssssssss 11-13-2009 04:18 AM

would a gserver reset be logical with this problem, the lv4 sword problem, and the bomb and arrow problem on the server?


All times are GMT +2. The time now is 03:45 PM.

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