Jump to content

Ambient Sound distance help please.


Recommended Posts

I have a disco level where I have dance floors and when I get close to them I want the music to get more and more clear but I have no clue how to do it, no clue on the script or what to do with the actor, here is a screenshot of the idea, where I want to place the actor for the music to play at those spots specifically, the white arrow will show you. Thank you for your time guys.

example.PNG

Share this post


Link to post

What map format are you working with/what port(s) are you targeting?

Edited by kwc

Share this post


Link to post
10 hours ago, kwc said:

What map format are you working with/what port(s) are you targeting?

 

Sorry for the late response UDMF GZdoom and Zandronum,

Share this post


Link to post

You could then try playing with PlaySound attenuation parameter in a script.

Try setting it to 0.1 and see how far you can hear it.

Share this post


Link to post
7 hours ago, Kan3 said:

You could then try playing with PlaySound attenuation parameter in a script.

Try setting it to 0.1 and see how far you can hear it.

 

What script though

Share this post


Link to post

A question first: are you using the music you want to play in this way as a music track for the whole map or you're using it separately in a ZDoom thing in that room?

After that: basically you just have to create an OPEN script in the script editor and use the function PlaySound(all of the parameters needed here); like the wiki shows.

You then give a thing inside the sector you want a tid and write this as the first parameter of the PlaySound function.

Share this post


Link to post
7 minutes ago, Kan3 said:

A question first: are you using the music you want to play in this way as a music track for the whole map or you're using it separately in a ZDoom thing in that room?

After that: basically you just have to create an OPEN script in the script editor and use the function PlaySound(all of the parameters needed here); like the wiki shows.

You then give a thing inside the sector you want a tid and write this as the first parameter of the PlaySound function.

 

Okay so this is the script I made and here is the thing that is on the map. The script says unknown script though, also this is the SNDINFOimage.png.25990cf4d88c141db1886694e388ca22.png

image.png.11e14ae4a808671e699aa7eb09a03a3d.pngimage.png.7ceb403ce975e7630a47bcb285e65fec.png

Share this post


Link to post
10 minutes ago, Kan3 said:

A question first: are you using the music you want to play in this way as a music track for the whole map or you're using it separately in a ZDoom thing in that room?

After that: basically you just have to create an OPEN script in the script editor and use the function PlaySound(all of the parameters needed here); like the wiki shows.

 You then give a thing inside the sector you want a tid and write this as the first parameter of the PlaySound function.

 

And no its not a music for the whole map its a "Sound" aka music that ONLY plays in that area that I showed in the picture all the way up, the same way the bar music plays in Duke Nukem 3D E1M2.

Share this post


Link to post

Seen the CustomAmbientSound Thing (that I never even know about its existance) I'm quite sure you don't need anything else to make it work actually.

You need to modify your SNDINFO lump though.

 

If you want to use CustomAmbientSound you need to first define an actual ambient sound like it specifies here.

So, in your context, your SNDINFO should look like this: 

$ambient	14065	DISCOO	continuous	1.0

(under your "DISCOO   DISCOO" obviously, which is still necessary).
Now you can use this sound/music with that thing (Specified with the index parameter "14065", where you can choose which existing thing should play a sound).
Inside the builder now, place a CustomAmbientSoun, select the right index (that should be the one that you just created), the volume you want, the minimum fading distance in map units and the maximum heard distance in map units (you need to set a value for both to apply the changes, that you can see with the circles emitted by the thing in the editor), the distance multiplier is not really needed.

Just for info purposes:

Did you "include" zcommon.acs ?

And in the first parameter you don't write the thing type, but the tid/tag that you set on the thing (in that case I can see that it has a tag of 29) and with an attenuation so high you will basically be able to hear the music only in that room and nowhere else.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...