. . . Posted August 25, 2016 Share Posted August 25, 2016 (edited) Hello, I have a problem if somebody could help me . So, here's the code. timeline = { TimeEvent(18*FRAMES, function( inst ) inst.SoundEmitter:PlaySound("dontstarve/creatures/worm/death") inst.SoundEmitter:PlaySound("dontstarve/creatures/werepig/howl") inst.SoundEmitter:PlaySound("dontstarve/creatures/worm/distant") inst.SoundEmitter:PlaySound("dontstarve/creatures/werepig/grunt") inst.SoundEmitter:PlaySound("dontstarve_DLC001/creatures/vargr/howl") inst.SoundEmitter:PlaySound("dontstarve_DLC001/creatures/bearger/grrrr") end), TimeEvent(78*FRAMES, function( inst ) inst.SoundEmitter:KillSound("dontstarve/creatures/worm/death") inst.SoundEmitter:KillSound("dontstarve/creatures/werepig/howl") inst.SoundEmitter:KillSound("dontstarve/creatures/worm/distant") inst.SoundEmitter:KillSound("dontstarve/creatures/werepig/grunt") inst.SoundEmitter:KillSound("dontstarve_DLC001/creatures/vargr/howl") inst.SoundEmitter:KillSound("dontstarve_DLC001/creatures/bearger/grrrr") end), }, The PlaySound plays the sounds properly but when I want KillSound to mute/stop them it doesn't! Isn't KillSound supposed to mute/stop the sounds? Edited August 25, 2016 by SuperDavid Link to comment Share on other sites More sharing options...
rezecib Posted August 25, 2016 Share Posted August 25, 2016 @SuperDavid If you look more carefully at how KillSound is used, for example in the Lavae "thawing" state... State{ name = "thaw", tags = {"busy", "thawing"}, onenter = function(inst) if inst.components.locomotor then inst.components.locomotor:StopMoving() end inst.AnimState:PlayAnimation("frozen_loop_pst", true) inst.SoundEmitter:PlaySound("dontstarve/common/freezethaw", "thawing") end, onexit = function(inst) inst.SoundEmitter:KillSound("thawing") end, events = { EventHandler("unfreeze", function(inst) inst.components.health:Kill() end), }, }, PlaySound has an optional second argument for a sound "label", and you give KillSound the label. Link to comment Share on other sites More sharing options...
. . . Posted August 25, 2016 Author Share Posted August 25, 2016 9 hours ago, rezecib said: PlaySound has an optional second argument for a sound "label", and you give KillSound the label Yes, thank you shortly after I posted this I realized that but my internet went off so I could put this as solved, but thank you for telling me too ~!!! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now