Welcome New User Home | Forums | Register | Login | Larger Font
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
Tutorials
CoD Mapping
CoDUO Mapping
CoD2 Mapping
CoD4 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
Rattlesnak... [Tutor]
w0lv3r1n3 [Searc]

2 Members and 20 Guests
Chat MODSonline
0 People Now Chatting
MODSOnline TeamSpeak

download TeamSpeak

In-The-News
Friday, Jul. 4th
MODSonair Episode 134
Thursday, Jul. 3rd
Happy 4th of July
Monday, Jun. 30th
Major Retailer Confirms 360 Price-Cut
Sunday, Jun. 29th
MODSonair 134 Live
Friday, Jun. 27th
MODSonair Episode 133
Latest Poll
Want a MODSonline Wiki for various games?
I think a Wiki would be a great addition to MODSonline. 79.73%
I could see a benefit of a Wiki. 6.76%
I think it would take away from the community. 6.76%
Wiki sites are never good. 1.35%
Wiki... isn't that Buck Roger's robot slave? 5.41%
Read More...
7 comments

Newsletter
Name:
Email:
Newsletter Archives
Your Membership
User Name:
Password:
Register.
In The Forums
help ,for a good sentence.
CoD 2 Level Desi.. Posts: (2) Views: (23) by AnythingButt
Elevator model problem
CoD Level Design.. Posts: (1) Views: (15) by Tragic
Comiler Problem
CoD 2 Level Desi.. Posts: (3) Views: (31) by jmcke149
A Lunch / Bounce pad?
CoD 4 Level Desi.. Posts: (1) Views: (19) by sinner4
Google 468 Banner Quake 4 Mods for Dummies
Typhoon Servers
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.
Jump To:
Forum: All Forums : Call of Duty 4
Category: CoD 4 Level Design
CoD 4 mapping and level design.
Moderators: foyleman, rEdrUmMDK, Foxhound, Rasta, StrYdeR, The_Caretaker, batistablr, playername
Latest Posts
Subscribed Posts
Search
Restricted Access Restricted Access subscribe
Author Topic: Indoor = (null) Outdoor = (ambience) SOLVED!
DeekCiti
General Member
Since: Mar 13, 2008
Posts: 191
Last: Jun 30, 2008
[view latest posts]
Level 4
Category: CoD 4 Level Design
Posted: Saturday, May. 17, 2008 06:43 am
Hey guys,

After many hours of testing and racking my brain, I've finally, and I say FINALLY figured out HOW to allow no ambience indoors, while outdoors your ambience plays, by use of a "Trigger_Multiple". I can say that I am now fully satisfied by the results.

Here is how I came to this conclusion. If this doesn't make sense to you now, it will by the time your done reading the Tutorial.

My map was set up to play "ambient_farm" as the ambientplay, but what I wanted was to have the rain sound only outside, while inside you could not hear the rain. The answer lies in the soundalias. My original line used the header masterslave and as the value of this header was this number: 0.00001. I used this number because I knew that, whatever number was in the header "masterslave" was multiplied by that alias's header "vol_min" but only when a master sound was playing over it. Since my ambientplay had these values, when I played my master sound, "building_null" it would basically play at a volume of something near to "0.00001", which is too quiet for a player to hear and exactly what I want!

The problem I was having was knowing what values the alias of "building_null" needed to be, and I found this out by accident. I noticed that when I had my ambientplay set up in my alias as above, when I entered my map, the announcer said, "Team Deathmatch" ... "Let's do this Marines". I noticed that my ambientplay went quiet ONLY when the announcer spoke these lines, basically when it played those sounds. I knew right then, that if I only knew how those sounds were set up in an alias, I could reproduce it with my own sounds. So I did some digging in the code.csv. Found the values for those files, and whallah. The answer was right there. Now I'm going to explain how to do it...

For starters, this Tutorial is geared towards people who have some knowledge of scripts, sounds, and who already have a soundalias set up, because I'm not going to explain any of that in here.

First things first...

You need to find a valid sound to use for your null sound. I suggest using a .wav. This sound should be less than a second long but greater than a 6th of a second, and I believe this is because the script can only loop the sound at .01 of a second. I'm not 100% on that. But I do know that, after the player leaves the trigger, the sound continues to play until it finishes, then your ambience begins. So, basically the shorter this soundbite you can find the better. I also tried using the default null.wav but was unable to get that to work, and I think because it is too short of a sound file. Your welcome to try, but I don't think it will work. I suggest starting with a sound about 1 second long. Get the thing working and then cut your sound shorter later on.

Step 1: Get/Create a valid sound.

Step 2: Open your map and create a brush where you want your Null to be. Right click the brush in the 2D window and say: Trigger > multiple. Make sure only your trigger_multiple is selected. Press [N] to open your entity Editor, and give this trigger_multiple a Key of targetname and a Value of null_sound. We are going to use "null_sound" as the targetname in our script, but we haven't gotten to the scripting yet. Once this is done, you can save and close your map. Then Compile the BSP. Then Compile Reflections. Stop there.

Step 3: Open your soundalias for your map, but open it with "notepad" or any text editor. Once you have that open, copy and paste the lines below underneath the last alias you've got in there. These are the default lines your going to need to get this working. You can edit them as we go along here to your map specifics.


Code:


Now that you copied the two lines, save and close your alias. Then reopen it with MS Excel. You will notice the lines now show up correctly and you can read it.

Now, you will notice that I have defined my ambientplay here as an alias. I did that because I wanted some of the values changed from the default one the game uses when you just plug in ambientPlay("ambient_farm"); in yourmap.gsc All I'm doing is redefining it, so it uses my values instead of the games values. So here my map plays ambient farm, what does yours play?. You need to define here what your ambient play is, and also the correct path to the file. If you don't know, open up the multiplayer.csv and locate which ambientplay your using, and define it properly.

- Give it an alias.
- Give it the right path.
- Give it a good vol_min somewhere between 0.2 and 0.5 is good.
- Give it a masterslav number. Remember, this number does not have to be so low as so the player can't hear it at all. It can be at something like 0.3, and there it will be very quiet but at least the player can hear it while in your trigger. Up to you, you can play with this value later. I suggest just leaving it at 0.00001 for now. Everything else in your ambient alias needs to say the same as what I've got.

Moving on to your building_null alias. The only thing you need to change here is your path, and the name of your sound file. Everything else stays as I have it. Hopefully you know where sounds belong, and where they need to be placed so the game can pack them in the .FF. raw/sound/yoursoundfolder. Once your building_null alias is done, your finished in the soundalias file. Save and close.


Step 4: The Script. Funny, all along it was a simple sound script that would do the trick, and here I thought it needed to be a complicated script.
Create a new text document in raw/maps/mp and call it mp_yourmapname_building_null.gsc. Make sure you give it the file extension .gsc. Open the file and copy and paste the script below.


Code:




Step 5: Open your mp_yourmapname.gsc. Add the following line:

maps\mp\mp_yourmapname_building_null::main();

Also, while you have this file open, make sure your calling your ambientplay here too. Mine is ambientPlay("ambient_farm");
Make sure yours is correct. Make sure yours reflects the alias you gave it earlier, whether its the same as the default or not. Once that is done, your finished in this file. Save and close.


Step 6: Updating Zone File. Make sure you have the following line in your zone file:

sound,mp_yourmapname,,all_mp

This line should only exist already if you have previous sounds in your map. Next add the following lines to your zone file:

rawfile,maps/mp/mp_yourmapname_building_null.gsc
rawfile,sound/amb_elements/amb_building_null.wav

Double check that the path to your sound file is correct. The line I'm showing above reflects MY path!, not yours, so change the path and the name of your sound file to the correct names. Once this is complete you should be ready to test this. Save your zone file. Build your .FF. Run your map.

If you followed close enough, you should now have a working Building Null ! If not, double check for spelling errors and filenames that are referenced. Goodluck.

I hope everything is clear enough and I didn't miss anything. If someone sees something I missed or messed up please correct me. If I find an error I will post to correct it.

I want to thank everyone who gave me any feedback on this subject, it helped me to persist on finding an answer, even when I saw that some people said it could never be done. [wave]

edited on May. 21, 2008 04:12 pm by Rasta
DeekCiti
General Member
Since: Mar 13, 2008
Posts: 191
Last: Jun 30, 2008
[view latest posts]
Level 4
Category: CoD 4 Level Design
Posted: Wednesday, May. 21, 2008 03:10 pm
Found a problem with the Script I posted above. Please use the following script instead of the one posted above:


Code:



If your curious why the script in the first Post doesn't work or what the problem with it was, view the thread below.

Thread Here
Rasta
Preferred Member
Since: Apr 10, 2004
Posts: 4025
Last: Jul 4, 2008
[view latest posts]
Level 9
Forum Moderator
Category: CoD 4 Level Design
Posted: Wednesday, May. 21, 2008 04:12 pm
I edited your original post to include the new code.
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.
DeekCiti
General Member
Since: Mar 13, 2008
Posts: 191
Last: Jun 30, 2008
[view latest posts]
Level 4
Category: CoD 4 Level Design
Posted: Wednesday, May. 21, 2008 09:54 pm
Thanks Rasta,



I want to add an Update to this Tutorial. For an Explanation on the update... there seems to be a conflict with Voiceovers that are defined in the raw\soundaliases folder.

The two files in Conflict are:
code.csv
multiplayer.csv

The conflict is as follows:

Because your maps soundalias defined your ambient play alias with the header masterslave which = 0.00001, and all these voiceovers I'm referring to are defined as Master. Because they are Defined as Master, the Master alias will take all other alias's masterslave header and multiply it by the min_vol.

Meaning this:

if "master", this is a master sound. If a number, then this sound's volume will be multiplied by that number (a percentage between 0 and 1) any master sound is playing.

You will know if your having this conflict when any Voiceover, or Taunt (Enemy Spotted) will make Your Ambient Play drop its Volume to 0, when the Voiceover plays. And we don't want this happening when a player is outdoors, and a Voiceover plays, and cuts out the Ambient track right?! I know I don't so here is the fix for it.

The fix to this is simple. You need to include all the voiceovers from these two files that are Defined as Master. You need to put them in YOUR Soundalias, and change all the Master values to 0.5. There are ALOT in the multiplayer.csv, and only 4 in the code.csv.

I would have included it, but there is a character limit of 20000 max, and posting all those alias's exceeds that max amount.

This whole process may seem complicated but really... its not. Once you understand what your doing here, its quite simple. I don't even know anyone else who is interested in doing this for their map, but it is a very cool effect for players. Unfortunately I'm refining it as I go along here and I'm also hoping that its understandable by all.
Restricted Access Restricted Access subscribe
MODSonline.com Forums : Call of Duty 4 : CoD 4 Level Design
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.com can be found News.php.
MODSonline Subscriptions
Partners
My Topsites List
Call of Duty Headquarters
Frag Universe
Battle for Europe COD2
Websites4Clans
XoXide
modbase.be
The Firing Box
Ask About
Advertising
Friends
Canada Kicks Ass Clan
Volcano
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 134
MODSonair Episode 133
MODSonair Special CoD:WW Episode
MODSonair Episode 132
MODSonair Episode 131
Next Show
The next MODSonair show will air LIVE on:
07/06/2008 11:00 EDT

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