There is a zombie that spawns with a door that has not opened yet. i want to be able to go from the two doors as shown in this figure i do not understand whether I need a code order but I want you to help me.
If what your're looking for is falloff distance, that is set up in the csv file that the sound you are playing is located in. You will need to make this a 3D sound and set the distances up. If I were you I would read "sound_mod_docs" in your bo3root/docs_modtools folder. It explains setting up aliases. Basically a "sound file" within the cod engine is sort of an array of variables in which the engine processes and modifes the way the sound is played based on the criteria that you declare in the csv file. So essentially, the game will never just play a raw wav file without adjusting the properties of the sound based on the csv, for the most part.
But first before you get into that headache, what function exactly are you using to play the radios? Generally if you want a 3d sound to have falloff distance, default sounds probably have this set up in the csv already, so if you are doing:
Code Snippet
Plaintext
player PlaySound("radio_sound"); //This function plays the sound TO the player, not in 3d space. So it is at full volume always, at least as I have observed before.
//You want to do : PlaySoundAtPosition("radio_sound", (x,y,z)); //While this function plays the sound in 3d space, so the volume will scale according to the distance the player is from the origin of the sound. //or PlaySoundAtPosition("radio_sound", entity.origin);
Hope that helps you.
*Keep in mind some of the sounds you might be using could possibly be set up as 2D sounds and not 3D, so you probably won't hear them in game if you are doing PlaySoundAtPosition() in some cases. Also, be careful when editing the sound aliases, because if you put erroneous data into any of the fields, this will fuck up the sound and it will either not play at all, or just sound undesirable. That is why I recommend reading that document I pointed out earlier. I went through this hassle before setting up sounds, and as long as you have patience and a bit of time it's not really that hard you will find. says yoda
Thank you for your reply. Is targetname etc. necessary? I did this way, but have anything changed?
Code Snippet
Plaintext
function radio_sound() { //You want to do : PlaySoundAtPosition("radio_sound", (20,20,20)); //While this function plays the sound in 3d space, so the volume will scale according to the distance the player is from the origin of the sound. //or PlaySoundAtPosition("radio_sound", entity.origin); }
//A comment is //comment. Compiler skips code with // #using scripts\zm\_zm_utility; //use a script outside of current scope while(1) { //loop begin. Run code while true. If 1 becomes zero loop stops. ent = GetEnt("ent","targetname"); //locates an object named "ent". Make this a script_struct or script_origin zm_utility::play_sound_at_pos("a_sound", ent.origin); // play sound with name "a_sound" at the object if (break_out_of_loop) {break;} //clause to stop the sound if necessary wait(insert_sound_length_here); //ex. wait(3) stops code for 3 seconds } //loop end
What should I change this code and what should I put in there? Will you teach me?