How to .. make a gong sound.
Moderator: Event DM
-
- Master Sage
- Posts: 5178
- Joined: Thu Oct 24, 2002 7:35 pm
- Location: Germany (+1 GMT)
- Contact:
How to .. make a gong sound.
I am currently redecorating my Temple, and with the process, two gong-related questions came up:
A: If I have a free-standin gong, how to I make it produce a sound when used?
B: If I have a pull-cchain Doorbell, how do I make her sound be heard i naother area (upstairs)?
Answering these would greatly help me in finishing the area.
A: If I have a free-standin gong, how to I make it produce a sound when used?
B: If I have a pull-cchain Doorbell, how do I make her sound be heard i naother area (upstairs)?
Answering these would greatly help me in finishing the area.
- JollyOrc
- Elder Sage
- Posts: 3984
- Joined: Fri Jan 17, 2003 11:41 am
- Timezone: Europe, CE(S)T
- Location: Germany
- Contact:
Re: How to .. make a gong sound.
I know I'm not really helping here, but I know that the 1%ers have it set up that pulling the chain activates a light in the upper floor. Guess that this script can be altered to sound something.Starslayer_D wrote:I am currently redecorating my Temple, and with the process, two gong-related questions came up:
A: If I have a free-standin gong, how to I make it produce a sound when used?
B: If I have a pull-cchain Doorbell, how do I make her sound be heard i naother area (upstairs)?
Answering these would greatly help me in finishing the area.
Is there a gong in the soundset ?
Yep, this can be done. You need to have an invisible object in each place you want the gong to be heard. Here's the script I use (although I'd be interested in seeing if anybody has a more efficient method):
You'll need one object line and one AssignCommand for each invisible object. The tag of each invisible object should match the appropriate tag named in the object line. The above example will force the invisible objects to play the sound, and when they are placed in scattered locations, will ensure that you can hear it wherever you need. If you need more than three, just add invisible objects to the floorplan, and add corresponding lines to match.
Tanmar
*amateur code monkey*
Code: Select all
void main()
{
object oBell1 = GetObjectByTag("sk_doorbell1");
object oBell2 = GetObjectByTag("sk_doorbell2");
object oBell3 = GetObjectByTag("sk_doorbell3");
AssignCommand(oBell1,PlaySound("as_cv_gongring2"));
AssignCommand(oBell2,PlaySound("as_cv_gongring2"));
AssignCommand(oBell3,PlaySound("as_cv_gongring2"));
}

Tanmar
*amateur code monkey*
-
- Master Sage
- Posts: 5178
- Joined: Thu Oct 24, 2002 7:35 pm
- Location: Germany (+1 GMT)
- Contact:
- Lafferty
- Scholar
- Posts: 1129
- Joined: Tue Feb 11, 2003 5:08 pm
- Location: look at my hands... they are HUGE. And they cant touch themselves...
- Contact:
If you want the sound to be heard in the whole other area(s)
use this... you can also adjust the volume
(put in OnUsed or in OnDamaged of a placeable like the gong)
I used this code for my house...
twsp_bell_lower / ...._upper are sound sources.
Originally i set them to mute... but it didnt work. I always heard the gong sound a few secs after i entert a floor.
So i set their volume to 0... The script does the rest.
For the sound to be heard in the whole area you need to edit the sound source properties. The nice thing is you can also edit the sound source properties to allow variation is loudness and pitch.
AH.... you may notice that the gong is louder in the lower floor than in the upper.
I hope this is helpful
use this... you can also adjust the volume
(put in OnUsed or in OnDamaged of a placeable like the gong)
Code: Select all
// Script for the Twospring house doorbell
void main() {
//Plays the sound as_cv_gongring1 at the players location
PlaySound("as_cv_gongring1");
/*plays the same sounds at the locations of the other two sound
sources: in the main floor and in the private rooms*/
object oSound1 =GetObjectByTag("twsp_bell_lower");
object oSound2 =GetObjectByTag("twsp_bell_upper");
// The sounds volume is defined 0, so it has to be raised first
SoundObjectSetVolume(oSound1, 96);
SoundObjectSetVolume(oSound2, 72);
// Playing the sounds of the placed sounds
SoundObjectPlay(oSound1);
SoundObjectPlay(oSound2);
// resetting the sound volume. This has to be delayed
DelayCommand(5.0, SoundObjectSetVolume(oSound1, 0));
DelayCommand(5.0, SoundObjectSetVolume(oSound2, 0));
}
I used this code for my house...
twsp_bell_lower / ...._upper are sound sources.
Originally i set them to mute... but it didnt work. I always heard the gong sound a few secs after i entert a floor.
So i set their volume to 0... The script does the rest.
For the sound to be heard in the whole area you need to edit the sound source properties. The nice thing is you can also edit the sound source properties to allow variation is loudness and pitch.
AH.... you may notice that the gong is louder in the lower floor than in the upper.

I hope this is helpful
Tool for crafters Do you want some human to your salt? nomanisanisland.monolar.de
-
- Master Sage
- Posts: 5178
- Joined: Thu Oct 24, 2002 7:35 pm
- Location: Germany (+1 GMT)
- Contact:
- Lafferty
- Scholar
- Posts: 1129
- Joined: Tue Feb 11, 2003 5:08 pm
- Location: look at my hands... they are HUGE. And they cant touch themselves...
- Contact:
Code: Select all
// put this in OnUsed of a placeable
// Plays a sound at the location of the placeable
void main() {
// Plays sound "as_cv_gongring1"
PlaySound("as_cv_gongring1");
}
Tool for crafters Do you want some human to your salt? nomanisanisland.monolar.de
-
- Master Sage
- Posts: 5178
- Joined: Thu Oct 24, 2002 7:35 pm
- Location: Germany (+1 GMT)
- Contact:
- Jordicus
- Team Member; Retired with Honors
- Posts: 8042
- Joined: Tue Jan 21, 2003 3:46 pm
- Location: Whitehall, PA (GMT -4)
- Contact:
you could maybe do it with a combination. make a script for a specific chair. When the chair is used, then the PC would sit on the chair and then you could delay specific sound effects and make the PC stand back up after a certain amount of time. I'm sure you could even play with some water sounds for a nice flush.. 
