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.
Sound Script
Moderator: Core Staff
-
- Core Staff
- Posts: 13315
- Joined: April 13th, 2005, 8:22 pm
- Location: UK, London
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.
If you can hear the sound outside of the room, you need to adjust the distance in the csv file.
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);
}

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
Who is online
Users browsing this forum: No registered users and 1 guest