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
Dupont [Tutor]
satin45 [Today]
Mr_T [Today]
h3spawn [Downl]
Merchant_M... [Tutor]
Hercules [Forum]
Bart93 [Today]
RePhLeX [Forum]
fredisdead [Forum]

9 Members and 21 Guests
Chat MODSonline
0 People Now Chatting
MODSOnline TeamSpeak

download TeamSpeak

In-The-News
Saturday, Nov. 22nd
CoD:WW Video Tutorial is up!
Friday, Nov. 21st
MODSonair Episode 154
Thursday, Nov. 20th
Call Of Duty World At War - Mod Tools
Wednesday, Nov. 19th
Half-Life 1 $0.98
Sunday, Nov. 16th
MODSonair 154 Live
Latest Poll
Would you pay for mod tools?
I would pay a one time fee for mod tools for my favorite title 8.42%
I would pay a monthly/yearly subsrciption fee for mod tools for my favorite title 0.5%
I already paid for the game - Tools should come bundled because I am just fixing what the developers broke 67.82%
100% definitely NOT! 19.31%
I haven't seen a game yet that wasn't 100% perfect when the developers released it 2.48%
Games are the devil! 1.49%
Read More...
16 comments

Newsletter
Name:
Email:
Newsletter Archives
Your Membership
User Name:
Password:
Register.
In The Forums
Script compile error
CoD2 Scripting.. Posts: (3) Views: (19) by Sniperdennis
skybox problem
CoD:WW Level Des.. Posts: (3) Views: (49) by fredisdead
Single PLayer Spawn Problem
CoD:WW Level Des.. Posts: (1) Views: (4) by Rainbowsix
compiling errors
CoD:WW Level Des.. Posts: (26) Views: (281) by COLMAC
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 4
Category: CoD 4 Scripting
Scripting and coding with Call of Duty 4.
Moderators: foyleman, rEdrUmMDK, Foxhound, Rasta, StrYdeR, The_Caretaker, batistablr, playername, Welshy
Latest Posts
Subscribed Posts
Search
Restricted Access Restricted Access
Page
Next Page
subscribe
Author Topic: How do you assign a sound to a script exploder
Jsyhitman
General Member
Since: Jun 24, 2005
Posts: 38
Last: Aug 3, 2008
[view latest posts]
Level 2
Category: CoD 4 Scripting
Posted: Thursday, Jun. 26, 2008 11:42 am
I have the following script_exploder working in my map, However I would like to add a soundalias to go off at the same time.
Can anyone give me a pointer please?


Quote:
The fx entity has the following:
classname/script_model
model/fx
script_exploder/30
script_fxid/wallexplode

This is my mapname.gsc:
main()
{
maps\mp\_load::main();

ambientPlay("ambient_backlot_ext");

game["allies"] = "sas";
game["axis"] = "opfor";
game["attackers"] = "axis";
game["defenders"] = "allies";
game["allies_soldiertype"] = "woodland";
game["axis_soldiertype"] = "woodland";

setdvar( "r_specularcolorscale", "1" );

setdvar("r_glowbloomintensity0",".25");
setdvar("r_glowbloomintensity1",".25");
setdvar("r_glowskybleedintensity0",".3");
setdvar("compassmaxrange","1800");
}

This is my mapname_fx.gsc:

main()
{

level._effect["firelp_med_pm"] = loadfx ("fire/firelp_med_pm_nodistort");
level._effect["firelp_small_pm"] = loadfx ("fire/firelp_small_pm");
level._effect["firelp_small_pm_a"] = loadfx ("fire/firelp_small_pm_a");
level._effect["dust_wind_fast"] = loadfx ("dust/dust_wind_fast");
level._effect["dust_wind_slow"] = loadfx ("dust/dust_wind_slow_yel_loop");
level._effect["dust_wind_spiral"] = loadfx ("dust/dust_spiral_runner");
level._effect["hawk"] = loadfx ("weather/hawk");
level._effect["bird_seagull_flock_large"] = loadfx ("misc/bird_seagull_flock_large");
level._effect["wallexplode"] = loadfx ("explosions/wall_explosion_grnd");

//ambient runners
level._effect[ "mp_overgrown_insects01" ] = loadfx( "ambient_runners/mp_overgrown_insects01" );

/#
if ( getdvar( "clientSideEffects" ) != "1" )
maps\createfx\mp_test_fx::main();
#/


}
Rasta
Preferred Member
Since: Apr 10, 2004
Posts: 4298
Last: Nov 22, 2008
[view latest posts]
Level 9
Forum Moderator
Category: CoD 4 Scripting
Posted: Thursday, Jun. 26, 2008 12:37 pm
Best thing to do is grab the trigger for your exploders and use this to also trigger your sounds, you will need to place a script origin to act as the 'speaker' then grab this for your sounds origin, there are tutorials on adding sounds, the only differnce is you will use your existing trigger to make it happen.

Im not sure on your level of knowledge about scripting so ill explain this further if needed
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
We are game enthusiasts from the MODSonline.com community bringing you news, updates and opinions of the week's current events. Tune in every Friday for a new episode.
Jsyhitman
General Member
Since: Jun 24, 2005
Posts: 38
Last: Aug 3, 2008
[view latest posts]
Level 2
Category: CoD 4 Scripting
Posted: Thursday, Jun. 26, 2008 02:52 pm
I think i know what you mean, but my understanding of scripting is very basic altho i am starting to understand a little, any pointers would be very much appreciated.
Jsyhitman
General Member
Since: Jun 24, 2005
Posts: 38
Last: Aug 3, 2008
[view latest posts]
Level 2
Category: CoD 4 Scripting
Posted: Thursday, Jun. 26, 2008 03:14 pm
Ok so if in my map i give my trigger_damage a targetname of wallexplode_soundtrig and then put in a script_origin with a tragetname of wallexplode_sound.

Then in my main gsc i put the following code?

Code:


Would that work or would giving my trigger_damage a targetname upset the script_exploder?
ahoji
General Member
Since: May 16, 2006
Posts: 74
Last: Jun 27, 2008
[view latest posts]
Level 3
Category: CoD 4 Scripting
Posted: Friday, Jun. 27, 2008 07:05 am
wow, what exactly you want with sounds? like some ambient sound? or to trigger a sound and FX togetner?

my old test script with mortars, maybe helpful

Code:
lazygit
Preferred Member
Since: Dec 13, 2003
Posts: 275
Last: Nov 19, 2008
[view latest posts]
Level 5
Category: CoD 4 Scripting
Posted: Friday, Jun. 27, 2008 10:31 am
this might help you!!

main()




{

damagetrigg = getent ("dmtrig","targetname"); // this is my trigger still has a key and value script_exploer 1

alerts = getentarray ("bang","targetname"); // this is script_model placed where you need the sound to play it has a targetname thats all NO script_exploder 1

wallgood = getent ("wallgood","targetname"); //this is my wall in good form is a script_exploder 1

wallbad = getent ("wallbad","targetname"); //this is my wall in bad form is a script_exploder 1

wallbad hide(); //hiding my badwall

wallgood show(); //showing my wallgood

damagetrigg waittill ("trigger"); //waiting till the trigger is fired off then!!!!

wallbad show();

origin = wallbad getorigin();

alerts[0] playsound("building_explosion1"); // plays the sound building_explosion1

radiusDamage(origin, 750, 2000, 1000); // in the way of the radius you get hurt

}

edited on Jun. 27, 2008 10:32 am by lazygit
aka WaRmongR
Since: Nov 10, 2002
lazygit
Preferred Member
Since: Dec 13, 2003
Posts: 275
Last: Nov 19, 2008
[view latest posts]
Level 5
Category: CoD 4 Scripting
Posted: Friday, Jun. 27, 2008 12:16 pm
}

ammoc()

{
damagetrigg = getent ("dmtrig","targetname");

alerts = getentarray ("bang","targetname");

wallgood = getent ("wallgood","targetname");

wallbad = getent ("wallbad","targetname"); // no need to be script_exploder

wallbad hide();

wallgood show();

damagetrigg waittill ("trigger");

wallgood delete();

wallbad show();

origin = wallbad getorigin();

alerts[0] playsound("car_explode_close");

radiusDamage(origin, 600, 2000, 1000);

}
aka WaRmongR
Since: Nov 10, 2002
Jsyhitman
General Member
Since: Jun 24, 2005
Posts: 38
Last: Aug 3, 2008
[view latest posts]
Level 2
Category: CoD 4 Scripting
Posted: Friday, Jun. 27, 2008 01:20 pm
Thanks for all the suggestions, all i really need to do i have a sound play when the script_exploder is triggered by a trigger damge.

Is it possible to do it like the fx using something similar to this line

Quote:
level._effect["wallexplode"] = loadfx ("explosions/wall_explosion_grnd");


except that it plays a sound from one of the stock soundalias's
lazygit
Preferred Member
Since: Dec 13, 2003
Posts: 275
Last: Nov 19, 2008
[view latest posts]
Level 5
Category: CoD 4 Scripting
Posted: Friday, Jun. 27, 2008 02:11 pm
lazygit writes...
Quote:
}

ammoc()

{
damagetrigg = getent ("dmtrig","targetname");

alerts = getentarray ("bang","targetname");

wallgood = getent ("wallgood","targetname");

wallbad = getent ("wallbad","targetname");

wallbad hide();

wallgood show();

damagetrigg waittill ("trigger");

wallgood delete();

wallbad show();

origin = wallbad getorigin();

alerts[0] playsound("car_explode_close");

radiusDamage(origin, 600, 2000, 1000);

}


i have sent you a pm this is how to asign a stock sound to a script_exploder

aka WaRmongR
Since: Nov 10, 2002
Jsyhitman
General Member
Since: Jun 24, 2005
Posts: 38
Last: Aug 3, 2008
[view latest posts]
Level 2
Category: CoD 4 Scripting
Posted: Saturday, Jun. 28, 2008 05:09 pm
Thanks for the help, Thanks lazygit..
One last question, should i add the soundalias to my zone file?
I dont get any errors, just don't hear the explosion.
Thanks again
Restricted Access Restricted Access
Page
Next Page
subscribe
MODSonline.com Forums : Call of Duty 4 : CoD 4 Scripting
All logos and trademarks and information in this site are property of MODSonline LLC © 2008.
The comments are property of their posters.
RSS news feeds for MODSonline can be found News.php.
Art of War Central
Partners
The Firing Box
CODAddicts - Call of Duty News & Downloads
modbase.be
Call of Duty Headquarters
Frag Universe
Battle for Europe COD2
XoXide
Ask About
Advertising
Friends
CoD 4 Base
Great Gamer
Volcano
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 154
MODSonair Episode 153
MODSonair Episode 152
MODSonair Episode 151
Video server move
Next Show
The next MODSonair show will air LIVE on:
11/23/2008 12:00 EST

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