space iris Posted May 16, 2024 Share Posted May 16, 2024 I know that you can replace the sound through: RemapSoundEvent("path/to/original/music", "your/music/path/in/fmod/bank"). But some sounds are not registered in the Dynamicmusic.lua file. What should I do to replace the sound and where should I write it out? should I add it to Dynamicmusic.lua or to modmain? For example, I want to change the sound for RemapSoundEvent («dontstarve/HUD/Together_HUD/skin_tab_active», «music_mod/music/skin_tab_active»). I found 2 of his codes: giftitempopup.lua: function GiftItemPopUp:OnClose() TheFrontEnd:GetSound():KillSound("gift_idle") TheFrontEnd:GetSound():PlaySound("dontstarve/HUD/Together_HUD/player_receives_gift_animation_skinout") --self.spawn_portal:GetAnimState():PlayAnimation("put_away") self.spawn_portal:GetAnimState():PlayAnimation("skin_out") if self.menu then self.menu:Kill() end self.show_menu = false end thankyoupopup.lua: function ThankYouPopup:GoAway() self.can_close = false TheFrontEnd:GetSound():KillSound("gift_idle") TheFrontEnd:GetSound():PlaySound("dontstarve/HUD/Together_HUD/player_receives_gift_animation_skinout", "ty_close_sound") self.spawn_portal:GetAnimState():PlayAnimation("skin_out") --self.banner:Hide() self.item_name:Hide() self.upper_banner_text:Hide() self.right_btn:Hide() self.left_btn:Hide() self.close_btn:Hide() end how to understand which code is more correct and how to rewrite it correctly so that it replaces the sound? perhaps my question will be incorrect because it is difficult for me to communicate in two languages. I'm sorry. Link to comment https://forums.kleientertainment.com/forums/topic/156089-help-me-replace-the-sounds/ Share on other sites More sharing options...
_zwb Posted May 17, 2024 Share Posted May 17, 2024 5 hours ago, space iris said: For example, I want to change the sound for RemapSoundEvent («dontstarve/HUD/Together_HUD/skin_tab_active», «music_mod/music/skin_tab_active»). Doesn't this change the sound? You just answered the question yourself...? 1 Link to comment https://forums.kleientertainment.com/forums/topic/156089-help-me-replace-the-sounds/#findComment-1714424 Share on other sites More sharing options...
space iris Posted May 17, 2024 Author Share Posted May 17, 2024 8 hours ago, _zwb said: Doesn't this change the sound? You just answered the question yourself...? the fact is that I tried to add music during the pause of the game using this code in modmain.lua AddClassPostConstruct("screens/redux/pausescreen", function(self) if self.active then GLOBAL.TheFrontEnd:GetSound():PlaySound("music_mod/music/pause", "pausemusic") end function self:unpause() GLOBAL.TheFrontEnd:GetSound():KillSound("pausemusic") GLOBAL.TheInput:CacheController() self.active = false GLOBAL.TheFrontEnd:PopScreen(self) GLOBAL.SetPause(false) GLOBAL.TheWorld:PushEvent("continuefrompause") end end) and no music was added, then I tried to do it through RemapSoundEvent( "screens/redux/pausescreen", "music_mod/music/pause" ) And it didn't work out for me either. maybe I have indicated the path incorrectly? Link to comment https://forums.kleientertainment.com/forums/topic/156089-help-me-replace-the-sounds/#findComment-1714579 Share on other sites More sharing options...
_zwb Posted May 17, 2024 Share Posted May 17, 2024 2 hours ago, space iris said: and no music was added, then I tried to do it through Maybe it's the sound file's issue, the code seems ok. 1 Link to comment https://forums.kleientertainment.com/forums/topic/156089-help-me-replace-the-sounds/#findComment-1714608 Share on other sites More sharing options...
space iris Posted May 17, 2024 Author Share Posted May 17, 2024 8 hours ago, _zwb said: Maybe it's the sound file's issue, the code seems ok. "sound file's issue" is it in terms of incorrectly configured in FMOD or is the sound itself incorrect? Link to comment https://forums.kleientertainment.com/forums/topic/156089-help-me-replace-the-sounds/#findComment-1714899 Share on other sites More sharing options...
_zwb Posted May 17, 2024 Share Posted May 17, 2024 1 hour ago, space iris said: "sound file's issue" is it in terms of incorrectly configured in FMOD or is the sound itself incorrect? Would the sound play if you execute this command in the console? TheFrontEnd:GetSound():PlaySound("music_mod/music/pause") If not then it's the sound file's issue, could be either FMOD configurations or sound itself. Link to comment https://forums.kleientertainment.com/forums/topic/156089-help-me-replace-the-sounds/#findComment-1714933 Share on other sites More sharing options...
space iris Posted May 18, 2024 Author Share Posted May 18, 2024 (edited) 7 hours ago, _zwb said: Would the sound play if you execute this command in the console? TheFrontEnd:GetSound():PlaySound("music_mod/music/pause") If not then it's the sound file's issue, could be either FMOD configurations or sound itself. well, it only works in the main menu, but when I go into the world and try to do it there through the console, it doesn't play. however, when I pause via Esc and exit, then after a pause, you can hear the music that is given during the pause playing, but it lasts a couple of seconds and stops. Edited May 18, 2024 by space iris Link to comment https://forums.kleientertainment.com/forums/topic/156089-help-me-replace-the-sounds/#findComment-1715015 Share on other sites More sharing options...
_zwb Posted May 18, 2024 Share Posted May 18, 2024 6 hours ago, space iris said: well, it only works in the main menu, but when I go into the world and try to do it there through the console, it doesn't play. however, when I pause via Esc and exit, then after a pause, you can hear the music that is given during the pause playing, but it lasts a couple of seconds and stops. Try TheFocalPoint.SoundEmitter:PlaySound("music_mod/music/pause") Link to comment https://forums.kleientertainment.com/forums/topic/156089-help-me-replace-the-sounds/#findComment-1715126 Share on other sites More sharing options...
space iris Posted May 18, 2024 Author Share Posted May 18, 2024 3 hours ago, _zwb said: Try TheFocalPoint.SoundEmitter:PlaySound("music_mod/music/pause") this console command does not work in the main menu and in the world itself. I noticed that if you disable the auto-pause when pressing Esc, the music will play, but also for a couple of seconds and silence. Link to comment https://forums.kleientertainment.com/forums/topic/156089-help-me-replace-the-sounds/#findComment-1715164 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