Forgot to mention in the video, my apologies: if you get error with adding AudioClip and AssetBundle; add references to UnityEngine.AssetBundleModule.dll and UnityEngine.AudioModule.dll
I've tried using unity engine.audiomodule but it doesn't work. Unless I am putting in the wrong thing using UnityEngine.AudioModule; (Edit: nevermind, I got it)
You've no idea how perfect the timing of this video is, just yesterday I was starting to learn how to mod audio into the game. Even watched the original modding from scratch video, hoping I could piece together what I'd need to do to add audio instead of editing the player controller... needless to say I got lost in a rabbit-hole of trouble-shooting. Thanks for this tutorial man, couldn't have come at a better time. You deserve the new sub and a like.
Hey there, great vid first of all! I have a question, where do i find the textures for the models and how can i change them? I suppose its realted to how you mod the sound but i dont seem to find the textures and the right method.
do you know where the coil head footstep sounds are so i can overwrite them, oh and also whats the correct way of doing multiple sound fx into an array, ive just done a for loop with the length of our sfx list into the one im trying to edit which doesnt feel right. Edit: sorry for asking so much in 1 comment but how would u have multiple sets of sound effects that are easily distinguishable, for example the footstep sound effects and the spring sound effects, should i use multiple asset bundles or is there a better / easier way?
Been following this and trying to change the song the jester plays. Been trying for a few days. Not sure what i have to change but your guide is VERY easy to follow.
I did everything exactly the same, the only difference is that i used the turret in overrideAudio and then firing SFX But when i launch the game, the console says "ArgumentException: Undefined target method for patch method" Any help how to deal with the issue or what i possibly have done wrong?
what i dont get is how you suddenly switched to plugin.cs when you haven't even talked about plugin.cs in this tutorial. i don't wanna watch a whole other tutorial to do this, do i need to do it in plugin.cs? a little help?
@@iMinx And for this case you search for a video which says "Lethal Company - How to mod in your own sounds from scratch!" maybe I need to learn what scratch means
I'm having an issue that's making it so I completely cannot do anything, and that the script just entirely doesn't work. Whenever I use an array for SoundFX, I get this error: `` [Error : Unity Log] Couldn't extract exception string from exception of type TypeLoadException (another exception of class 'TypeLoadException' was thrown while processing the stack trace) [Error : Unity Log] Stack trace: `` Occasionally, the logs I put in place do actually print, but it's random, and either way, the game entirely crashes afterwards. Whenever I use a list for it, I get this error `` [Warning: Unity Log] The script 'WowBugs.WowBugsBase' could not be instantiated! `` On this error, it doesn't crash unlike the last one, but the script still doesn't load. I've been trying to figure out why this hasn't been working for like 3 hours now, and I really could use some help, lol.
Is it possible to replace textures as well? I'm trying to replace the white brick texture you see in hallways, but I can't find a reference to it in ILSpy.
I thought you were done with lethal company? Not that I'm complaining, but I am a little curious about what brought you back. thanks for the awesome video homie, well thought-out and articulated.
I was, but after a break I'm not feeling so burnt, I likely won't be making video after video like before, but I feel like I can make them every now and then.
quiiick question, how would I go about compiling multiple sounds for different enemies into the game? as in I want to be able to have a chester stone hoarding bug and british anthem nutcracker in one "mod"
is this theoretically the same technique we’d use for 3D models? just instead of dropping a soundfile into the unity project, itd be an fbx or something?
ive been trying to load it but i cannot find a reference. I made a prefab created an asset bundle and instantiated it after binding it to a function i even checked if that function runs. I am seing my object in Unity Explorer but if i use freecam to teleport to the object its not showing anything.@@iMinx
When running LC once I got through the entire video, I kept getting an error from my unity log that it could not open my asset bundle file. Upon reviewing the script I pasted into to file to build asset bundles, the "MenuItem" in "[MenuItem("Assets/Build AssetBundles")]" doesn't highlight green. Nor does anything else change colors after the ''if" in "if (!Directory.Exists(Application.streamingAssetsPath))", besides the "assetBundleDirectory" which highlights blue. Any advice?
Make sure you copy everything include the using statements. You can find a guide for simply building asset bundles that covers that part more specifically a bit more in depth than I did if you still have issues since generally speaking if you have the correct version of unity, this should "just work"
This is what my code is using HarmonyLib; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using UnityEngine; namespace WhiplashBugs.Patches { [HarmonyPatch(typeof(HoarderBugAI))] internal class HoarderBugAIPatch { [HarmonyPatch("Start")] [HarmonyPostfix] static void WhiplashBugPatch(HoarderBugAI __instance) { __instance.chitterSFX = WhiplashModBase.SoundFX[0]; } } }
Hey i need some help with your mod i downloaded it the right way but everytime i type in /spawn or just spawn spider 1 it just says it in chat and doesnt work and ideas?
It only shows commands in chat if either they aren't recognized as a command due to missing the prefix or because you have it set to show everyone your commands. Double check your prefix in the config.
The example that you give probably does not play the audio (scooby sound, in this case) server wide, only local. I am figuring this out with my own mod currently, where i trigger a custom sound when the player crouches, but perhaps I am making a mistake by using the PlayerControllerB as the instance.. Have you tested if the sound goes server wide?
No, but I know it doesn't. To do something like that, everyone would need the mod. Even if we tried syncing with non modded players, the non modded clients wouldn't be able to play the sounds since their game wouldn't know to download them or to reassign the variables.
@@iMinx That is true. Actually, i think i asked the wrong question here and that I am dealing with a different issue.. I am actually trying to play a sound in the gameworld that other clients should be able to hear given that they have the same mod/plugin installed. In this case its a sound emit from the player's position. I am testing this with another player, as well as over LAN by launching the game twice. The sound i emit is only heard local, even if im emitting it from the movement audiosource (that also emits the footstep sounds). Maybe you have any ideas to how this works? (Sorry if im bothering you with this question)
The code that triggers the audio to play must be ran by all players, which means that it must be a method that all players locally run. What is the thing that you want to trigger the sound? @@tapecadets
@@tapecadets He hasnt done any net code yet, the only channel ive seen with net code/ replication is @malcolm-yt he also uses unity as well to make mods
@@tapecadets I believe I understand. You are manually playing a sound and it's only occurring locally. What you need to do is send an RPC to play the sound on different clients. That would fall under networking and would be a bit out of the scope of this video.
@@JosephBennett98 while I do not know how to do it from scratch, the "CustomSounds" mod has support for this so if you dont mind the dependancy you can try to look into that
In my script, i get some errors when i type internal static List SoundFX; internal static AssetBundle Bundle; It says i am missing an assembly reference, is there anything i missed or did i not do something right?
I get some errors when adding these references@@iMinx The type or namespace name 'AssetBundleModule' does not exist in the namespace 'UnityEngine' (are you missing an assembly reference?) The type or namespace name 'AudioModule' does not exist in the namespace 'UnityEngine' (are you missing an assembly reference?) Do you need a dll for these references?
@@maxxstuffs yes, when I say add the reference, right click on the project, click add >(as if you were gonna add a new item/file for example) then find reference. Browse to your lethal company game directory and the DLLs are in the same place as the Assembly C-Sharp.
Anybody know how to override the phone scream sound? I know the audio file can be replaced with a few other mods but I wanted to do something like on the video for practice. I searched for the Item class but I see most other items except for the phone ☹
I'm trying to create a custom boombox sound but nothing works this is what i've tried (doing oneshot works but I want the sound to play every time the item is activated): __instance.boomboxAudio.clip = audiomod.SoundFx[0]; __instance.musicAudios.AddItem(audiomod.SoundFx[0]); __instance.musicRandomizer.Equals(audiomod.SoundFx[0]); __instance.musicAudios.AddItem(audiomod.SoundFx[0]); I was also wondering where i'd find stuff like the loud horn or the record player
using HarmonyLib; using System; using System.CodeDom; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace worm.patches { [HarmonyPatch(typeof(SandWormAI))] internal class SandWormAI { [HarmonyPatch("worm")] [HarmonyPostfix] static void overrideaudio(SandWormAI __instance) { __instance.sfd
ArgumentException: Undefined target method for patch method static void LCTutorialMod.Patches.StartOfRoundPatch::OverrideAudio(StartOfRound __instance) I don't know how to fix but most likely easy to fix so pls help
Hello, console says asset bundle loaded but the sound effect is not being played? I am getting the error: [Error : Unity Log] ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index Stack trace: System.Collections.Generic.List`1[T].get_Item (System.Int32 index) (at :0) ThousandQuotaStare.Patches.SoundManagerPatch.OverrideAudio (SoundManager __instance) (at :0) (wrapper dynamic-method) SoundManager.DMD(SoundManager)
Fixed it! I was trying to be smart and instead of using the .clip method to change audiosources, I swapped all the values in plugin.cs to , which was giving me the error. Oops
I get this error when im loading up the game with the startofroundpatch script [Error : Unity Log] ArgumentException: Undefined target method for patch method static void LCModTest.Patches.StartOfRoundPatch::OverrideAudio(StartOfRound __instance) Stack trace: HarmonyLib.PatchClassProcessor.PatchWithAttributes (System.Reflection.MethodBase& lastOriginal) (at :0) HarmonyLib.PatchClassProcessor.Patch () (at :0) Rethrow as HarmonyException: Patching exception in method null HarmonyLib.PatchClassProcessor.ReportException (System.Exception exception, System.Reflection.MethodBase original) (at :0) HarmonyLib.PatchClassProcessor.Patch () (at :0) HarmonyLib.Harmony.PatchAll (System.Type type) (at :0) LCModTest.ModBase.Awake () (at :0) UnityEngine.GameObject:AddComponent(Type) BepInEx.Bootstrap.Chainloader:Start() UnityEngine.Rendering.HighDefinition.HDRenderPipelineAsset:OnEnable() this was the startofroundpatch script, and i dont know how to fix this.
I'm getting Severity Code Description Project File Line Suppression State Error CS0234 The type or namespace name 'Object' does not exist in the namespace 'RealisticBrackenMod' (are you missing an assembly reference?) RealisticBracken V:\RealisticBracken\RealisticBracken\Patches\FlowermanAIPatch.cs 15 Active In ``` { Object.Destroy(__instance.gameObject.transform.Find("FlowermanModel").Find("LOD1").gameObject.GetComponent()); GameObject val = Object.Instantiate(RealisticBrackenMod.Object[0], __instance.gameObject.transform); val.transform.localPosition = new Vector3(48.861510f, 0f, 37.375320f); } ``` What do I do?
Forgot to mention in the video, my apologies:
if you get error with adding AudioClip and AssetBundle;
add references to UnityEngine.AssetBundleModule.dll and UnityEngine.AudioModule.dll
I've tried using unity engine.audiomodule but it doesn't work. Unless I am putting in the wrong thing
using UnityEngine.AudioModule;
(Edit: nevermind, I got it)
@@shredderzing8829 if you dont mind me asking, what was the problem with that?
im having problems as well :/
You've no idea how perfect the timing of this video is, just yesterday I was starting to learn how to mod audio into the game. Even watched the original modding from scratch video, hoping I could piece together what I'd need to do to add audio instead of editing the player controller... needless to say I got lost in a rabbit-hole of trouble-shooting.
Thanks for this tutorial man, couldn't have come at a better time. You deserve the new sub and a like.
Glad it worked out, thank you so much!
Please continue making these, you have a really good way of explaining things and are just generally a good teacher of C# in general.
How can you make a custom creature with a custom model/sound etc. Been loving your tutorials btw keep it up! 🔥
I was able to replace the flashlight sounds with Cardi B sound effects. I'm the happiest person alive.
Thank you.
That sounds hilarious
Bell activated, can't wait for the next tutorial, you're the only channel that does this, don't stop :)
The sound file does not play in game. I know it is loading because it does not play the original sound, it just will not play my sound either.
I was just today looking for a tutorial on TH-cam on that like 4 hours ago and could not find any. Thanks bro
Hey there, great vid first of all! I have a question, where do i find the textures for the models and how can i change them? I suppose its realted to how you mod the sound but i dont seem to find the textures and the right method.
do you know where the coil head footstep sounds are so i can overwrite them, oh and also whats the correct way of doing multiple sound fx into an array, ive just done a for loop with the length of our sfx list into the one im trying to edit which doesnt feel right.
Edit: sorry for asking so much in 1 comment but how would u have multiple sets of sound effects that are easily distinguishable, for example the footstep sound effects and the spring sound effects, should i use multiple asset bundles or is there a better / easier way?
Where is the dropship song located in IL Spy? I want to replace it but I can't find it.
Is there a way to create asset bundles without Unity?
I looked into that - nope.
Been following this and trying to change the song the jester plays. Been trying for a few days. Not sure what i have to change but your guide is VERY easy to follow.
One question: if I was to replace multiple SFXs what would I add to make it?
how to Override AudioSource using OverrideAudio? Since this is not an AudioClip (trying to replace brainwash audio from old bird)
I did everything exactly the same, the only difference is that i used the turret in overrideAudio and then firing SFX
But when i launch the game, the console says "ArgumentException: Undefined target method for patch method"
Any help how to deal with the issue or what i possibly have done wrong?
i get this error "[Error : Unity Log] Error: Cannot create FMOD::Sound instance for clip "scoob " (FMOD error: File not found. )"
what i dont get is how you suddenly switched to plugin.cs when you haven't even talked about plugin.cs in this tutorial. i don't wanna watch a whole other tutorial to do this, do i need to do it in plugin.cs? a little help?
You need to be able to write a mod at all to get here. If you can’t do that then you shouldn’t be here.
ok ill just use the first tut then! thx!@@iMinx
@@iMinx And for this case you search for a video which says "Lethal Company - How to mod in your own sounds from scratch!"
maybe I need to learn what scratch means
I'm having an issue that's making it so I completely cannot do anything, and that the script just entirely doesn't work. Whenever I use an array for SoundFX, I get this error:
``
[Error : Unity Log] Couldn't extract exception string from exception of type TypeLoadException (another exception of class 'TypeLoadException' was thrown while processing the stack trace)
[Error : Unity Log]
Stack trace:
``
Occasionally, the logs I put in place do actually print, but it's random, and either way, the game entirely crashes afterwards.
Whenever I use a list for it, I get this error
``
[Warning: Unity Log] The script 'WowBugs.WowBugsBase' could not be instantiated!
``
On this error, it doesn't crash unlike the last one, but the script still doesn't load. I've been trying to figure out why this hasn't been working for like 3 hours now, and I really could use some help, lol.
Is it possible to replace textures as well? I'm trying to replace the white brick texture you see in hallways, but I can't find a reference to it in ILSpy.
I thought you were done with lethal company? Not that I'm complaining, but I am a little curious about what brought you back. thanks for the awesome video homie, well thought-out and articulated.
I was, but after a break I'm not feeling so burnt, I likely won't be making video after video like before, but I feel like I can make them every now and then.
For me it says in the console Class1 Cant be initiliazed.Can someone help me?Or what the problem is and what causes it?
it may be worth starting with the earlier video: th-cam.com/video/4Q7Zp5K2ywI/w-d-xo.html
Can you do a video for adding custom emotes?
My issue is that Lethal doesn’t seem to use humanoid rigging.
im pretty sure TooManyEmotes used VRChat (another unity game) and ripped all the fortnite (in vr chat) emotes for his mods
Please keep making these!
quiiick question, how would I go about compiling multiple sounds for different enemies into the game? as in I want to be able to have a chester stone hoarding bug and british anthem nutcracker in one "mod"
You would include all the sounds in the asset bundle. Then when loading it into the game, you could discern them by name
is this theoretically the same technique we’d use for 3D models? just instead of dropping a soundfile into the unity project, itd be an fbx or something?
Yeah for the most part. Of course when loading it into your actual mod, the code is gonna be a little different
ive been trying to load it but i cannot find a reference. I made a prefab created an asset bundle and instantiated it after binding it to a function i even checked if that function runs. I am seing my object in Unity Explorer but if i use freecam to teleport to the object its not showing anything.@@iMinx
it so cool, keep it up! Thank you!
Hello from Russia, Udmurtia!
Is it possible for asset bundles to contain more than one file?
Hey i dont know if somebody can help me here but i keep getting an error with SoundFX at the last line i rlly dont know what is causing it
How would you add custom sounds to emote1 or anything
When running LC once I got through the entire video, I kept getting an error from my unity log that it could not open my asset bundle file.
Upon reviewing the script I pasted into to file to build asset bundles, the "MenuItem" in "[MenuItem("Assets/Build AssetBundles")]" doesn't highlight green. Nor does anything else change colors after the ''if" in "if (!Directory.Exists(Application.streamingAssetsPath))", besides the "assetBundleDirectory" which highlights blue.
Any advice?
Make sure you copy everything include the using statements. You can find a guide for simply building asset bundles that covers that part more specifically a bit more in depth than I did if you still have issues since generally speaking if you have the correct version of unity, this should "just work"
Thank you for this! I need to figure out how to do this to make the Plok! boss theme the jester's song
will gamemaster ever be updated to v50?
No I’m pretty much done with modding this game
Are there any benefits to this than embedding the file directly? Besides you not having to re-build the file every time?
Not really, other than the ability to have a single file mod.
Does anyone know where he got the LCtutorial mod? I'm trying to learn how to mod this game, and I can't find it anywhere
its the mod he creates in his previous lethal company modding video, “How to write your own Lethal Company Mod from scratch”
So im getting an the error cannot implicity convert type UnityEngineAudioClip to UnityEngineAudioClip[]
This is what my code is
using HarmonyLib;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;
namespace WhiplashBugs.Patches
{
[HarmonyPatch(typeof(HoarderBugAI))]
internal class HoarderBugAIPatch
{
[HarmonyPatch("Start")]
[HarmonyPostfix]
static void WhiplashBugPatch(HoarderBugAI __instance)
{
__instance.chitterSFX = WhiplashModBase.SoundFX[0];
}
}
}
Audio clip is a singular audio clip and AudioClip[] is an array of audio clips. You need to ensure your original definition of the var is an array.
Hey i need some help with your mod i downloaded it the right way but everytime i type in /spawn or just spawn spider 1 it just says it in chat and doesnt work and ideas?
It only shows commands in chat if either they aren't recognized as a command due to missing the prefix or because you have it set to show everyone your commands. Double check your prefix in the config.
support for ogg?
Unity does support ogg iirc.(it’s based off of what unity supports so could search that up to be sure)
thank u ♥@@iMinx
Next, what about adding maps? (custom maps)
The example that you give probably does not play the audio (scooby sound, in this case) server wide, only local. I am figuring this out with my own mod currently, where i trigger a custom sound when the player crouches, but perhaps I am making a mistake by using the PlayerControllerB as the instance..
Have you tested if the sound goes server wide?
No, but I know it doesn't. To do something like that, everyone would need the mod. Even if we tried syncing with non modded players, the non modded clients wouldn't be able to play the sounds since their game wouldn't know to download them or to reassign the variables.
@@iMinx That is true. Actually, i think i asked the wrong question here and that I am dealing with a different issue.. I am actually trying to play a sound in the gameworld that other clients should be able to hear given that they have the same mod/plugin installed. In this case its a sound emit from the player's position. I am testing this with another player, as well as over LAN by launching the game twice. The sound i emit is only heard local, even if im emitting it from the movement audiosource (that also emits the footstep sounds). Maybe you have any ideas to how this works? (Sorry if im bothering you with this question)
The code that triggers the audio to play must be ran by all players, which means that it must be a method that all players locally run.
What is the thing that you want to trigger the sound?
@@tapecadets
@@tapecadets He hasnt done any net code yet, the only channel ive seen with net code/ replication is @malcolm-yt he also uses unity as well to make mods
@@tapecadets I believe I understand. You are manually playing a sound and it's only occurring locally. What you need to do is send an RPC to play the sound on different clients. That would fall under networking and would be a bit out of the scope of this video.
My asset bundle has 8 different sounds. Wanting to replace Thumper(Crawler) audio with a random one from the bundle. How would I achieve this.
At the moment It just plays the first audio clip in the asset bundle.
@@JosephBennett98 while I do not know how to do it from scratch, the "CustomSounds" mod has support for this so if you dont mind the dependancy you can try to look into that
You would access a random element from the list, you could use the unity random to get a random element from 0 to the length of the list.
In my script, i get some errors when i type
internal static List SoundFX;
internal static AssetBundle Bundle;
It says i am missing an assembly reference, is there anything i missed or did i not do something right?
I just pinned a comment that will resolve this issue, I forgot to include that in the video.
I get some errors when adding these references@@iMinx
The type or namespace name 'AssetBundleModule' does not exist in the namespace 'UnityEngine' (are you missing an assembly reference?)
The type or namespace name 'AudioModule' does not exist in the namespace 'UnityEngine' (are you missing an assembly reference?)
Do you need a dll for these references?
@@maxxstuffs yes, when I say add the reference, right click on the project, click add >(as if you were gonna add a new item/file for example) then find reference. Browse to your lethal company game directory and the DLLs are in the same place as the Assembly C-Sharp.
Anybody know how to override the phone scream sound? I know the audio file can be replaced with a few other mods but I wanted to do something like on the video for practice. I searched for the Item class but I see most other items except for the phone ☹
Found it! The old phone (and a few more items) work under the AnimatedItem class. You just have to tell them apart from within your patches.
you can edit the shotgun sound to put the spas 12 from fortnite?
I don’t see why not
I’m gonna replace the music that plays when you get chased with the SpongeBob chase music
I'm trying to create a custom boombox sound but nothing works this is what i've tried (doing oneshot works but I want the sound to play every time the item is activated):
__instance.boomboxAudio.clip = audiomod.SoundFx[0];
__instance.musicAudios.AddItem(audiomod.SoundFx[0]);
__instance.musicRandomizer.Equals(audiomod.SoundFx[0]);
__instance.musicAudios.AddItem(audiomod.SoundFx[0]);
I was also wondering where i'd find stuff like the loud horn or the record player
when I try to use the sfd it doesnt pop up all the extra options what can i do
using HarmonyLib;
using System;
using System.CodeDom;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace worm.patches
{
[HarmonyPatch(typeof(SandWormAI))]
internal class SandWormAI
{
[HarmonyPatch("worm")]
[HarmonyPostfix]
static void overrideaudio(SandWormAI __instance)
{
__instance.sfd
If afd is private or otherwise protected, you may not be able to access it
ArgumentException: Undefined target method for patch method static void LCTutorialMod.Patches.StartOfRoundPatch::OverrideAudio(StartOfRound __instance) I don't know how to fix but most likely easy to fix so pls help
we need a tutorial on custom monster models
I second this!
im not sure what my problem is, but no audio even plays,
```
using HarmonyLib;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace TestMod.Patches
{
[HarmonyPatch(typeof(StartOfRound))]
internal class StartOfRoundPatch
{
[HarmonyPatch("Start")]
[HarmonyPrefix]
static void OverrideAudio(StartOfRound __instance)
{
__instance.shipIntroSpeechSFX = TestModBase.SoundFX[0];
}
}
}
```
```
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TestMod.Patches;
using UnityEngine;
namespace TestMod
{
[BepInPlugin(modGUID, modName, modVersion)]
public class TestModBase : BaseUnityPlugin
{
private const string modGUID = "Endom.TestMod";
private const string modName = "Test Mod";
private const string modVersion = "1.0.0";
private readonly Harmony harmony = new Harmony(modGUID);
private static TestModBase Instance;
internal ManualLogSource mls;
internal static List SoundFX;
internal static AssetBundle Bundle;
void Awake()
{
if (Instance != null)
{
Instance = this;
}
mls = BepInEx.Logging.Logger.CreateLogSource(modGUID);
mls.LogInfo("Test Mod Loaded");
harmony.PatchAll(typeof(TestModBase));
harmony.PatchAll(typeof(MovementPatch));
harmony.PatchAll(typeof(StartOfRoundPatch));
mls = Logger;
// Load the AssetBundle
SoundFX = new List();
string FolderLocation = Instance.Info.Location;
FolderLocation = FolderLocation.TrimEnd("TestMod.dll".ToCharArray());
Bundle = AssetBundle.LoadFromFile(FolderLocation + "markiplier");
if (Bundle == null)
{
mls.LogError("Failed to load AssetBundle!");
}
else
{
mls.LogInfo("AssetBundle loaded!");
SoundFX = Bundle.LoadAllAssets().ToList();
}
}
}
}
```
That's the first file; that loads the bundle. If it's loading the bundle you need to patch it in somewhere
@@iMinx I got it working, I had an error in my Plugin.cs file that wasn’t loading the stuff correctly. Thanks
Thanks
Can you update Gamemaster plz
It looks like I'm going to be doing a rewrite and a tutorial series on it so stay tuned.
Hello, console says asset bundle loaded but the sound effect is not being played? I am getting the error:
[Error : Unity Log] ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
Stack trace:
System.Collections.Generic.List`1[T].get_Item (System.Int32 index) (at :0)
ThousandQuotaStare.Patches.SoundManagerPatch.OverrideAudio (SoundManager __instance) (at :0)
(wrapper dynamic-method) SoundManager.DMD(SoundManager)
Fixed it! I was trying to be smart and instead of using the .clip method to change audiosources, I swapped all the values in plugin.cs to , which was giving me the error. Oops
I get this error when im loading up the game with the startofroundpatch script
[Error : Unity Log] ArgumentException: Undefined target method for patch method static void LCModTest.Patches.StartOfRoundPatch::OverrideAudio(StartOfRound __instance)
Stack trace:
HarmonyLib.PatchClassProcessor.PatchWithAttributes (System.Reflection.MethodBase& lastOriginal) (at :0)
HarmonyLib.PatchClassProcessor.Patch () (at :0)
Rethrow as HarmonyException: Patching exception in method null
HarmonyLib.PatchClassProcessor.ReportException (System.Exception exception, System.Reflection.MethodBase original) (at :0)
HarmonyLib.PatchClassProcessor.Patch () (at :0)
HarmonyLib.Harmony.PatchAll (System.Type type) (at :0)
LCModTest.ModBase.Awake () (at :0)
UnityEngine.GameObject:AddComponent(Type)
BepInEx.Bootstrap.Chainloader:Start()
UnityEngine.Rendering.HighDefinition.HDRenderPipelineAsset:OnEnable()
this was the startofroundpatch script, and i dont know how to fix this.
That means you targeted a method that Harmony couldn't find. Possibly because it was private or spelled wrong.
I'm getting
Severity Code Description Project File Line Suppression State
Error CS0234 The type or namespace name 'Object' does not exist in the namespace 'RealisticBrackenMod' (are you missing an assembly reference?) RealisticBracken V:\RealisticBracken\RealisticBracken\Patches\FlowermanAIPatch.cs 15 Active
In
```
{
Object.Destroy(__instance.gameObject.transform.Find("FlowermanModel").Find("LOD1").gameObject.GetComponent());
GameObject val = Object.Instantiate(RealisticBrackenMod.Object[0], __instance.gameObject.transform);
val.transform.localPosition = new Vector3(48.861510f, 0f, 37.375320f);
}
```
What do I do?