Page 1 of 1

Help needed with custom sound effects! (SMBX 2)

Posted: Mon Jul 08, 2019 3:37 pm
by Tepig125
I'm working on an episode of SMBX right now, and in one of the levels, I was hoping to have Hat Kid from A Hat in Time over the playable Bowser in SMBX2/PGE. Although I was able to replace the graphics easily and was able to get the sounds.ini file to work for some sounds, I have run into two major issues with the sound effects, and even after spending a few hours researching, I haven't been able to find any way to fix them. Any help would be much appreciated!
1. I have the "Time Piece Get" sound effect from AHiT replacing the "Star Get" sound, and although it works well for the most part, the sound effect is cut off after about four seconds(it's about 7 seconds long). I've tried it both testing through the level editor and by playing it like a normal level, but in both cases, it was cut off by the level ending. So is there any way to lengthen the ending sequence of the level? I would imagine that it might require Lua, but being very inexperienced with it, I don't actually know if I would be able to use that or not.
2. Because I currently have Hat Kid over playable Bowser, who replaces various sounds- most notably, sound-5(the hurt/shrink sound effect) and sound-77(Link's stab sound effect)- it seems that Bowser's sound changes override the sounds.ini file in my level folder. Is there any way I can replace Bowser's sounds without having to replace the actual files? (Because that would only change it in my copy of SMBX2) I'm pretty sure that, out of the two issues, this one is more likely to be possible to fix, but I can't say for certain. Edit: I actually figured this one out myself! I just needed to place a sound with an identical name to the original sound in my level folder.
(Also, there are some other things I'm having troubles with in the level, namely the fact that playable Bowser's attack has the secondary effect of "recruiting" enemies(mostly Goombas and Koopas) and has no effect on most enemies(with bosses being the main exception) that he can't "recruit"- something which I'd like to change if possible- and the fact that his HUD seems to be hard-coded and as such, doesn't seem to be easily changeable like most graphics, but I figured I'd tackle one problem at a time, and the sound effects seemed like the more important thing to fix)

Re: Help needed with custom sound effects! (SMBX 2)

Posted: Tue Jul 16, 2019 8:37 pm
by Lemlime25
Maybe by using an exit type that goes on for longer (for example, the SMW goal tape) the sound won't be cut off? I'm not too sure that that'll work, but I think it's worth a try. Also, I actually need YOUR help because I don't understand how you were able to replace any sound effects. I've looked at almost every thread about this and done what was suggested but it never works. Maybe I'm just stupid and don't understand what I'm supposed to do with the sounds.ini file. Thanks in advance!

Re: Help needed with custom sound effects! (SMBX 2)

Posted: Tue Jul 16, 2019 9:34 pm
by Tepig125
Oh! I don't blame you for having issues with sounds.ini, as it took me a while to figure it out as well. Here's what I did, though:
1. Find the "_templates" folder, which is in the "data" folder of SMBX. In there is a template file titled "sounds.ini"
2. Copy and paste that file into your episode folder. For example: "SMBX2/data/worlds/game_name_here" (You can also put it in the level folders, like "SMBX2/data/worlds/game_name_here/1-1" if you only want sound changes for a particular level!)
3. After copying the file, you can open the file in a program like Notepad++, and from there you will see stuff like this:
[sound-1]
name="Jump"
file="sound/player-jump.ogg"
4. What you need to do is replace "sound/player-jump.ogg"(or whatever sound you want to swap out) with the name of the custom sounds, relative to the sounds.ini file. For example, in my Hat in Time level's folder, I have the sounds.ini file, and to replace the jump sound with a file in that level folder, I would put this in the sounds.ini file:
[sound-1]
name="Jump"
file="hatkid-jump.ogg"
(As a note, you don't need to put stuff like "sound/file.ogg", just the file name("file.ogg"), as long as the sound file is in the same folder as the sounds.ini file! If it's in a folder in the level folder, then you'd have to put something like "hatkid-sounds/hatkid-jump.ogg", as an example. Additionally, I believe the sound can be an MP3, wav, or ogg file, and it should work either way)
Also, for custom characters, such as Klonoa or Uncle Broadsword, it's actually easier- all you need to do is find their sound files(such as "ub-swipe.wav"), and place a sound file with an identical name in the level or world folder. In this case, I believe it does to be a .wav file, but I could be wrong!
Hopefully this helps! Also, regarding using a different level exit, that sadly isn't an option, as I want the player to earn a Star(or Time Piece in this case) upon clearing this level. Otherwise I would definitely have used that idea!

Re: Help needed with custom sound effects! (SMBX 2)

Posted: Tue Jul 16, 2019 10:03 pm
by Lemlime25
Thank you so much for the help! I was replacing the "sound/soundname.ogg" with something like "worlds/worldname/1-1/soundname.ogg" since I thought I would have to write it out relative to the sounds.ini file in the data folder. Also, I sadly have no other ideas for fixing your issue other than using lua, although I don't even know if that'd work either since I'm not too experienced with the using the language in SMBX. I wish you the best of luck in solving your problem!

Re: Help needed with custom sound effects! (SMBX 2)

Posted: Tue Jul 16, 2019 10:04 pm
by Tepig125
Thanks! I'm glad I was able to help!