HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

I need help with custom music please

07-21-2006, 06:50 PM#1
Nazra7
im making a map with cusom music and since this map is supposed to be played multi player i want certain music to play for certain players. is there a way to do this? example if a unit enters a region and that region has music i want that music to play only for the owner of the entering unit. how do i do this?
07-21-2006, 07:07 PM#2
Fireeye
well, you can't play a sound or music for only 1 Player (if it's possible i don't know the way), but you can set a sound for a region with
Sound - Play <your sound> at 100.00% volume, located at (Center of <your region>) with Z offset 0.00
to set the aoe you have to edit the variable in the Sound Editor.
BTW: Music will be always played for all Players expect you disabled the music under options
07-21-2006, 07:25 PM#3
Nazra7
is there a way to loop the sounds?
07-21-2006, 08:00 PM#4
illidan92
Yes there is a way to play a sound for a certain player. The easiest way is to download World Editor Unlimited and it will give you the trigger.
07-21-2006, 08:29 PM#5
Nazra7
@ illadin92 you mean if i download world editor unlimited i can play MUSIC for a certain player? if not:
@ Fireeye I tried to make it play the music in sounds at a region but you can hear ALL the sound musics all the way across the map i need to know how to make it stop playing the sound out side of the region it was created plz
07-21-2006, 08:36 PM#6
PipeDream
Sounds can be played for local players using the standard method.
Collapse JASS:
function PlaySoundBJ_forplayer takes player p, sound s returns nothing
  set bj_lastPlayedSound = s
  if (s != null) then
     if(p == GetLocalPlayer()) then
       call StartSound(s)
     endif
  endif
endfunction

function PlayMusic_forplayer takes player p, string musicfn returns nothing
  set bj_lastPlayedMusic = musicfn
  if(p == GetLocalPlayer()) then
    call PlayMusic(musicfn)
  endif
endfunction
07-21-2006, 09:20 PM#7
Nazra7
pipedream can you give me te jass code to make music play for owner of entering unit please? and tell me what to change to select what music to play?
07-21-2006, 10:04 PM#8
PipeDream
Convert what you've got right now (that plays for everyone) to custom text and replace PlaySoundBJ with PlaySoundBJ_forplayer. Copy and paste the above JASS into the custom script section. For the player, GetOwningPlayer(GetTriggerUnit())