Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 12-16-2015, 02:36 PM
scriptless scriptless is offline
Banned
Join Date: Dec 2008
Location: N-Pulse
Posts: 1,412
scriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to behold
playlooped won't stop

So I was using playlooped() and I noticed that if I did stopmusic() it didn't always stop the music. Actually sometimes I could hear multiple songs playing at once. Does anyone have any ideas how to get songs to stop?
Reply With Quote
  #2  
Old 12-16-2015, 04:58 PM
Elk Elk is offline
Sr Marketing Strategist
Elk's Avatar
Join Date: Nov 2005
Location: Deerland
Posts: 3,829
Elk has a brilliant futureElk has a brilliant futureElk has a brilliant futureElk has a brilliant futureElk has a brilliant futureElk has a brilliant futureElk has a brilliant future
Send a message via ICQ to Elk Send a message via AIM to Elk Send a message via MSN to Elk Send a message via Yahoo to Elk
can you not index them by doing playlooped(1) and stopmusic(1) :0?
__________________
iEra IGN: *Elk (Darkshire)
iCla. IGN: *Elk (Darkshire)
iZone IGN: *Elk (Darkshire)




Reply With Quote
  #3  
Old 12-16-2015, 07:30 PM
ffcmike ffcmike is offline
Banned
Join Date: Jul 2004
Location: London
Posts: 2,029
ffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond repute
Send a message via AIM to ffcmike Send a message via MSN to ffcmike
What format are the music files?
Wav are treated as sound effects and are therefore unaffected by stopmusic(), for those you would have to use stopsound("filename");.
Reply With Quote
  #4  
Old 12-16-2015, 08:26 PM
scriptless scriptless is offline
Banned
Join Date: Dec 2008
Location: N-Pulse
Posts: 1,412
scriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to behold
Quote:
Originally Posted by Elk View Post
can you not index them by doing playlooped(1) and stopmusic(1) :0?
Not sure exactly what you mean by indexed?

Quote:
Originally Posted by ffcmike View Post
What format are the music files?
Wav are treated as sound effects and are therefore unaffected by stopmusic(), for those you would have to use stopsound("filename");.
There mp3 format, tho I didn't know that for wav. Will keep that in the mind for the future. Another thing I noticed was sometimes it plays the music very faintly then if it plays again it plays a louder version over the old one. Also I am only able to test only my mac at the moment and I know I get the same kinda bug on GK as well sometimes. Logging on other servers does not help and neither does reconnecting.
Reply With Quote
  #5  
Old 12-16-2015, 08:30 PM
ffcmike ffcmike is offline
Banned
Join Date: Jul 2004
Location: London
Posts: 2,029
ffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond repute
Send a message via AIM to ffcmike Send a message via MSN to ffcmike
Quote:
Originally Posted by scriptless View Post
Another thing I noticed was sometimes it plays the music very faintly then if it plays again it plays a louder version over the old one.
It sounds as if playlooped() is being invoked from a level NPC rather than a weapon?
Reply With Quote
  #6  
Old 12-16-2015, 09:56 PM
scriptless scriptless is offline
Banned
Join Date: Dec 2008
Location: N-Pulse
Posts: 1,412
scriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to behold
Quote:
Originally Posted by ffcmike View Post
It sounds as if playlooped() is being invoked from a level NPC rather than a weapon?
I am invoking it from a weapon npc actually, not a level npc. As well as invoking stopmusic() from a weapon npc too. The script I'm using is

PHP Code:
//#CLIENTSIDE
function onPlayerEnters() {
  
temp.song getmusicfilename(); // current song playing
  
if ( player.level == "desert2.nw" temp.song "stef49.mp3";
  if ( 
player.level == "level2.nw" temp.song "npulse_svrvilla.mp3";
  
  
// only play song if not already playing
  
if ( getmusicfilename() != temp.song) {
    
stopmusic();
    
playlooped(temp.song);
  }

Reply With Quote
  #7  
Old 12-17-2015, 03:58 AM
ffcmike ffcmike is offline
Banned
Join Date: Jul 2004
Location: London
Posts: 2,029
ffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond repute
Send a message via AIM to ffcmike Send a message via MSN to ffcmike
It looks as if getmusicfilename() may be acting faulty. You could try out-putting it's value for debugging to see if it's somehow being reset, and if necessary store the current playing song in a variable instead.

I actually use stopmidi() even though it's supposedly the same function as stopmusic() and kept just for compatibility purposes, does this work better?

Also while this is not the problem here player.level is an object, to compare it with a string it's better to use "player.level.name".
Reply With Quote
  #8  
Old 12-17-2015, 05:04 AM
scriptless scriptless is offline
Banned
Join Date: Dec 2008
Location: N-Pulse
Posts: 1,412
scriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to behold
Quote:
Originally Posted by ffcmike View Post
It looks as if getmusicfilename() may be acting faulty. You could try out-putting it's value for debugging to see if it's somehow being reset, and if necessary store the current playing song in a variable instead.

I actually use stopmidi() even though it's supposedly the same function as stopmusic() and kept just for compatibility purposes, does this work better?

Also while this is not the problem here player.level is an object, to compare it with a string it's better to use "player.level.name".
Actually stopmidi() doesn't work any better for me. Regardless of what getmusicfilename() returns I would still think that adding a stopmusic() to a onCreated() of another weapon would have stopped it, but it didn't.

As for the player.level being an object. I knew I should have been using player.level.name.. but I guess I never thought of player.level as an actual object itself, thats neat. I'll change that right away but still looking for ideas on the music. Would love to test out on PC to see if it's maybe a mac bug or for everyone.

Also, I am very disappointed that midi no longer work with graal.. they were so awesome

Last edited by scriptless; 12-17-2015 at 05:28 PM..
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 12:50 AM.


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