MODSonline
  Welcome Guest to MODSonline Home | Forums | Register | Login
Main-Menu
Home
Login
Register
Add Download
Add News
Add Tutorial *
Forums

Advertise
Affiliate Store US *
Affiliate Store UK *
Affiliate Store CA *
Angry Letter Generator
Avatar Upload
Calendar of Games
Contact
Downloads
FAQs
Forums
Member List
Member Projects
News
News Grabber *
Policy
Polls
Private Messages
Reviews
Screenshot Gallery
Search
Servers - Game
Store - Shirts *
Subscribe
Topics
Tutorials
Weblinks
Wiki *
Tutorials
CoD Mapping
CoDUO Mapping
CoD2 Mapping
CoD4 Mapping
CoDWW Mapping
CoD FAQs
HL2 Mapping
HL2 FAQs
SOF1 Mapping
Crysis Mapping
Q4 Mapping
Doom 3 Mapping
Doom 3 FAQs
UT2K3 Mapping
SOF2 Mapping
SOF2 FAQs

Lightray Modeling
General Modeling
General Modding
Adobe Photoshop
Common Mapping Errors

Readme.txt Generator
Members-Online
{PP}Bloodl... [Messa]
ghostryder07 [Forum]
JDogg [Downl]
Ek49ten [Downl]
Sgt.Rampage [Forum]
Lastspark [Today]
{UST}Hogan [Today]
reborn1213 [Forum]

8 Members and 17 Guests
Chat MODSonline
0 People Now Chatting
MODSOnline TeamSpeak

download TeamSpeak

In-The-News
Sunday, Jan. 4th
MODSonair 161 Live
Friday, Jan. 2nd
MODSonair Episode 160
Thursday, Jan. 1st
HAPPY NEW YEAR MODSONLINE AND ALL
Sunday, Dec. 28th
MODSonair 160 Live
Saturday, Dec. 27th
MODSonline Holiday Pwnage
Latest Poll
Modsonair audio or video?
Video from here on. 48.57%
Sticking with audio. 2.86%
Either is good. 17.14%
What is modsonair? 31.43%
Read More...
4 comments

Newsletter
Name:
Email:
Newsletter Archives
Your Membership
User Name:
Password:
Register.
In The Forums
How 'bout law?
MODSonline.. Posts: (6) Views: (42) by Strid3r
Players enter game when running from Launcher??
CoD:WW Multiplay.. Posts: (1) Views: (8) by {PP}Bloodletter
Secret Keypad Door.... Help :'(
CoD 2 Level Desi.. Posts: (1) Views: (17) by NotDeadYet
Zombies Crashing?
CoD:WW Zombie/Co.. Posts: (3) Views: (28) by Sgt.Rampage
Google 468 Banner Quake 4 Mods for Dummies
CoDWW Download
Forums
MODSonline.com 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, rEdrUmMDK, Foxhound, Wyatt_Earp, Rasta, StrYdeR, The_Caretaker, Cypher2004, supersword, batistablr, Welshy
Latest Posts
Subscribed Posts
Search
Restricted Access Restricted Access subscribe
Author Topic: silly sond question
Mortipede
General Member
Since: May 10, 2006
Posts: 51
Last: Sep 27, 2006
[view latest posts]
Level 3
Category: CoD2 Scripting
Posted: Friday, Sep. 22, 2006 07:25 am
I will have a sound of a tankengine continues running arond the tank where the place of the engine is.

I placed a script_fx and have difined a sound. No problem so far.

But how do I get the sound to play from the moment the map opens until it closed. I did tried some script but al give somekind of error.

Please some help
StrYdeR
Preferred PLUS Member
Since: May 11, 2004
Posts: 11336
Last: Dec 30, 2008
[view latest posts]
Level 10
Forum Moderator
Im a HOST of MODSonair
Category: CoD2 Scripting
Posted: Friday, Sep. 22, 2006 08:10 am
nothing helps us more than a vague description...

that said - what was the error?

[angryalien]
Go ahead... You Play I Mod : MODSonline.com
Support Modsonline by becoming a PREFERRED MEMBER today
Have you heard the MODSonair Podcast?: www.modsonair.com
MODSonair is a weekly podcast bringing you the news from a modders perspective. Tune in every Sunday at 4pm GMT to listen LIVE.
Mortipede
General Member
Since: May 10, 2006
Posts: 51
Last: Sep 27, 2006
[view latest posts]
Level 3
Category: CoD2 Scripting
Posted: Friday, Sep. 22, 2006 09:20 am
OK
Here is the code

Filename mp_abondance_tanks_sound.gsc in ...\Main\maps\mp

Code:
main() 
{ 
	thread tank_engine(); 

} 

tank_engine() 
{ 
	engine = getentarray ("tankengine01","targetname");
	while (1) 
	{
		{
			for (i=1;i


Filename mp_abondance.gsc in ...\Main\maps\mp

Code:
main()
{

	maps\mp\_load::main();
	maps\mp\mp_abondance_fx::main();
	maps\mp\mp_abondance_planes::main();
	maps\mp\mp_abondance_tanks::main();
	maps\mp\mp_abondance_tanks_sound::main();
//	ambientPlay("ambient_mp_Abondance");

	setExpFog(.00044, .39, .30, .29, 0);

	game["allies"] = "british";
	game["axis"] = "german";
	game["attackers"] = "allies";
	game["defenders"] = "axis";
	game["british_soldiertype"] = "Normandy";
	game["german_soldiertype"] = "Normandy";

	setcvar("r_glowbloomintensity0",".25");
	setcvar("r_glowbloomintensity1",".25");
	setcvar("r_glowskybleedintensity0",".5");

}


Filename mp_abondance.csv in ...\Main\soundaliases

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

#planes
stuka_flyby,1,vehicles/stuka_planeby1.wav,1,1,na,,,15,50000,auto,streamed,,,,mp_abondance
spitfire_flyby,1,vehicles/elm_spitfly1.wav,1,1,na,,,15,50000,auto,streamed,,,,mp_abondance

#bombs
bomb_explosion,1,explosions/mortar_dirt01.wav,0.85,0.9,explosion,1,1.3,50,15000,voice,streamed,,,0.5,mp_abondance

#tanks
tankengine,1,vehicles/mrk_tank_03_idle.wav,1,1,na,,,5,50,auto,loaded,,,,mp_abondance
tank1_driveby,1,vehicles/mrk_tank_03_move.wav,1,1,na,,,15,500,auto,loaded,,,,mp_abondance


Settings for the script_fx

Code:
classname
Script_model

model
xmodel/fx

targetname
tankengine01

origin
808 656 208


The error is "syntax error" and a number ????? (not at home now) I think this must work but when I test the map there is no sound
Filbert
General Member
Since: Jan 24, 2005
Posts: 868
Last: Oct 24, 2008
[view latest posts]
Level 7
MODSCON
Category: CoD2 Scripting
Posted: Friday, Sep. 22, 2006 09:45 am
Well in your "mp_abondance_tanks_sound.gsc" you have this line:

self tread tank_engine();

Which should be:

self thread tank_engine();

That typo is probably your whole problem. Although I don't have a ton of experience with scripting might I ask if you need either the "self thread tank_engine();" or "return;" lines? It seems to me that the "while(1);" loop is enough, assuming those lines are for looping the code.

Also, do you need the line "engine[0] playsound("tankengine");" in there twice? Shouldn't it be "engine playloopsound("tankengine");" anyway?

edited on Sep. 22, 2006 09:49 am by Filbert
Mortipede
General Member
Since: May 10, 2006
Posts: 51
Last: Sep 27, 2006
[view latest posts]
Level 3
Category: CoD2 Scripting
Posted: Friday, Sep. 22, 2006 01:15 pm
Thanks

I rip the script of one of the tutorials so i don't know of I need them.
I will try what i can leave out and see what happens
Pedro699
General Member
Since: Jun 19, 2006
Posts: 464
Last: Mar 18, 2008
[view latest posts]
Level 5
Category: CoD2 Scripting
Posted: Friday, Sep. 22, 2006 02:19 pm
Don't know whethere this is the correct way to make a localised looping sound, but I just added a script_model to my map with a targetname and put this line in my .gsc.

getent ("thing","targetname") playloopsound ("soundname");

The soundname is just the alias for the sound in you csv, where the radius, volume values are etc.
Filbert
General Member
Since: Jan 24, 2005
Posts: 868
Last: Oct 24, 2008
[view latest posts]
Level 7
MODSCON
Category: CoD2 Scripting
Posted: Friday, Sep. 22, 2006 03:31 pm
The above is correct if you only want one, but for an array it's a little different. I haven't tested it but I believe the below plays a looping sound for any number of script_models each with the "targetname" of "tankengine".


Code:
main() 
{ 
	thread tank_engine(); 

} 
tank_engine()
{
    engine = getenterray ("tankengine", "targetname");
    for (i = 0; i < engine.size; i++)
    {
        while(1)
        {
            engine[i] playloopsound ("tankengine");
        }
    }
}


The for loop runs through once for every script_model with the "targetname" of "tankengine", each time playing the loop sound. What I'm not sure of is if that while loop is necessary with a looping sound.

edited on Sep. 22, 2006 03:36 pm by Filbert
Big-Madman
General Member
Since: May 14, 2006
Posts: 197
Last: May 6, 2008
[view latest posts]
Level 4
Category: CoD2 Scripting
Posted: Friday, Sep. 22, 2006 04:36 pm
[cool] yo , for the syntax error , give us in what folder (gsc or csv or whatever) and give us the number ... it is the number of the line where is the error , so we can fix your problem way faster ...

syntax error can be anything ( { - } . / ... etc

when you have this error , it give you the file name like gsc.
give you the line number , and it give you the error itself ...
Restricted Access Restricted Access subscribe
MODSonline.com Forums : Call of Duty 2 : CoD2 Scripting
All logos and trademarks and information in this site are property of MODSonline LLC © 2009.
The comments are property of their posters.
RSS news feeds for MODSonline can be found News.php.
Art of War Central
Partners
Call of Duty Headquarters
The Firing Box
modbase.be
XoXide
Battle for Europe COD2
CODAddicts - Call of Duty News & Downloads
Frag Universe
Ask About
Advertising
Friends
MODS Reloaded
ModTheater
CoD 4 Base
Ask About
Advertising
Link to Us
MODSonair
View in iTunes
Please help us to raise in the ranks of podcasting and subscribe to our itunes feed using the link above.
MODSonair Releases
MODSonair Episode 160
MODSonair Episode 159
MODSonair Episode 158
MODSonair Episode 157
MODSonair Episode 156
Next Show
The next MODSonair show will air LIVE on:
01/11/2009 12:00 EST

Time remaining:
Copyright © 2009 MODSonline
Tresware Content Management System Copyright © 2009 Tresware
Website Designed and Hosted   Tresware