Jump to content

Blocks that continuously produce sound?


khzmusik

Recommended Posts

Hi, all.

 

Does anyone know how to create a block that continuously emits a sound? I know it's possible - dumpsters emit the sounds of flies, neon signs emit a buzzing sound, etc.

 

I know the sound node I'd like to use, but I can't work out the way to hook up the sound to the block. I looked that the block XML for some blocks that do this (e.g. the aforementioned dumpster) but there doesn't seem to be any connection between the block and the sound node.

 

What am I missing? Is this even done through XML at all? 

Link to comment
Share on other sites

Bump...?

 

I think either I am missing something very stupid - or it's just not possible to do this with XML. (Though, if it doesn't involve XML, I don't know why there are those sound nodes in the sounds.xml file.)

 

If you want my specific use case, I created a new refrigerator block, and I want to signify that it's running by having it play the "FridgeLP" sound from sounds.xml.

 

Link to comment
Share on other sites

(Bump)....I’m also interested in how these vanilla sounds link to blocks.  
 

I don’t know the answer to your direct question (about the fridge).  My guess is that the XML for the sounds exists as maybe documentation or due to some export, and the actual sound is linked differently for those special sign/fridge/dumpster blocks. If it’s not hard coded in the game somewhere , then it has to be in the blocks themselves. or maybe through some special tag (in those blocks) that tells it which sound node to play.

 

I believe you can load/add a sound to a block in Unity.  It’s completely outside of the sounds.xml though, so you would have to extract the sounds you want first then directly attach them to the block prefab in Unity. I’m partially making this up as I have personally never done it, just something I believe have read on the forums about creating new sounds.  I think In unity you can add a sound and then “place it” around or near a block/prefab and dictate sound volume, placement, etc.

 

anyway, this might be a workaround or it might be a lot of hot air.  Hopefully someone better versed in Unity might answer it and maybe be able to say if there’s a tag/item/script in the blocks that is linking to sounds.xml as I would believe it’s more desirable to have the sounds there than directly loaded into the blocks. I poked around myself in Unity and could not find the answer to how it’s linking the sounds for the buzzing signs, but I’m a rank amateur in Unity.


note: if this can be figured out I plan to add all sorts of sounds to blocks :) . First up is adding ticking to the clocks.

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...