HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Correct use of sounds in triggers.

02-04-2009, 01:49 PM#1
Na_Dann_Ma_GoGo
Hi,
I've got several questions about sounds. [and if there's s.th. special about them, please tell me]

1. Do I use 3D sounds for sounds, that are attached to a point / unit only?
2. How to play a sound attached to a unit with natives only.
3. How to clean up sounds after using them. When to use DestroySoundWhenDone() etc. / is it necessary to null local sounds?
02-04-2009, 04:13 PM#2
DioD
1) Check GUI, if operation possible in GUI it OK.
2) PlaySound()
3) Sounds cannot be destroy, use permanent global sounds.
02-04-2009, 04:44 PM#3
Ammorth
3D sounds can have their position set with some native (can't remember then name and at school). Something like SetSoundPosition() or AttachSoundToUnit().

Note: a sound can only be played once at a time. If you need sounds to play ontop, you need multiple sound handles. You can create and destroy sound handles on the fly, but you cannot create a sound handle in the same thread as you start it. You need to use a 0 second timer to play it after you create it.

It is better to make a stack of soundHandles and just draw from them than to dynamically create and destroy.
02-04-2009, 07:11 PM#4
Na_Dann_Ma_GoGo
Thanks for answers. Helped a little ;P