Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Scripting Question (https://forums.graalonline.com/forums/showthread.php?t=60181)

raiden0899 07-26-2005 09:23 PM

Scripting Question
 
Is there a way to check what midi is currently being played?

Bl0nkt 07-26-2005 09:27 PM

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.

raiden0899 07-26-2005 09:50 PM

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?

xAndrewx 07-26-2005 09:52 PM

Have you tried showing it in a message?
message #s(serverr.string);
Add that to a level, check if it's actually detecting it.

raiden0899 07-26-2005 10:01 PM

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

Blitz_Hunter 07-27-2005 12:26 AM

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.

excaliber7388 07-27-2005 03:11 AM

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?

ZeroTrack 07-27-2005 02:19 PM

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 =/

raiden0899 07-27-2005 06:51 PM

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.


All times are GMT +2. The time now is 07:41 AM.

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