whismerhill Posted September 29, 2016 Share Posted September 29, 2016 (edited) hi it's me again, my "DigYourCaveEntrance" mod project is nearly complete thanks to you guyz. I have one little issue remaining. I already added as an optional feature the ability to get a day pass-by quickly (as if you slept through it, except the character doesn't regain anything since he's not sleeping) while the screen is black I'm trying to play several sounds : local Player = GetPlayer() ... for i=0,2 do Player:DoTaskInTime(i/3, Player.SoundEmitter:PlaySound("dontstarve/wilson/dig") ) end for i=3,4 do Player:DoTaskInTime(i/3, Player.SoundEmitter:PlaySound("dontstarve/wilson/use_pick_rock") ) end Player:DoTaskInTime(2, Player.SoundEmitter:PlaySound("dontstarve/wilson/dig") ) And I hear only one "pick" sound, the thing is I don't understand why it wouldn't be working sure I guess the alternative way would be to build a single custom sound composed of those (may need tweaks), however I don't think I am able to do that notes: already tried changing the delay from i/3 to just i (which should increase the delay between sounds) to no avail... Edited September 29, 2016 by whismerhill Link to comment https://forums.kleientertainment.com/forums/topic/70542-sound-delayloop-as-script/ Share on other sites More sharing options...
whismerhill Posted September 29, 2016 Author Share Posted September 29, 2016 well I found a function "TimeEvent" I'm gonna try with this one instead of dotaskintime Link to comment https://forums.kleientertainment.com/forums/topic/70542-sound-delayloop-as-script/#findComment-820210 Share on other sites More sharing options...
Mobbstar Posted September 29, 2016 Share Posted September 29, 2016 Do you set the tasks after the time jump you had mentioned? Link to comment https://forums.kleientertainment.com/forums/topic/70542-sound-delayloop-as-script/#findComment-820217 Share on other sites More sharing options...
whismerhill Posted September 30, 2016 Author Share Posted September 30, 2016 (edited) 4 hours ago, Mobbstar said: Do you set the tasks after the time jump you had mentioned? no the sound happens before it, the time jump is in a "do task in time of its own" with a delay of 3 EDIT: here's the code : Spoiler if timepassesby then Player.HUD:Hide() TheFrontEnd:Fade(false,1) for i=0,2 do Player:DoTaskInTime(i/3, Player.SoundEmitter:PlaySound("dontstarve/wilson/dig") ) end for i=3,4 do Player:DoTaskInTime(i/3, Player.SoundEmitter:PlaySound("dontstarve/wilson/use_pick_rock") ) end Player:DoTaskInTime(2, Player.SoundEmitter:PlaySound("dontstarve/wilson/dig") ) Player:DoTaskInTime(5, function() if Player.components.hunger then Player.components.hunger:DoDelta(-TUNING.CALORIES_SMALL, false, true) --add to that the natural hunger drain of the 24h end if Player.components.sanity then Player.components.sanity:DoDelta(-TUNING.SANITY_LARGE, false) end if GetClock():IsDay() then GetClock():MakeNextDay() else --if GetClock():IsDusk() then GetClock():MakeNextDusk() end Player.HUD:Show() TheFrontEnd:Fade(true,1) end) end "if isdusk" is commented out because it's a reminder, at this point in the code, night was checked before so it's dusk or dusk Edited September 30, 2016 by whismerhill Link to comment https://forums.kleientertainment.com/forums/topic/70542-sound-delayloop-as-script/#findComment-820339 Share on other sites More sharing options...
Mobbstar Posted September 30, 2016 Share Posted September 30, 2016 I suggest disabling the player controller and also making the player invincible for the time of excavation. As for the actual issue at hand, I'm afraid I can't think of anything right now. Link to comment https://forums.kleientertainment.com/forums/topic/70542-sound-delayloop-as-script/#findComment-820414 Share on other sites More sharing options...
whismerhill Posted October 2, 2016 Author Share Posted October 2, 2016 Thanks for all the help, I just changed it to a single "dig" sound. which works. Link to comment https://forums.kleientertainment.com/forums/topic/70542-sound-delayloop-as-script/#findComment-821388 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