Custom zone music--finally!
I finally figured out how to launch a custom music file for a zone (or, for that matter, a proximity). Just use the perl "system" command as a function in a .pl script, a DOS batch file, and a music clip. Here's how it works.
To get custom "mood" music to play when entering a zone: 1. Create a music clip (in this case, I named it zone.mp3). Place this clip in the desired quest\zone folder. 2. Place the following script in the quest\zone\player.pl file (if player.pl does not exist in that folder, create it): Code:
sub EVENT_ENTERZONE Code:
@echo off Although I have not yet attempted it, the same "system" command could be used in an NPC .pl in a sub EVENT_ENTER event after proximity has been set in the sub EVENT_SPAWN event. One drawback: the media player will pop up on top of the screen when it launches the file, but an alt-tab back to the screen hides it. I have not yet figured out how to keep that from happening. |
Well, it appears I still have a bit of work to do on this. When the files are distributed to the client, and the client character zones, the music plays on the server side instead of the client side. I'm sure this would be an easy fix by someone here, but I'll keep working on it till I find a solution.
|
So far no success in getting the music to play on the client machine.
The statement $client->system("$zone_music"); doesn't seem to want to respond. The statement system("$zone_music"); works well for the server side, but each time a client enters a different zone, that zone's music begins to play on the server side but not on the client side. If I could find a perl command like "system" that will execute a batch file on the client machine, this would work like a charm. Does anyone know of such a command? |
All times are GMT -4. The time now is 04:35 PM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.