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

Members Online

»
0 Active | 66 Guests
Online:

LATEST FORUM THREADS

»
CoD: Battle Royale
CoD+UO Map + Mod Releases
Damaged .pk3's
CoD Mapping
heli to attack ai
CoD4 SP Mapping

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 2
Category: CoD2 Scripting
Scripting and coding with Call of Duty 2.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked subscribe
Author Topic: Problem with sound
(VM)Monkey
General Member
Since: Jul 31, 2006
Posts: 113
Last: Mar 24, 2008
[view latest posts]
Level 4
Category: CoD2 Scripting
Posted: Tuesday, Oct. 31, 2006 07:53 pm
I've tried searching for other threads on this, but nothing seems to help. I've looked at ArmorMaster's tut too, but I still can't get this radio to play.

In my map, I have a script_model of a radio, with a targetname of radio_source. Around the radio, I have a trigger_use, with a targetname of radio_trigger.

mp_m409.gsc:
Quote:

main()
{
maps\mp\_load::main();
maps\mp\mp_m409_fx::main();

//setExpFog(0.0001, 0.55, 0.6, 0.55, 0);
setCullFog(0, 6000, 0.55, 0.55, 0.55, 0);
ambientPlay("ambient_mp_m409");

level._effect["fire"] = loadfx ("fx/fire/tank_fire_engine.efx");
level._effect["smoke"] = loadfx ("fx/smoke/thin_black_smoke_M.efx");
level._effect["smoke2"] = loadfx ("fx/smoke/thin_light_smoke_S.efx");

maps\mp\_fx::loopfx("fire", (953, 721, 20), 0.6);
maps\mp\_fx::loopfx("smoke", (-256, 2704, 1390), 0.7);
maps\mp\_fx::loopfx("smoke", (2448, 2704, 1390), 0.7);
maps\mp\_fx::loopfx("smoke2", (-886, -1194, 490), 0.7);
maps\mp\_fx::loopfx("smoke2", (-886, -1322, 490), 0.7);
maps\mp\_fx::loopfx("smoke2", (-886, -1450, 490), 0.7);

//maps\mp\_fx::soundfx("medfire", (953,721,20));

game["allies"] = "american";
game["axis"] = "german";
game["attackers"] = "allies";
game["defenders"] = "axis";
game["american_soldiertype"] = "normandy";
game["german_soldiertype"] = "winterlight";

// Set some cvars
setcvar("r_glowbloomintensity0","1");
setcvar("r_glowbloomintensity1","1");
setcvar("r_glowskybleedintensity0",".5");

}



mp_m409_fx.gsc:
Quote:

main()
{
thread radio();
}


radio()
{
radiotrig = getent ("radio_trigger","targetname");

radiosource = getent ("radio_source", "targetname");

While(1)
{

radiotrig waittill ("trigger");

radiosource playsound("beep");

wait (1);
}
}


Right now, when I compile it, I get a bad syntax error. I commented out every line, and removed the comments one by one, and it seems to fail when it gets to the "radiotrig waittill ("trigger");"

Any clue what I'm doing wrong?

Ok, I didn't see it until I posted it on here, but I capitalized the W on while. God I love C based coding languages.

No more bad syntax error, it loads, but nothing happens when I activate the trigger.

edited on Oct. 31, 2006 03:00 pm by med
Share |
The_Caretaker
General Member
Since: Jun 8, 2004
Posts: 11625
Last: Jul 7, 2009
[view latest posts]
Level 10
Category: CoD2 Scripting
Posted: Tuesday, Oct. 31, 2006 11:28 pm
is the "beep" sound defined in an .csv file somewhere? I know it is in CoD1, but not sure about CoD2...
Share |
(VM)Monkey
General Member
Since: Jul 31, 2006
Posts: 113
Last: Mar 24, 2008
[view latest posts]
Level 4
Category: CoD2 Scripting
Posted: Wednesday, Nov. 1, 2006 06:10 am
It's not defined in any of my .csv files. I read on another one of your posts (at least I think it was one of yours), that it was a stock sound, so I used that, in case my .csv is messed up.

I did also try using the soundalias I made for the radio, but still no sound.

This is my .csv

Quote:

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

#Ambiance
ambient_mp_m409,,ambient/amb_Russia02_ext.mp3,0.63,,,,,,,local,streamed,,looping,,mp_m409
cheeseradio,,custom/cheese.mp3,1,,,,,150,300,auto,,,nonlooping,,,,,,,,,,


I tried changing it to local, just to see if that changed anything, but it still doesn't play. Filename and folder are correct.

Ok, figured it out. I copied that line straight out of the sound tutorial, so I guess it didn't fit my .csv. I took off the extra commas at the end, and threw in a streamed after "auto". Not sure which one did the trick, but it's working.

edited on Nov. 1, 2006 01:18 am by med
Share |
Dragon
General Member
Since: Aug 2, 2004
Posts: 413
Last: May 29, 2009
[view latest posts]
Level 5
MODSCON
Category: CoD2 Scripting
Posted: Wednesday, Nov. 1, 2006 06:40 am
You do know what it all does right? All those comma's and stuff?

If not, look for my most recent posts, its somewhere in there.
Share |
(VM)Monkey
General Member
Since: Jul 31, 2006
Posts: 113
Last: Mar 24, 2008
[view latest posts]
Level 4
Category: CoD2 Scripting
Posted: Thursday, Nov. 2, 2006 07:40 am
Dragon writes...
Quote:
You do know what it all does right? All those comma's and stuff?

If not, look for my most recent posts, its somewhere in there.


Yeah, I know what they do. And your posts actually helped me out quite a bit. I'm just not used to .csv files, and I don't have a spreadsheet progam to load it. I was cutting and pasting from different .csv files, so I didn't bother counting out the fields.

Thanks for the help guys. =)
Share |
bouncy
General Member
Since: Apr 16, 2006
Posts: 105
Last: Feb 26, 2007
[view latest posts]
Level 4
Category: CoD2 Scripting
Posted: Friday, Nov. 3, 2006 05:49 pm
opppennnnnn theeemmmm...wiiitthhh wordpad :D
Spreadsheets just plain confuse me for one
Share |
Restricted Access Topic is Locked subscribe
MODSonline.com Forums : Call of Duty 2 : CoD2 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

»