Lethal Company - How to mod in your own sounds from scratch!

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
what's up uh what's up guys it's minks in the last video in this particular series we actually uh created a sort of basic mod that gave us infinite Sprint we didn't really do much else with it in this video it's actually going to be pretty much just as simple uh the only difference is we're going to be doing with audio files it is a little bit more complicated and we're actually going to be going through and creating an asset bundle which is also fairly easy once you get used to it uh so ultimately everything will be a little easy or fairly easy Once you figure it out uh once you figure it out then you can kind of go off and have plenty of fun with it so let's uh let's get started with the asset bundle let's get that out of the way cuz we need to have an asset bundle to actually do anything with it so um let me actually go over to this real quick the unity Hub so in the unity Hub we have I have two installs I installed the latest version or whatever that is uh whatever recommended latest version whatever it installed when I originally downloaded this and then I have 22.3 point9 I recommend using 22.3 3.9 it seems to be the one that works the best for this so if you don't have it hit install editor and it's not going to be on official releases um find it in archive download archive and go to 2022 3.9 go ahead and download it however you want to if you've downloaded it and installed it and it's not showing up in this list use the locate by default it goes into program files under Unity so go ahead and get that and create a project create an empty 3D project and once you're here uh you can pause it once you're here go ahead and resume and let's proceed so once you're here go ahead and right click on assets create a new C script and we're going to call this one what do we want to call it create asset bundle or something oops well that's what I get a second rename actually we don't want to create this here excuse me delete that we're going to create a new folder inside of assets and call it editor call it editor so create a new folder editor then inside of here create a new C sh uh C script we'll call it create asset bundle that's fine and once it's done that it should kind of load like checking stuff and once it's done go ahead and open it up it should open in visual studio now if your Visual Studio doesn't have the correct components installed it's going to bug you and be like hey you couldn't open this up you want to install this go ahead and install the uh uh game development with unity or C or whatever it calls it so that it gets off your ass about having that once you've done that come back here reopen it and go ahead and delete everything in this file and paste in um I'm going to leave this in the description or in a comment or maybe in a link somewhere down there I don't know depends on what's available um but it'll be available there copy and paste that in save it and close out um all that does is give us the ability to actually create asset bundles um because Unity doesn't just do that it not like it's complicated or anything uh so you know it's a small script and don't need to do anything once you click off it should kind of load and then you'll be fine go back to your root directory of assets and you can either drag and drop it or um let me move this over here or uh right click in here and do import new asset um I'm going to be using a Scooby laugh. wve file make sure it's wve Not MP3 whether you got to convert it with FFM Peg or go online or whatever you got to do um audacity maybe go ahead and get it to wave and drag and drop it or import it into your Unity project once that's done go ahead and click on the file and select an asset bundle I have SCU here I'm going to remove that and just do a new one and I'm just going to call mine SCU because it's scoop and this is going to be the name of the actual asset bundle that gets created and if you have multiple you're going to go ahead and select multiple of them and do the same thing for all of them um I'm only going to do one here that's all I need so because it's just for testing or for this and once you've got that set up and all of them added go to assets and build asset bundles if you've done everything right up to this point you'll get that little popup and then it'll create a streaming folder and it should take a little longer than mine did but it'll create that and then once it's done you can show and explore on the streaming folder inside the streaming assets there should be a um file with with just what you called it I called mine scoop and that's all the files we don't need scoop. manifest we don't need streaming assets or streaming assets. manifest just the one that we created um now let's hold on to this for a second not do anything with it I'm going to go to my here I'm going to delete these so in your beex plugins folder or wherever this is going instead of just dro dropping your dll in there make a folder for your mod and this is probably how you're going to want to distribute it if you distribute a mod with the bundle in it you put the mod or the dll and the bundle file or bundle asset bundle whatever inside a folder and the folder is the name of your mod and you know your DL can also be the name of it but um so we're going to put in my case I'm going to put scoo inside of Scooby there we go I'm going to leave that there I'm going to leave this here just in case I need it I delete this you know store extra copies somewhere elsewhere just in case um for now since I know everything's good here I'm going to close out of streaming assets now we've got a bundle we can actually go ahead and close out of this I'm going to minimize for now and move back to our mod so I'm going to Mo this back over let's go ahead and load our asset bundle we going to create internal static list of audio clip it does use an array I prefer the list but if you want to use the array be my guest it's fairly similar doesn't really act too differently in this particular case and then I don't think we need it now but I'm going to add it anyway we're going to add an internal static asset bundle reference called bundle probably not needed but it is what it is and we'll come down here and to actually load it we're going to say um firstly let's go ahead and initialize sound effects equals new list and then bundle equals or not new excuse me asset bundle dot load from file because it's a file and this is where things get a little interesting um we have to give it a fully qualified path um what we can do is get the reference to the game uh five by saying directory. current directory or something like that or we can use the location of the dll so we're going to do that we'll say string uh ass or folder location equals instance. info. location and then we're going to say folder location equals folder location dot what is it uh trim end and we're going to give it the name of our dll so our dll name in my case it's LC tutorial mod. dll 2.2 Char array it needs to be a two Char array um so it's going to remove this if it's at the end of it um the safest way to do this would be to copy and paste it from the actual name um so what this is going to do is this gets a reference directly to this dll file then we get rid of the the name of the dll file from the path that we got and then we can say folder location Plus in my case uh folder location is going to have it on the end so we don't need that plus the name of our asset bundle which is in my case scoop so this should load that um if bundle is not equal to null then we want to say bundle well we're going to say if I'm not mistaken we say our list is equal to so sound effects is equal to bundle. load all assets of audio clip type and we see it's tossing that error because it is passing in an array or returning an array excuse me so like I said you can use it as an array I'm going to do that to list because I like working with lists a little more and that's good so we can also do an else here we can say else we can say MLS log error not log the MLS we say uh failed to load asset bundle and we're going to just log info here log info if it succeeds successfully loaded asset bundle there we go Okay so we've loaded the asset bundle um I've gone through this already aside from if we made any mistakes here with like finding the file we've done everything correctly um so if you want to test you can build this drop it in and see if it prints out that it was successful or not if it failed start over rebuild the asset bundle make sure you're getting the fully qualified path from the drive to the actual file name before you say hey it's not working uh because you probably did something wrong uh if you've got the correct path like printed out it's like hey is this you know the path that I'm getting the correct one um does the file exist you can do a file exist check um is all that good yes make sure your Unity version is correct if all of that's good and your Unity version is correct then look for help here you can ask in the comments or wherever else there may be help available um but check those things first anyway let's move on let's find the audio sources that we want to mess with so we got a few different places here I'm going to close out of these for now um I'll s have rounds open so let's start with because it's a little misleading let's start with player I want to see like I want to show you what I mean by it's a little misleading so if we look at audio audio is going to be the name of everything that we need because they're audio sources or audio clips and we see we got movement audio item audio status effect audio water bubbles now movement's not very clear what is movement you know we walk we jump we Crouch we do all these things um so let's go ahead and find where movement audio is called to see what it does so we see transmit one shot call it passes and movement audio and then it looks like a specific type of sound so let's skip past that look somewhere else okay movement audio that play one shot and it gives us a different sound so now if you don't know already um that should kind of point us in the right direction let's go back up to where it was originally defined here that's death where's the sound Jesus there you go audios it's an audio Source not an audio clip an audio source is essentially an object that says you can play audio from this I will impact that audio and I will tell it some certain things to do but you have to pass in an audio clip so we don't change an audio Source necessarily we can but uh not for the purpose of today's video uh we're going to change audio clips now we could change the movement audio. audio clip because they do store audio clips however they don't always play their own audio clip we don't always call movement audio. playay instead like what we saw here it is calling movement audio and then giving it another uh um audio you know an audio Source here and this this in this case movement audio to play one shot it's calling it from there so let's go look at start of round cuz there weren't there were not there was not a single like audio a clip there was only audio sources so let's type in audio again and we've got an audio listener audio listener oh here we go audio source audio source audio clip Source clip we got a lot of Clips here so any of these audio clips that we override will override that exact audio clip with another sound so the opening of the door sound we can override that with something stupid U the ship intro like that stupid uh intro thing that tells you about your new life during the contract throughout the duration of the contract we can do that so um we can replace all of these um so that just gives us an idea of what's going on there are a couple things that we could replace that um will work work sourcewise for example on the Bracken The Flower Man AI uh the break neck only it when it's called it plays its own clip which is kind of weird um because it also does have an S sfx thing so it's like what um but yeah so let's replace the ship intro speech that one's kind of fun so I know we've kind of taken a long time to get to this point but I think it's useful that we talk about those things so let's make a new patch we're going to call it start of round patch because that is where it's going this is the start of round object and we're going to copy some things over and change them slightly so Harmony patch type of start of round and then we're just going to copy this over because we're just going to get rid of it so we're just going to change update to start and change infinite Sprint to over ride audio and instead of ref float Sprint meter we're going to do start of round uncore uncore instance lowercase and we can saycore uncore instance Dot and we can just type in sfx here and we got all these different things we can change we can change the air pressure the alarm the blood gore the body collision the change suit the damage disable speaker um I want to do ship intro equals tutorial modbase do sound effects and since it's a list we can do zero this would also work if it were an array um since there's only one and it's a zero base we start with zero and theoretically if we patch this in we should get a in my case a Scooby laughing sound when the around or when a new game is started so let's patch it copy this baste it start of round okay build let's grab it over from here options refresh copy it into our mod folder here so I'm pasting in a copy of this um and let's go ahead and test it out okay so firstly let's see if we got any errors with our console um let's see successfully loaded asset bundle if you're seeing this that means you've got it set up properly um and theoretically we shouldn't have anything to worry about if you see that message if you're seeing the error um then it's not going to work because it couldn't load it in the first place oh oh I accidentally selected something if you hit select like this I think I did in last video just hit escape and it'll unfreeze your game okay let's go ahead and host on a new file so I can test out the audio and I expect to get laughed at by scooby nope okay it didn't work why is that see night visions first day on the job this is your can you freeze please where you will eat and sleep for the duration looks like it's okay oh I think okay know okay get out of here okay I think I know what the issue is I patch the start of round we need to patch start of round patch that is my bad I think I've done that like three times now like before it was just forget to patch that's like oh yeah I remember to patch then I patched the wrong thing anyway go ahead and try again start since that level that world didn't save we don't need to do anything with a save file speaking of which game uh uh the save file editor got an overhaul not a completely big fan of everything because you can't drag and drop the windows but otherwise it's really good um anyway let's go ahead and cop in here [Music] confirm okay let's see what happens there it goes okay that gets me every time so um that's how we replace audio files let's cop out of here for a second um couple of small things so just like we can replace these clips we can also replace the clip that is associated with a um a source so we do like instance dots what are we in start of round let's find a source here do a source like ship 3D audio ship 3D audio. clip you could say the clip equals this um it's probably not going to work you need to see like if ship 3D audio is you know if like it has a clip that's being used or if it's just it's not even used in here um but you can also say uh ship 3D audio. playay onot and give it the sound effects so you know we could say hey play this sound when this happens you know using that source so we also have that capability um to play sounds as well rather than just override existing ones we can also tell it to play more play different ones at other times you know stuff like that um and using the source to cool things with it rather than having to like start over from scratch um so that one's that uh I was going to do another one but I don't think it's necessary we've learned all we need to know from this that's like uh you know find an sfx that's used or if you're finding like some a sound that you can't figure out find where it's called lead it back to where the the sound is saved and find the sound there uh so for example start of round is a big one there's another one it looks like we have a sound manager does this have any audio files on it I was oh man See Sound Manager I never even knew this thing was in here to be honest here we go anything see audio Let's see we got audio source audio Source we've got audio clips for music um that's like background music I don't even you know uh let's do audio clip to make things a little easier so you got heartbeat Clips synced audio clips synced audio clips that could be interesting maybe that's used for something like you just what is it sync clip index okay so that's just uh playing audio position across the server it's not like syncing them or anything separately uh from existing ones but um you know uh round manager is probably going to have a big one as well because round manager is is a massive part of this game let's find that real quick um to be clear we're pretty much done here so if you're not feeling like you need to stick around you don't um but we're just kind of looking around here uh First Time Dungeon audios let's do audio clip let's see we've got start motor press button press button there's actually not that many First Time Dungeon yeah there's actually not that many let do audio Source elevator elevator play random clip that's interesting you could also give it that too just play random clip and give it an audio clip that's public static oh yeah that's nice we could just use the r manager to play random audio sources at uh where is it trying to even play him what Audio Oh we gave it an audio Source too so we could give it an audio source and everything um but yeah yeah anyway that's pretty much it nothing really interesting I'm surprised round manager doesn't have any you'd have to search around for him and see if there's anything interesting different items and enemies and different things have different stuff but uh yeah so that's how we replace audio thank you for watching and have a wonderful day
Info
Channel: MrMiinxx
Views: 10,788
Rating: undefined out of 5
Keywords:
Id: UDfC9uZnrFo
Channel Id: undefined
Length: 21min 44sec (1304 seconds)
Published: Sun Jan 07 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.