u didn't understand me right)You need to export the file, then import it to world editor and use it as a sound in sound editor, it's easy.
In your case you might want to use this instead:I am pretty sure you need a variable from the sound editor to use it in GUI? I'd imagine it works in jass I suppose..
edit: Using PlaySound() might work since it takes a string.. I did only test in GUI before which use PlaySoundBJ()
native PlayMusic takes string musicName returns nothing
native GetSoundFileDuration takes string musicFileName returns integer
In your case you might want to use this instead:
native PlayMusic takes string musicName returns nothing
You can check if the external music file exists by using this:
native GetSoundFileDuration takes string musicFileName returns integer
... so, in GUI, it would look like this
This will only play the file if the player actually has it. Otherwise, it will just continue playing whatever music was issued before that (or keep on playing the default WC3 music if you haven't set any).
Set TempPlayer = Player 1
Set TempString = "MyExternalFolder\\MyMusic.mp3"
Custom Script: if GetLocalPlayer() == udg_TempPlayer then
Custom Script: if GetSoundFileDuration(udg_TempString) > 0 then
Custom Script: call PlayMusic(udg_TempString)
Custom Script: endif
Custom Script: endif
i can't make all players do that, i want to put all my files into archive and load them into game, thats why i can't use that metod, but anyway ty.Actually, it is very possible.
And even better: it doesn't even require an MPQ.
If players have local file support enabled, you can actually read and access any folder in the WC3 directory directly from within the game.
Just ship a folder with custom music for players to drop in the WC3 directory, then call the external music tracks via triggers.
You can find out if the folder exists or not by simply getting the length of the sound file. If it's 0, then the file doesn't exist and you can play a default music file instead.
No you don't need to overwrite anything.Either way, even in an archive, you would have to have players download your archive and overwrite theirs just to play your map. If you want all players to have custom music in a custom map then your best bet is to import them through the import manager.
Huh? Of course you can make all players do that. You just need to ship the folder together with your map. Obviously, every player that wants to hear the custom music needs the folder. Otherwise they will just hear the default music.i can't make all players do that, i want to put all my files into archive and load them into game, thats why i can't use that metod, but anyway ty.
because it weight a lotWhy play it from MPQ and not from map import?
But then how can players without the custom MPQ play it?