NikMik Posted November 4, 2013 Share Posted November 4, 2013 I've fixed the issue. As a part of my mod, I'm adding a steam-powered robot as a follower. He does emit steam ever now and then, but I haven't been able to add sound when he emits steam. And it's currently coming out of his foot.If anyone could tell me how to position the steam and add sounds, I would be very grateful. Here's the coding for the steam: inst:AddComponent("periodicspawner") inst.components.periodicspawner:SetPrefab("poopcloud") inst.components.periodicspawner:SetRandomTimes(5, 15) inst.components.periodicspawner:SetDensityInRange(20, 2) inst.components.periodicspawner:SetMinimumSpacing(0.1) inst.components.periodicspawner:Start() I set it to play the sound and emit the smoke when I feed him gears.http://www.youtube.com/watch?v=YudCvlVAELw&feature=youtu.be Thank you.I also noticed the typo on the forum title. Didn't notice untill I'd hit post. Link to comment Share on other sites More sharing options...
Developer Cheerio Posted November 5, 2013 Developer Share Posted November 5, 2013 As a part of my mod, I'm adding a steam-powered robot as a follower. He does emit steam ever now and then, but I haven't been able to add sound when he emits steam. And it's currently coming out of his foot.If anyone could tell me how to position the steam and add sounds, I would be very grateful. Here's the coding for the steam: inst:AddComponent("periodicspawner") inst.components.periodicspawner:SetPrefab("poopcloud") inst.components.periodicspawner:SetRandomTimes(5, 15) inst.components.periodicspawner:SetDensityInRange(20, 2) inst.components.periodicspawner:SetMinimumSpacing(0.1) inst.components.periodicspawner:Start() I set it to play the sound and emit the smoke when I feed him gears.http://www.youtube.com/watch?v=YudCvlVAELw&feature=youtu.be Thank you.I also noticed the typo on the forum title. Didn't notice untill I'd hit post.Could you please upload your mod? It makes it much easier to help you out . Link to comment Share on other sites More sharing options...
NikMik Posted November 5, 2013 Author Share Posted November 5, 2013 I actually found a solution to the problem earlier today. So help is no longer necessary. Link to comment Share on other sites More sharing options...
seronis Posted November 5, 2013 Share Posted November 5, 2013 I actually found a solution to the problem earlier today. So help is no longer necessary.Even if you find your own solution, posting that solution helps other people who might be having the same difficulty you had. Link to comment Share on other sites More sharing options...
NikMik Posted November 6, 2013 Author Share Posted November 6, 2013 I couldn't exactly make it randomly happen but I could make it so he emits the smoke/sound whenever performing an action with a few simple commands in the Setgraph. I only set it to whenever he triggered the "run_start" state, which works very well; not spamming smoke everywhere, but activating only when he begins running and during the short stops during running. Here's the state with the smoke. The bold/underlined text is the added coding. State{ name = "run_start", tags = {"moving", "running", "canrotate"}, onenter = function(inst) inst.components.locomotor:RunForward() inst.AnimState:PlayAnimation("run_pre") inst.sg.mem.foosteps = 0 end, onupdate = function(inst) inst.components.locomotor:RunForward() end, events= { EventHandler("animover", function(inst) inst.sg:GoToState("run") end ), }, timeline= { TimeEvent(4*FRAMES, function(inst) local pos = Vector3(inst.Transform:GetWorldPosition()) pos.y = pos.y + 1 + math.random()*1.5 local cloud = SpawnPrefab("poopcloud") cloud.Transform:SetPosition(pos:Get()) inst.SoundEmitter:PlaySound("dontstarve/creatures/rook/steam") end), }, }, Not very specific, I know. Link to comment Share on other sites More sharing options...
brainchill Posted November 6, 2013 Share Posted November 6, 2013 "It's okaa-aaaa-aay to be ******* !!!"Khm...just my throat hurts ^^ x ) Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.
Please be aware that the content of this thread may be outdated and no longer applicable.