Login x
User Name:
Password:
Social Links Facebook Twitter YouTube Steam RSS News Feeds

Members Online

»
0 Active | 6 Guests
Online:

LATEST FORUM THREADS

»
warfare
CoD4 Map + Mod Releases
Voting menu on maps
CoD+UO General
Hauling 911
CoDBO3 General

Forums

»

Welcome to the MODSonline.com forums. Looking for Frequently Asked Questions? Check out our FAQs section or search it out using the SEARCH link below. If you are new here, you may want to check out our rules and this great user's guide to the forums and the website.
For more mapping and modding information, see our Wiki: MODSonWiki.com

Jump To:
Forum: All Forums : Call of Duty 4
Category: CoD4 Scripting
Scripting and coding with Call of Duty 4.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername, novemberdobby
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked subscribe
Author Topic: custom sound areas?
Darfyddi
General Member
Since: Oct 14, 2009
Posts: 43
Last: Mar 13, 2012
[view latest posts]
Level 2
Category: CoD4 Scripting
Posted: Friday, Mar. 2, 2012 10:58 pm
Just a simple one, after sime extremely good help from DeekCiti I can now play sounds in various locations. I notice that all the tutorials of sound, even if with a trigger (though I am struggling to get trigger sounds to work) use a radius for the sound.

I would like to know if it is possable to have a sound fill a square room without leaking out or missing the corners.

I thought a trigger_multiple and an invisable brush linked to it both filling the room might work but I can't get the trigger to make my sound work nor can I find any way of avoiding the need of sound filling a radius from a centre point.

Any advice or info would be great. Thank you.
Share |
Sevenz
General Member
Since: Apr 24, 2006
Posts: 2390
Last: May 10, 2013
[view latest posts]
Level 8
Category: CoD4 Scripting
Posted: Saturday, Mar. 3, 2012 12:22 am
basically like this:

Code:
trig = getent("soundtrig", "targetname");

for (;;)
{
  trig waittill("trigger", player);
  trig playsoundtoplayer("soundalias", player);
}
Share |
Darfyddi
General Member
Since: Oct 14, 2009
Posts: 43
Last: Mar 13, 2012
[view latest posts]
Level 2
Category: CoD4 Scripting
Posted: Saturday, Mar. 3, 2012 05:50 pm
Thank you very much for helping. I am struggling though - sorry.

I have:

Code:
main()
	{
		thread globalSoundFx();
		thread test_sound1();
	}
globalSoundFx()
	{
		maps\mp\_fx::loopSound("7th_dimension", (1024, 1024, 472), 1);
		maps\mp\_fx::loopSound("coventry_carol", (1899, 1553, 364), 1);
	}
test_sound1()
	{
		trig = getent("testsound", "targetname");
		for (;;)
		{
			trig waittill("trigger", player);
			trig playsoundtoplayer("test_music", player);
		}
	}


I have the song listed in the csv too:

Code:
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
test_music,,top_floor/test_music.mp3,0.5,1,element,1,1,330,372,element,streamed,,looping,1,all_mp,,,,,0,,,0.2,,,,,


In radiant I have a brush with trigger texture and set as trigger_multiple and targetname of testsound.

The song works if I just set a radius for it like the other two I have but I don't know what I am doing for the trigger method

Could you tell me what I am doing wrong please?
Many thanks.
Share |
Sevenz
General Member
Since: Apr 24, 2006
Posts: 2390
Last: May 10, 2013
[view latest posts]
Level 8
Category: CoD4 Scripting
Posted: Sunday, Mar. 4, 2012 09:54 am
not sure, but you might need another entity as virtual sound source (trig for playSoundToPlayer might not accept a trigger as entity)

does it work if you remove the "streamed" setting from csv? (keep just the comma!)

below
trig playsoundtoplayer("test_music", player);
add wait( n );

replace n with the length of the song (e.g. 12.5 for 12 and a half seconds) or it will play multiple times simultanously
Share |
Darfyddi
General Member
Since: Oct 14, 2009
Posts: 43
Last: Mar 13, 2012
[view latest posts]
Level 2
Category: CoD4 Scripting
Posted: Monday, Mar. 5, 2012 03:58 am
Many thanks for trying to help - I have been looking at this since 9 last night, it is now 4am and I am still not having any luck. :(
Share |
Sevenz
General Member
Since: Apr 24, 2006
Posts: 2390
Last: May 10, 2013
[view latest posts]
Level 8
Category: CoD4 Scripting
Posted: Monday, Mar. 5, 2012 12:52 pm
if the problem is the trigger as sound source entity, this should fix it:

Code:
main()
{
	thread globalSoundFx();
	thread test_sound1();
}
globalSoundFx()
{
	maps\mp\_fx::loopSound("7th_dimension", (1024, 1024, 472), 1);
	maps\mp\_fx::loopSound("coventry_carol", (1899, 1553, 364), 1);
}
test_sound1()
{
	trig = getent("testsound", "targetname");
	trig_org = spawn("script_origin", trig.origin);
	
	for (;;)
	{
		trig waittill("trigger", player);
		trig_org playsoundtoplayer("test_music", player);
		wait (20); // change this to the seconds of the test_music sound!
	}
}
Share |
Darfyddi
General Member
Since: Oct 14, 2009
Posts: 43
Last: Mar 13, 2012
[view latest posts]
Level 2
Category: CoD4 Scripting
Posted: Tuesday, Mar. 13, 2012 12:07 am
This didn't work, tried .wav as well as .mp3 but I have just had the idea of looking at the elevator sounds scripts to see what I can get from those. :)
Share |
Sevenz
General Member
Since: Apr 24, 2006
Posts: 2390
Last: May 10, 2013
[view latest posts]
Level 8
Category: CoD4 Scripting
Posted: Tuesday, Mar. 13, 2012 10:23 am
most likely, your soundalias is bad or the sound file isn't packed properly into iwd/ff
Share |
Restricted Access Topic is Locked subscribe
MODSonline.com Forums : Call of Duty 4 : CoD4 Scripting

Latest Syndicated News

»
Codutility.com up and runn...
Nice, and there still using the logo and template for the screenshots, which...
Codutility.com up and runn...
dundy writes...Quote:Call of Duty modding and mapping is barly alive only a ...
Codutility.com up and runn...
Mystic writes...Quote:It seems to me the like the site is completely dead? ...
Codutility.com up and runn...
It seems to me the like the site is completely dead?

Partners & Friends

»