Page 1 of 1

Custom sound looping music not working :?

Posted: November 2nd, 2012, 11:41 am
by captainkirk
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.

Re: Custom sound looping music not working :?

Posted: November 2nd, 2012, 5:02 pm
by Rezil
How many entities named 'music_radio' do you have in your map?

Re: Custom sound looping music not working :?

Posted: November 2nd, 2012, 8:55 pm
by Drofder2004
Post your CSV and the contents of your map zone file.

Re: Custom sound looping music not working :?

Posted: November 3rd, 2012, 12:20 am
by captainkirk

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.

Re: Custom sound looping music not working :?

Posted: November 3rd, 2012, 3:48 pm
by Drofder2004
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.

Re: Custom sound looping music not working :?

Posted: November 3rd, 2012, 4:02 pm
by captainkirk
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

Re: Custom sound looping music not working :?

Posted: November 3rd, 2012, 5:17 pm
by Drofder2004
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)

Re: Custom sound looping music not working :?

Posted: November 3rd, 2012, 11:30 pm
by captainkirk
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.

Re: Custom sound looping music not working :?

Posted: November 3rd, 2012, 11:44 pm
by Drofder2004
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.

Re: Custom sound looping music not working :?

Posted: November 4th, 2012, 2:52 am
by captainkirk
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!

Re: Custom sound looping music not working :?

Posted: November 4th, 2012, 2:04 pm
by Drofder2004
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.