Jump to content

Sounds not working in a custom structure.


Recommended Posts

So I created this structure, it's supposed to be a crystal rock. Everything works fine but I have some weird problems with the sound of mining and breaking.

I tried to use some ingame sounds - "dontstarve/common/gem_shatter" - for when you destroy it, and - "dontstarve/common/smash_pot_2" - for when you mine it. The problem is that these sounds don't work. I experimented with it and found out that the gem_shatter sound only works when there is no inst:Remove() and the smash_pot_2 sound doesn't work at all no matter what I do with it.

I've been trying to fix this for 2 days now and still can't find the solution. Any help would be appreciated.

Here's the prefab file:

 

teststructure.lua

 

Edited by IThatGuyI
  • Like 1
Link to comment
Share on other sites

51 minutes ago, IThatGuyI said:

gem_shatter sound only works when there is no inst:Remove()

teststructure.lua

 

"If a tree falls in a forest and there is nobody, who can hear it. Does the sound of falling tree even exist? (c)"

 

Now to the point: Game can not play the sound, if you delete an object that sound is bound to.

You can use player character sound emitter instead of structure one.

like : worker.SoundEmitter:PlaySound("dontstarve/common/gem_shatter")

Also. You would better load sounds that you are using into prefab before activating it. Because sometimes game can not find sound you want to play.

"smash_pot_2" does this exist in DST? It looks like it is from hamlet dlc.

Edited by Desblat
Link to comment
Share on other sites

14 minutes ago, Desblat said:

"If a tree falls in a forest and there is nobody, who can hear it. Does the sound of falling tree even exist? (c)"

 

Now to the point: Game can not play the sound, if you delete an object that sound is bound to.

You can use player character sound emitter instead of structure one.

like : worker.SoundEmitter:PlaySound("dontstarve/common/gem_shatter")

Also. You would better load sounds that you are using into prefab before activating it. Because sometimes game can not find sound you want to play.

"smash_pot_2" does this exist in DST? It looks like it is from hamlet dlc.

Oh, I understand. I thought that the sound would play before removing the object, also, yeah I didn't even thought about the fact that there are some sounds that are in the DLCs and not in DST. Thanks for a quick response.

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
  • Create New...