Sound Script

Have questions about CoD/UO mapping that aren't covered in the tutorials section? Post here!

Moderator: Core Staff

Post Reply
Cr@sh
CJ Wannabe
CJ Wannabe
Posts: 22
Joined: October 18th, 2006, 1:59 am

Sound Script

Post by Cr@sh » October 18th, 2006, 2:01 am

Hey, i was wondering if anyone could help me with a sound script, so that when you enter a different room, the music changes
xfire: crash636

PLZ help if you can TY

Edit Drofder: removed Email.
Image

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13315
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Post by Drofder2004 » October 18th, 2006, 2:44 pm

hi, welcome to the forum.

If all you want is different sound in each room, you need not make a script to do each sound, you just need to work out the correct values for your csv files. I am assuming you have the sound working ingame.

In each room (in the centre), place a script_origin (right-click 2d window and select script_origin).
Now, with the script_origin selected, press N to open the entities window.
Now, in the boxes below (key and value) enter
targetname (in key)
<room name> (in value)
Change <room name> to a name you assign to each room.

Now you have your map set up, you need to get a script to play all the music.

Code: Select all

main()
{
   _music();
}

_music()
{
roomA = getent("<room name>", "targetname"); // change room name to value you used above
roomB = getent("<room name>", "targetname");
//etc

roomA thread _loopsound("<alias>"); //change <alias> to the alias in the csv file
roomB thread _loopsound("<alias>");
//etc
}

_loopsound(sound)
{
self playLoopSound(sound);
}
If you can hear the sound outside of the room, you need to adjust the distance in the csv file.
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

Cr@sh
CJ Wannabe
CJ Wannabe
Posts: 22
Joined: October 18th, 2006, 1:59 am

Post by Cr@sh » October 19th, 2006, 2:54 am

ok thank you so much
Image

creator
CJ Worshipper
CJ Worshipper
Posts: 492
Joined: July 6th, 2006, 11:37 pm
Location: The Netherlands
Contact:

Post by creator » October 28th, 2006, 9:15 pm

how does the sound in a object works?

like a elevator, go in the elevator then the elevator doors close
with this command u play the sound
play <soundname> , but what u need to have inside radiant to make it work? or only the elevator doors?
Cod 1 Mapper&Modder&Moddeler

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest