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

Members Online

»
0 Active | 33 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 4
Category: CoD4 MP Mapping
CoD 4 mapping and level design for multiplayer.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername, novemberdobby
Latest Posts
Subscribed Posts
Search
Restricted Access Restricted Access subscribe
Author Topic: There's something wrong in my code and I can't figure out what that is.
Hascalod
General Member
Since: Oct 7, 2016
Posts: 7
Last: Oct 13, 2016
[view latest posts]
Level 0
Category: CoD4 MP Mapping
Posted: Sunday, Oct. 9, 2016 05:47 am
Hey there. I've been messing around with Radiant for a couple of weeks now, and I managed to learn a lot of stuff. Enough to make a decent playable map. There's one thing, though, which seems impossible right now: Adding sounds.

I've went through dozens of tutorials on how to add amb sounds, with several different techniques and none of them worked. Lastly, I followed end to end this tut on youtube: https://www.youtube.com/watch?v=8GogM_ulWU8

---------------------------------------------------------------------------------------------------------------

Well, I got my fluorescent_hum.wav file under /raw/sound/amb_elements
along with a few others from another tutorial, which are working ingame.

I got a mp_mapname.csv with these lines in it:

>elm_thunder_strike,1,amb_elements/elm_thunder_strike1.wav,0.85,0.99,element,0.8,1.1,100000,,element,,,,0.5,mp_2035,,,,,250,,,0.4,,,,,
>elm_thunder_strike,2,amb_elements/elm_thunder_strike4.wav,0.85,0.99,element,0.8,1.1,100000,,element,,,,0.5,mp_2035,,,,,250,,,0.4,,,,,
>elm_thunder_strike,3,amb_elements/elm_thunder_strike1.wav,0.85,0.99,element,0.8,1.1,100000,,element,,,,0.5,mp_2035,,,,,500,,,0.4,,,,,
>elm_thunder_strike,4,amb_elements/elm_thunder_strike4.wav,0.85,0.99,element,0.8,1.1,100000,,element,,,,0.5,mp_2035,,,,,750,,,0.4,,,,,
>elm_thunder_distant,1,amb_elements/elm_thunder_dist1.wav,0.8,1,element,0.8,1,100000,,element,,,,0.5,mp_2035,,,,,750,,,0.2,,,,,
>elm_thunder_distant,2,amb_elements/elm_thunder_dist4.wav,0.8,1,element,0.8,1,100000,,element,,,,0.5,mp_2035,,,,,750,,,0.2,,,,,
>elm_thunder_distant,3,amb_elements/elm_thunder_dist1.wav,0.8,1,element,0.8,1,100000,,element,,,,0.5,mp_2035,,,,,1000,,,0.2,,,,,
>elm_thunder_distant,4,amb_elements/elm_thunder_dist4.wav,0.8,1,element,0.8,1,100000,,element,,,,0.5,mp_2035,,,,,1000,,,0.2
>fluorescent_hum,,amb_elements/fluorescent_hum.wav,0.7,0.9,element,0.9,1,7,320,element,,,looping,,all_mp,,,,,,,,,,,,,

The first 8 being for the others sounds I have (from a tutorial), and they work fine. The last one is from the sound I'm trying to add.

In game, I got a script_origin with this key: targetname/fluorhum

I got this in my mp_mapname.gsc:

main()
{

maps\mp\_load::main();
maps\mp\mp_2035_fx::main();
maps\createfx\mp_2035_fx::main();
maps\mp\mp_2035_soundfx::main();
setExpFog(1500, 10000, 0.51, 0.42, 0.48, 0);
ambientPlay("ambient_overgrown_day");

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

setdvar("r_glowbloomintensity0",".1");
setdvar("r_glowbloomintensity1",".1");
setdvar("r_glowskybleedintensity0",".5");
setdvar("compassmaxrange","1300");

thread speakers();

}
speakers()
{
sound = getent("fluorhum","targetname");
sound PlayLoopSound("fluorescent_hum");
}

I have these lines on my zone file:

rawfile,maps/mp/mp_2035.gsc
rawfile,maps/mp/mp_2035_fx.gsc
rawfile,maps/mp/mp_2035_soundfx.gsc
rawfile,maps/createfx/mp_2035_fx.gsc
rawfile,soundaliases/mp_2035.csv
rawfile,sound/amb_elements/fluorescent_hum.wav
sound,mp_2035,mp_2035,!all_mp

But now when I play, the console shouts "missing soundalias 'fluorescent_hum'"

How's that? I currently use MS Excell to edit my .csv's. I just copied the format from the multiplayer.csv. Every line is written on a single cell, one on top of another. What could it be wrong? The code? Maybe the game can't read the lines in excell the way I'm writing them? Is there another program for this?

Thanks in advance.

edit: One more piece of info. If I take out the line "rawfile,soundaliases/mp_2035.csv", and change "!all_mp" to "all_mp", the level works fine without warnings.... But my sound still does not play at all.

edit2: If I replace the .wav file with some other sound from the game, it works. Which leads me to believe it could be the file format?
edited on Oct. 8, 2016 11:06 pm by Hascalod

edited on Oct. 9, 2016 12:40 am by Hascalod
Share |
TrikX
General Member
Since: Jul 7, 2012
Posts: 129
Last: Dec 31, 2016
[view latest posts]
Level 4
Category: CoD4 MP Mapping
Posted: Sunday, Oct. 9, 2016 10:09 am
Well, did you try converting your sound to some other sound format, like mp3? (don't forget to replace .wav with .mp3 in sounaliases).

No need to do it in excel, you can simply use Notepad, it will also work.

I'll explain it like this.
No need for these lines in zone file: rawfile,soundaliases/mp_2035.csv
rawfile,sound/amb_elements/fluorescent_hum.wav

1. Make mp_yourmapname.csv file in soundaliases folder.
example: fluorescent_hum,,amb_elements/fluorescent_hum.wav,0.99,1,,,,7,9000,auto,streamed,,looping,master,mp_yourmapname,,,,,,music,,,0.1,,,,

  1. elm_thunder_strike,1,amb_elements/elm_thunder_strike1.wav,0.85,0.99,element,0.8,1.1,100000,,element,,,,0.5,mp_2035,,,,,250,,,0.4,,,,, elm_thunder_strike,2,amb_elements/elm_thunder_strike4.wav,0.85,0.99,element,0.8,1.1,100000,,element,,,,0.5,mp_2035,,,,,250,,,0.4,,,,, elm_thunder_strike,3,amb_elements/elm_thunder_strike1.wav,0.85,0.99,element,0.8,1.1,100000,,element,,,,0.5,mp_2035,,,,,500,,,0.4,,,,, elm_thunder_strike,4,amb_elements/elm_thunder_strike4.wav,0.85,0.99,element,0.8,1.1,100000,,element,,,,0.5,mp_2035,,,,,750,,,0.4,,,,, elm_thunder_distant,1,amb_elements/elm_thunder_dist1.wav,0.8,1,element,0.8,1,100000,,element,,,,0.5,mp_2035,,,,,750,,,0.2,,,,, elm_thunder_distant,2,amb_elements/elm_thunder_dist4.wav,0.8,1,element,0.8,1,100000,,element,,,,0.5,mp_2035,,,,,750,,,0.2,,,,, elm_thunder_distant,3,amb_elements/elm_thunder_dist1.wav,0.8,1,element,0.8,1,100000,,element,,,,0.5,mp_2035,,,,,1000,,,0.2,,,,, elm_thunder_distant,4,amb_elements/elm_thunder_dist4.wav,0.8,1,element,0.8,1,100000,,element,,,,0.5,mp_2035,,,,,1000,,,0.2 fluorescent_hum,,amb_elements/fluorescent_hum.wav,0.7,0.9,element,0.9,1,7,320,element,,,looping,,all_mp,,,,,,,,,,,,,


2. In your .iwd file, make sure the paths are correct. ex. iwd folder = amb_elements / File = fluorescent_hum.wav

3. In map .gsc ambientPlay("fluorescent_hum"); //Just an example

4. Zone file: sound,mp_yourmapname,mp_yourmapname,!all_mp

Try doing it like this:
Put your .iwd file in "main" folder, rename it to iw_20.iwd (can be any number) then start your map, and see if it works.

Note: Do not put your sound files in raw/sound folder, do that in an iwd file!
Share |
Hascalod
General Member
Since: Oct 7, 2016
Posts: 7
Last: Oct 13, 2016
[view latest posts]
Level 0
Category: CoD4 MP Mapping
Posted: Monday, Oct. 10, 2016 07:17 pm
Working with .csv in notepad sounds much simpler, good to know.

Being quite honest, I haven't touched .iwd files yet. What are they for and how do I use them? I understand they are a kind of "zipped" file the game uses, but I don't know what for. I read .mp3 files need to be zipped but not .wav.

Also. I succeeded in adding a custom sound in my map. But the sound I used I ripped from the game's .iwd's using WinZip. The one I made (exported as a .wav from audacity) simply did not work in game. No warnings or anything, It just doesn't play in game. I tried a different sound in there and it worked fine. Just this one specific .wav won't play. Bummer.

One more thing. Can you explain to me the difference in using

sound,mp_yourmapname,mp_yourmapname,!all_mp
or
sound,mp_yourmapname,,all_mp
?

I've seen both multiples times, but don't know what difference this makes.

Thanks!


edited on Oct. 10, 2016 12:19 pm by Hascalod
Share |
TrikX
General Member
Since: Jul 7, 2012
Posts: 129
Last: Dec 31, 2016
[view latest posts]
Level 4
Category: CoD4 MP Mapping
Posted: Tuesday, Oct. 11, 2016 02:11 pm
In .iwd file you store your custom files used in your map.
.iwd is basically a .zip file, but you need to give it .iwd extension instead of .zip, cause game won't recognize it otherwise.
So, simply make a .zip archive, and change the extension to .iwd

In iwd file you need to have folder (images) for your custom images you use in your map from raw/images, then all the sounds go to (sound) folder.
You can make subfolders in sound folder, like "misc", "ambient", "weapons", etc...

If you have custom images but didn't place them in an .iwd file, your textures will be white, that's because the game can't find those files.
Original image and sound files from the game don't need to go to your custom .iwd file because they are already packed in main/iw_00.iwd to iw_13.iwd

So, if you want to use a sound that's already in the game's iwd, you can simply load it from game's soundaliases, or make a new soundaliases line with different name, but the same path to the sound, and it will work!
No need to extract the sound from game's iwd!!!

Hope that explains it for you.

Now, difference in using those 2 lines will be explained like this, on this line: sound,mp_yourmapname,mp_yourmapname,!all_mp

First mp_yourmapname is the name of the soundaliases file, and second mp_yourmapname is the name of the map which will use the sound!

Look at this line:
  1. fluorescent_hum,,amb_elements/fluorescent_hum.wav,0.99,1,,,,7,9000,auto,streamed,,looping,master,mp_yourmapname,,,,,,music,,,0.1,,,,


You can see there is "mp_yourmapname" close to the end of the line, that mp_yourmapname means the sound will be used in mp_yourmapname

Hope you will get the point now, and i hope it helped.
Share |
Hascalod
General Member
Since: Oct 7, 2016
Posts: 7
Last: Oct 13, 2016
[view latest posts]
Level 0
Category: CoD4 MP Mapping
Posted: Tuesday, Oct. 11, 2016 08:38 pm
Oh, right. That makes sense.
But hold on now... I tried copying a soundalias entry from common.csv to use on my map and the game couldn't find it. What am I missing?

I copied this line...
emt_light_flourescent_hum,,amb_emitters/emt_flour_light_buzz.wav,0.5,0.6,element,0.95,1.05,7,400,auto,,,rlooping,0.85,launchfacility_b,,,,,,,,,,,,,

...to my soundalias, changed "launchfacility_b" to "all_mp", and changed the name.

"amb_emitters/emt_flour_light_buzz.wav couldn't be found"
Share |
TrikX
General Member
Since: Jul 7, 2012
Posts: 129
Last: Dec 31, 2016
[view latest posts]
Level 4
Category: CoD4 MP Mapping
Posted: Wednesday, Oct. 12, 2016 05:34 pm
First of all, launchfacility_b is the name of the map, located in zone/english folder, so there you need to put the name of your map (mp_yourmapname).
Secondly, i've looked into game's iwd and can't find "emt_flour_light_buzz.wav" sound either, not sure why.

Try with this line, just replace mp_yourmapname

emt_light_flourescent_hum,,amb_emitters/emt_icmb_missile_alarm.wav,0.5,0.6,element,0.95,1.05,7,400,auto,,,rlooping,0.85,mp_yourmapname,,,,,,,,,,,,,

I've replaced buzz with missile alarm sound.
If it still doesn't work, then just write to me the name of your map, and i'll make you a working soundaliases file.
I suppose it's "mp_2035" but not sure.
Share |
Hascalod
General Member
Since: Oct 7, 2016
Posts: 7
Last: Oct 13, 2016
[view latest posts]
Level 0
Category: CoD4 MP Mapping
Posted: Wednesday, Oct. 12, 2016 10:22 pm
That's what I was getting at, this sound isn't on the game's .iwd (not that I can open with winzip at least).

So, if I put on your code, it doesn't work. It tells me it has a missing alias (I changed the name to match the one on the code). However, if I change to all_mp, it works normally. Is there any problems in using it instead of my map's name on the soundalias entry?
Share |
TrikX
General Member
Since: Jul 7, 2012
Posts: 129
Last: Dec 31, 2016
[view latest posts]
Level 4
Category: CoD4 MP Mapping
Posted: Thursday, Oct. 13, 2016 03:41 pm
Don't think it's a problem, but it should work with your map name, not sure why it doesn't!
Share |
Hascalod
General Member
Since: Oct 7, 2016
Posts: 7
Last: Oct 13, 2016
[view latest posts]
Level 0
Category: CoD4 MP Mapping
Posted: Thursday, Oct. 13, 2016 10:43 pm
Bummer! Can't figure it out either. Anyway, thanks a lot for the replies. [rocking]
Share |
walter72
General Member
Since: Aug 23, 2012
Posts: 1
Last: Mar 17, 2017
[view latest posts]
Level 0
Category: CoD4 MP Mapping
Posted: Friday, Mar. 17, 2017 01:01 am
Very Nice! [biggrin][casanova][sniper]
Share |
Restricted Access Restricted Access subscribe
MODSonline.com Forums : Call of Duty 4 : CoD4 MP Mapping

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

»