Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 07-26-2005, 09:23 PM
raiden0899 raiden0899 is offline
Registered User
raiden0899's Avatar
Join Date: Oct 2004
Posts: 192
raiden0899 is on a distinguished road
Question Scripting Question

Is there a way to check what midi is currently being played?
Reply With Quote
  #2  
Old 07-26-2005, 09:27 PM
Bl0nkt Bl0nkt is offline
Era Developer
Bl0nkt's Avatar
Join Date: Mar 2005
Location: Pennsylvania
Posts: 1,589
Bl0nkt will become famous soon enough
Send a message via AIM to Bl0nkt
Quote:
Originally Posted by raiden0899
Is there a way to check what midi is currently being played?
You could try setting a string to what the name of the midi is.

Example:
playmidi whatever.mid;
setstring client.midi,whatever;


Then set something like:
showtext index,x,y,font,style,Now playing: #s(client.midi);

I hope you know what I'm talking about.
Reply With Quote
  #3  
Old 07-26-2005, 09:50 PM
raiden0899 raiden0899 is offline
Registered User
raiden0899's Avatar
Join Date: Oct 2004
Posts: 192
raiden0899 is on a distinguished road
Question

that works. i changed my script (its a radio) to play a song from a URL that is stored in a serverr.string. to play the midi i used "play #s(serverr.string);" but it wont play. does anyone know how to make it work?
Reply With Quote
  #4  
Old 07-26-2005, 09:52 PM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
Have you tried showing it in a message?
message #s(serverr.string);
Add that to a level, check if it's actually detecting it.
__________________
Reply With Quote
  #5  
Old 07-26-2005, 10:01 PM
raiden0899 raiden0899 is offline
Registered User
raiden0899's Avatar
Join Date: Oct 2004
Posts: 192
raiden0899 is on a distinguished road
Quote:
Originally Posted by xAndrewx
Have you tried showing it in a message?
message #s(serverr.string);
Add that to a level, check if it's actually detecting it.
its detecting it. it just wont play it
Reply With Quote
  #6  
Old 07-27-2005, 12:26 AM
Blitz_Hunter Blitz_Hunter is offline
dot dot dot
Blitz_Hunter's Avatar
Join Date: Oct 2002
Location: Missouri
Posts: 601
Blitz_Hunter is on a distinguished road
Send a message via AIM to Blitz_Hunter
Make sure your audio sounds are turned up in options. ;P Alof of times people say they can't hear the radio cause their midi/mp3 sounds are turned off.
__________________
-em3ricR-
Reply With Quote
  #7  
Old 07-27-2005, 03:11 AM
excaliber7388 excaliber7388 is offline
Banned
excaliber7388's Avatar
Join Date: Jul 2005
Location: US
Posts: 5,229
excaliber7388 can only hope to improve
Send a message via AIM to excaliber7388
you could try this:
{play midi;
set midi name from above;}
then for another NPC that would check it:
if(midi name from above){do something;}
it would work, but why would you need it?
Reply With Quote
  #8  
Old 07-27-2005, 02:19 PM
ZeroTrack ZeroTrack is offline
G2K1 Developer
ZeroTrack's Avatar
Join Date: Apr 2004
Location: LongIsland, NY
Posts: 402
ZeroTrack is on a distinguished road
Send a message via AIM to ZeroTrack
Quote:
Originally Posted by raiden0899
its detecting it. it just wont play it
the string has to be sent back to the client from serverside for some reason =/
__________________

Reply With Quote
  #9  
Old 07-27-2005, 06:51 PM
raiden0899 raiden0899 is offline
Registered User
raiden0899's Avatar
Join Date: Oct 2004
Posts: 192
raiden0899 is on a distinguished road
Here's why i use serverr.strings:

For each station, a different song is played and a different message is displayed. instead of having to change the NPC script everytime someone wanted to change the song or display a different message, i stored the message and song filename as serverr.strings. now all i have to do is go into server flags and change them.

Here's the problem:

When i change the song stored in the serverr.string, everyone using the radio has to turn it off then on to hear the new song. because of this, i put the play command in a timeout loop. to keep them from being played every 0.05 seconds, i need a way to check if the song stored in the serverr.string isnt already being played.
Reply With Quote
Reply


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 07:55 AM.


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