Page 1 of 1

Ambient Sound Sequence?

PostPosted: Sun Dec 30, 2018 9:43 am
by RastaManGames
I have 45 sounds and i need to do tricky thing:
In interval from 1 to 2 mins 1 of 45 sounds must be played in specific spots of my map with specific radius.
How can i do that? For this moment, i just put 45 ambient sound things in one spot, but (of course) sometimes more than 1 ambient sounds are played... So... This method are dull and ambient sounds are mixed into hellish cacophony.
I need to learn about sound sequences or i can (somehow) do that trick just using ACS?
Or there is any good method to do that without hard scripting? Because map is really big and i do not want to load in-game processor too much.
Also sorry for my really awful English... :oops:

Re: Ambient Sound Sequence?

PostPosted: Sun Dec 30, 2018 9:56 am
by Enjay
Do you need the sounds to be played in a specific sequence, or do you just need one of the sound to be picked at random? If it's the second option, you can define a random sound in SNDINFO, allocate all 45 sounds to the random sound and then allocate the random sound to an ambient sound thing with suitable parameters.

e.g. from the SNDINFO in my Heretic Thief mod:

I called a sound "ambience" (probably should have gone for a better name) allocated sounds called amb01-amb29 to it (these corresponded to sound lumps with the same names - again, not best practice) and then I defined ambient sound 12 to play the sound "ambience" at a random interval (from 10 to 30 seconds) in surround sound. So, all I had to place in the map was a single sound item for sound number 12.

Code: Select allExpand view
//this sets up the random sound called "ambience"
$random ambience { amb01
         amb29 }
//This allocates sound lumps to all the entries in the ambience sound
amb01   amb01
amb02   amb02
amb03   amb03
amb04   amb04
amb05   amb05
amb06   amb06
amb07   amb07
amb08   amb08
amb09   amb09
amb10   amb10
amb11   amb11
amb12   amb12
amb13   amb13
amb14   amb14
amb15   amb15
amb16   amb16
amb17   amb17
amb18   amb18
amb19   amb19
amb20   amb20
amb21   amb21
amb22   amb22
amb23   amb23
amb24   amb24
amb25   amb25
amb26   amb26
amb27   amb27
amb28   amb28
amb29   amb29

//this sets up an ambient sound definition that can then be placed in a map
$ambient 12 ambience SURROUND RANDOM 10.0 30.0 1.0

Re: Ambient Sound Sequence?

PostPosted: Sun Dec 30, 2018 10:02 am
by Gez
See Ambient sound and Sound sequence. You may be interested especially in HereticAmbience.

Re: Ambient Sound Sequence?

PostPosted: Sun Dec 30, 2018 12:40 pm
by Graf Zahl
I think this can better be done with ACS's sound playing functions. There you have total control over which sound will be played where.
The automated playing thing are not really the best solution here

Re: Ambient Sound Sequence?

PostPosted: Sun Dec 30, 2018 2:25 pm
by RastaManGames
First i try Enjay's method... :wub:
By the way, ACS method include timer with ticks and some cycles?
I know programming little bit, but i don't understand the basic core of this method...

UPD: Thank you very much, dudes! Enjay's method are working fine! :geek:
I remember also nameless mod (idk who author of that creation), where in every level playing some dark ambient music and after few seconds some various random scary sounds (like metal screeching, wood breaking, stone moving and etc.) are playing near player (i think it's surround).