Note: LucasForums Archive Project
The content here was reconstructed by scraping the Wayback Machine in an effort to restore some of what was lost when LF went down. The LucasForums Archive Project claims no ownership over the content or assets that were archived on archive.org.

This project is meant for research purposes only.

Playing a sound using scripting

Page: 1 of 1
 Silveredge9
10-23-2006, 10:27 PM
#1
How would I script a sound to play? The method below that I've tried doesn't seem to work. (I'm working on KOTOR1)


object oSound = GetObjectByTag("NAMEOFSOUND");
SoundObjectPlay(oSound);

Thanks for any help on this in advance. :)
 Tupac Amaru
10-24-2006, 3:44 AM
#2
The script is correct. You have to make a sound object first. Look in the _s.rim->Blueprint, Sound module files for some examples. Then you need to specify the position of the sound object in the .git file under SoundList.
Most sound object have a cutoff distance. When playing them with a script, don't be too far away from its centre or you won't hear.

A simpler method is to use the PlaySound(string sSoundName) command, where sSoundName is the name of the .wav in StreamSounds, but you can't freely position the sound that way.
Page: 1 of 1