Custom sound looping music not working :?

Have questions about CoD/UO mapping that aren't covered in the tutorials section? Post here!

Moderator: Core Staff

Post Reply
captainkirk
CJ Wannabe
CJ Wannabe
Posts: 29
Joined: November 2nd, 2012, 11:30 am

Custom sound looping music not working :?

Post by captainkirk » November 2nd, 2012, 11:41 am

Hey, i'v seen the tut a few days ago about custom sound looping with distance, but i cant seem to get it working :/

Code: Select all

music_multiple_items()
{
	wait 20;
	respect_box = getentarray("music_radio","targetname");
	
	iPrintLnBold(respect_box.size);
	for(i=0;i<respect_box.size;i++)
	{
		respect_box[i] playLoopSound("music"); // Soundalias = respect
		iPrintLnBold("i = " + i);
	}
}
The alias is music, and script origin is set on music_radio, targetname.. also box size says 0 when i try to display it to see if its working.. been trying for ages lol thanks for any help, csv file is fine i think and its added to zone as well.. also mp3file is 96kbps.

User avatar
Rezil
Core Staff
Core Staff
Posts: 2030
Joined: July 24th, 2006, 11:21 am
Location: Cramped in a small cubicle/making another jump map

Re: Custom sound looping music not working :?

Post by Rezil » November 2nd, 2012, 5:02 pm

How many entities named 'music_radio' do you have in your map?
Drofder2004: Drofder's rules for reviewing a map
[...]
#5 If your name is Rezil, minimum 5/5.
---
<LT>YosemiteSam[NL]:
I heard somewhere that the best way to start is juggling 2 balls with one hand, so you will get a feel for it.

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13313
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Re: Custom sound looping music not working :?

Post by Drofder2004 » November 2nd, 2012, 8:55 pm

Post your CSV and the contents of your map zone file.
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

captainkirk
CJ Wannabe
CJ Wannabe
Posts: 29
Joined: November 2nd, 2012, 11:30 am

Re: Custom sound looping music not working :?

Post by captainkirk » November 3rd, 2012, 12:20 am

Code: Select all

name,sequence,file,vol_min,vol_max,vol_mod,pitch_min,pitch_max,dist_min,dist_max,channel,type,probability,loop,masterslave,loadspec,subtitle,compression,secondaryaliasname,volumefalloffcurve,startdelay,speakermap,reverb,lfe percentage,center percentage,platform,envelop_min,envelop_max,envelop percentage


#Respect,,,,,,,,,,,,,,,,,,,,,,,,,,,,
music,,mp_ghost_town/music.mp3,0,1,,,,100,250,auto,streamed,,looping,,,,,,,,,,,,,,,
map zone,

Code: Select all

ignore,code_post_gfx_mp
ignore,common_mp
ignore,localized_code_post_gfx_mp
ignore,localized_common_mp
col_map_mp,maps/mp/mp_ghost_town.d3dbsp
rawfile,maps/mp/mp_ghost_town.gsc
rawfile,maps/mp/mp_ghost_town_fx.gsc
rawfile,maps/mp/_teleport.gsc
impactfx,mp_ghost_town
xmodel,body_mp_usmc_specops
xmodel,head_mp_usmc_tactical_mich_stripes_nomex
xmodel,body_mp_usmc_sniper
xmodel,head_mp_usmc_tactical_baseball_cap
xmodel,body_mp_usmc_recon
xmodel,head_mp_usmc_nomex
xmodel,body_mp_usmc_assault
xmodel,head_mp_usmc_tactical_mich
xmodel,body_mp_usmc_support
xmodel,head_mp_usmc_shaved_head
xmodel,body_mp_arab_regular_cqb
xmodel,head_mp_arab_regular_headwrap
xmodel,viewhands_desert_opfor
xmodel,body_mp_arab_regular_sniper
xmodel,head_mp_arab_regular_sadiq
xmodel,body_mp_arab_regular_engineer
xmodel,head_mp_arab_regular_ski_mask
xmodel,body_mp_arab_regular_assault
xmodel,head_mp_arab_regular_suren
xmodel,body_mp_arab_regular_support
xmodel,head_mp_arab_regular_asad
include,mptypes_desert
fx,weather/rain_1
fx,weather/fog_river_200
fx,weather/fog_daytime
fx,weather/lightning_mp_farm
fx,fire/firelp_small_dl_c
sound,mp_ghost_town,,!all_mp
And i only have one script origin with music_radio, targetname in it :) thanks replies appreciate it.

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13313
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Re: Custom sound looping music not working :?

Post by Drofder2004 » November 3rd, 2012, 3:48 pm

I assume this is for CoD4 and not vCoD (as forum suggests?)

Code: Select all

sound,mp_ghost_town,,!all_mp
change to:

Code: Select all

sound,mp_ghost_town,,all_mp
Also, in my tutorial: viewtopic.php?f=29&t=15478
Use the "single item" function when you are only using one radio.
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

captainkirk
CJ Wannabe
CJ Wannabe
Posts: 29
Joined: November 2nd, 2012, 11:30 am

Re: Custom sound looping music not working :?

Post by captainkirk » November 3rd, 2012, 4:02 pm

Okay, iv changed the zone file from !all to all, and now using

Code: Select all

thread music_one_item();

Code: Select all

music_one_item()
{
   respect_single = getent("music_radio", "targetname") playLoopSound("music");
}
and yeah its only for cod4 :)

Just tested than and cant hear any music

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13313
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Re: Custom sound looping music not working :?

Post by Drofder2004 » November 3rd, 2012, 5:17 pm

Make sure "/developer 1" is on before loading your map and also, make sure you have placed your music file in the correct sound directories (also in your IWD file, inside a usermaps folder called my_map)
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

captainkirk
CJ Wannabe
CJ Wannabe
Posts: 29
Joined: November 2nd, 2012, 11:30 am

Re: Custom sound looping music not working :?

Post by captainkirk » November 3rd, 2012, 11:30 pm

Okay well my iwd now has a folder inside it "mp_ghost_town" with "music.mp3" inside it, and its in raw/sound/mp_ghost_town/music.mp3, developer is on and is saying.

Error: Couldn't play stream 'sound/mp_ghost_town/music.mp3' from alias 'music' - Unable to open file.

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13313
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Re: Custom sound looping music not working :?

Post by Drofder2004 » November 3rd, 2012, 11:44 pm

Your IWD should have the file structure "sound/map/sound.mp3"

I also had this error, however when I moved my 2 .ff files and my IWD file over to my main CoD4 install, it all worked fine.

If you run 2 installations (which you really should when modding) then try on second install.
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

captainkirk
CJ Wannabe
CJ Wannabe
Posts: 29
Joined: November 2nd, 2012, 11:30 am

Re: Custom sound looping music not working :?

Post by captainkirk » November 4th, 2012, 2:52 am

Thanks! i do have 2 btw, ill try it now. Its a very annoying thing, sound. :/

Okay just tried it, i have a teleport sound also set up the same way but with a trigger_multi. The custom sound on that is working just fine, i dont have the cannot play sound error anymore there is just no sound coming out of the script_origin. very strange

Okay i worked out why, in the csv i had min 0 max 1 volume, when i set them both 1 it works fine and goes off at a distance :) thanks for all your help!

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13313
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Re: Custom sound looping music not working :?

Post by Drofder2004 » November 4th, 2012, 2:04 pm

captainkirk wrote:Okay i worked out why, in the csv i had min 0 max 1 volume, when i set them both 1 it works fine and goes off at a distance :) thanks for all your help!
Glad you got it sorted, however the issue of changing 0 to 1 should not have 'solved' the issue, just changed the way the sound was working. You may have needed to adjust the distances to which you were playing the sound from and to. With 1,1 sound, you do not get any fall-off to the sound, just simply on and off.
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

Post Reply

Who is online

Users browsing this forum: No registered users and 8 guests