#Sniper's Mods
2084 messages · Page 3 of 3 (latest)
Since MARC does an Async bundle load, this probably is required.
@lucid horizon You should prob add some spawn blockers here hah

Assuming that that’s just a normal ass doorway I don’t see why

This is technically the start room from the look of things so you might could get a turret right there pointed at the door
(Entrance is just to the left off screen)
Which, is funny but also 
I could also take turrets out of the list of viable hazards there
…that is probably a good idea
But also 
i mean, manor has them
true! and this is more close to manor than facility so I feel justified in my 
hey i have waterassetrestorer but the water on wesley's moon Hyve looks like this inside:
with the mineshaft interior
019e39a7-5707-1c30-29d8-c7f2c353f497 modpack code
Gosh darn it. Ok, I’ll check in a bit
ok, all the other waters are fine. it's just the cave one. weird. also, it does work in smaller packs. so there is something specifically conflicting. the thing is the logs all look good. it says it's found and replaced fine so it's like something is altering the original source of the cave water
it doesn't seem to be ButteryFixes/Chameleon, nor does it seem to be LethalSponge. what else in this pack would possible touch this stuff?
ok, well, while I look into this it does seem you can downgrade W.A.R. to its pre 2.0.0 version and remove M.A.R.C.
For some reason this seems to fix it and I have no idea why. The logic really shouldn't have changed. It's just moved from W.A.R. to M.A.R.C. and W.A.R. just tells it what materials to do instead of doing everything directly itself
Found it!
@delicate cave, do you by any chance still have your cave water tile named CaveWaterTile? Because through UnityExplorer I see 2 of those with your interiors installed. Their pack works fine when I remove your interiors but when it's installed they get the pink texture for cave water but all the rest are fine and logs say it found the CaveWaterTile prefab and saved the material. I'm pretty sure M.A.R.C. is pulling the broken material out of your cave water and saving it to use as the replacement lol. Now, why it's doing this now and was fine before I do not know. Maybe it's just different mods causing things to run in different orders and/or the fact that the find now runs async.
Ultimately, this is something I should fix on my end, but tbh I'm not sure how exactly to go about that. Like, how to figure out which prefab is the "real" one if multiple exist. The quick fix I think would be on your end by just changing the name of that tile but I know you're probably busy working on other update stuff. Also, apologies that this is like the second time my changes have broke something of yours.
that's prolly going to take a while, if you can do it on your end it's going to be faster for sure
I'll rename it but uh
Like kenji said
It will be a good while
Alright. I’ll try to figure out something from my end
ok, well, I think I might've found why it's breaking now. So I used to have a loop through all prefabs. If it found what it was looking for, it still technically checked through all the rest. I changed it so that when it finds the desired prefab it stops continuing to check. I think it was just getting lucky with the order and finding Wesley's first then going on and eventually finding the real one. Now, since it stops, it finds Wesley's and stops. I could revert this change but that seems bad for performance and also doesn't feel like it really solves the core problem. It feels like it was just kind of luck that they were being searched in that order and I don't really like banking on that
This is fixed on my end in the next update @delicate cave (though it wouldn't hurt to rename it on your end as well. It should be fine though as long as you don't give its water some placeholder material that doesn't have the Hidden/InternalErrorShader shader (idk why you'd do this though) as I now don't cache mats with that broken shader) and @loud marten. Kind of working on some other kind of critical issues too though so I can't say for sure when I'll actually release it.
Okay
just in case you are looking into this
chameleon could definitely be responsible for issues
i know i was breaking WaterAssetRestorer for any of my mineshaft variants (some of which recolor the water material and change the name)
i had to add explicit compatibility (just moving my patch to run after yours) previously
but when you migrated all your code from WaterAssetRestorer to MaterialAssetRestorerCore, i'm now checking for the wrong harmony GUID and probably patching first again
i dont think im breaking vanilla caves, so there might still be other issues
but im pretty sure, at minimum, chameleon would make the problem occur in more contexts
so i'll have to put out another update myself
Yeah, if you want to. I didn’t know that was a thing (or I forgot). I can try to do some more testing of it tomorrow perhaps and see if it’s really needed but switching the GUID is probably a good idea just in case and shouldn’t be too difficult.
So many things I didn’t account for 😔
Went ahead and shipped this fix. The lever not being locked until everyone is done caching the materials was not implemented in this. I'm probably just missing something simple and stupid because I've not had to network sync anything for a mod before but it is not cooperating and the voices are starting to call for violence. However, I don't want the broken material thing to still be an issue for who knows how long since that's been fixed for a little while now. In the meantime, just... idk, don't pull the lever until like a few seconds after someone joins maybe?
Hey, so I tried loading in with some weather mods and tried out "The end of the world weather," but with this mod installed no matter where I went, the moon would not load at all and I would be stuck in orbit forever. I waited before pulling the lever for a good minute, and gave it another after I was loading in. But I never succeeded.
https://thunderstore.io/c/lethal-company/p/Sniper1_1/MaterialAssetRestorerCore/
MARC is a problem child. I’d recommend downgrading WAR to before it used MARC and just removing MARC entirely for now. I might even ship an update myself to force this because it’s just not there yet.
I didn’t intend to leave any lever-touching code in there but it looks like I must’ve because of the tooltip. Idk that that would be the cause of anything though. The last patch was meant to just fix issues with Wesley’s Interiors
I didn’t exactly see anything jump out to me in the logs but I’ll look again a bit later
actually, what is included in the "end of the world" weather? aren't some weathers still not working from V80?
Hey, I want to ask more about the scene loading event suppression. I threw together this and in my mind it would work. I'm not sure what all mods trigger off those for testing though. The way it works right now is that when the mat init stuff starts I call MuteSceneStateChangeEvents() and when done UnmuteSceneStateChangeEvents() is called.
//after StartOfRound, initialize the materials
[HarmonyPostfix]
[HarmonyPatch(typeof(StartOfRound), nameof(StartOfRound.Start))]
public static void InitializeMaterialsPatch()
{
CoroutineHelper.Instance.StartCoroutine(MaterialInit.InitializeMaterialsCoroutine());
}
public static IEnumerator InitializeMaterialsCoroutine()
{
MaterialsNetworkSync.materialsInitialized.Value = false;
SceneLoadPatches.MuteSceneStateChangeEvents(); //prevent other mods from running code on scene load/unload
MaterialAssetRestorerCore.Logger.LogInfo("Initializing materials...");
foreach (MaterialInformationContainer container in materialInformationContainers)
{
yield return MaterialGet.GET_material(container.BaseMaterial, container.PrefabName, container.SceneName, (foundMaterial) =>
{
if (foundMaterial != null)
{
container.replacementMaterial = foundMaterial;
}
});
}
yield return new WaitForSeconds(10); //debug testing. REMOVE THIS
SceneLoadPatches.UnmuteSceneStateChangeEvents(); //allow other mods to run code on scene load/unload again
MaterialAssetRestorerCore.Logger.LogInfo("Finished initializing materials.");
MaterialsNetworkSync.materialsInitialized.Value = true;
}
//patch scene load/unload to prevent other mods from running things if they are subscribed to these events
[HarmonyPatch(typeof(SceneManager))]
public class SceneLoadPatches
{
public static void MuteSceneStateChangeEvents()
{
MaterialAssetRestorerCore.Harmony?.PatchAll(typeof(SceneLoadPatches)); //patch scene load/unload to prevent other mods from running things if they are subscribed to these events
MaterialAssetRestorerCore.Logger.LogDebug("Suppressed scene load/unload events from triggering.");
}
public static void UnmuteSceneStateChangeEvents()
{
MaterialAssetRestorerCore.Harmony?.Unpatch(typeof(SceneLoadPatches).GetMethod(nameof(MuteSceneLoadedEventTrigger)), HarmonyPatchType.Prefix, MaterialAssetRestorerCore.Harmony.Id);
MaterialAssetRestorerCore.Harmony?.Unpatch(typeof(SceneLoadPatches).GetMethod(nameof(MuteSceneUnloadedEventTrigger)), HarmonyPatchType.Prefix, MaterialAssetRestorerCore.Harmony.Id);
MaterialAssetRestorerCore.Logger.LogDebug("Re-enabled scene load/unload events.");
}
[HarmonyPrefix]
[HarmonyPriority(800)] //make sure this runs before other potential patches
[HarmonyPatch(nameof(SceneManager.Internal_SceneLoaded))]
public static bool MuteSceneLoadedEventTrigger()
{
return false;
}
[HarmonyPrefix]
[HarmonyPriority(800)] //make sure this runs before other potential patches
[HarmonyPatch(nameof(SceneManager.Internal_SceneUnloaded))]
public static bool MuteSceneUnloadedEventTrigger()
{
return false;
}
}
the mute function basically applies some prefixes that just return false to stop the events from invoking. The unmute should in theory unpatch those prefixes so they run as normal when scenes get loaded as normal during gameplay. at least, that's how it works in my mind
Oh it do seem fine yeah
As for mods to actually test it with, you could test it yourself by subscribing a method to SceneManager.sceneLoaded that just shows like a fatal log or somethin
oh that's true. lol
On phone so I'll try to write them all down:
Stormy
Rainy
Blood moon
Majora moon
Forsaken
Hurricane
Tornado
Hallowed
And possibly more that I cant remember rn.
Ok. I know I’ve seen some reports of issues with the tornado recently but it might’ve been fixed. Also do Wesley’s work? I kind of thought they didn’t but it’s not exactly something I’ve followed super closely
I do believe the snow stuff from LethalElements is busted so I wanted to also make sure it wasn’t in there
I can try to test that a bit later though
'bout to pull a classic Xu in a bit
I've been in sessions where they're used and no issues arose from it so idk
probably?
good news, I think the patch is applying. bad news, I don't think it's stopping lol
mmm. It's supposed to be MaterialAssetRestorerCore.Harmony?.Unpatch(AccessTools.Method(typeof(SceneManager), "Internal_SceneLoaded"), HarmonyPatchType.All, MaterialAssetRestorerCore.Harmony.Id);
That works
Maybe I'd need a profile code as I couldn't recreate the issue
Here you go, do note I dont have marc installed right now and I have the water thing put to 1.0.2
||019e6153-0f84-6184-862f-df6286ea58a5||
Alrighty. I’ll investigate sometime
@gaunt harbor the FTL issue should be fixed on my end now. Whenever it comes to mod managers you should be able to either keep that broken flashlight in the blacklist or remove it and it shouldn't break everything. (if you remove it from the blacklist then whenever Boom fixes it on their end then its custom beam should be what's used when it's pocketed)
Oh btw I’m still looking into this stuff. From what I’ve observed it’s been fine unless you quit to the menu and go back in without closing and relaunching the game first. Idk why yet. Still need to test some more stuff though
oh, pretty sure it's not weather specific. seems to just be on leaving save and entering a save without quiting the game. Though it's not MARC on its own that does this. Some incompatability for some reason I guess but don't know what yet
@sinful whale I'm pretty sure it's not MARC because I can remove it and downgrade WAR and it still happens. I really think it's something else breaking when you join a save then leave and try to go back into a save without relaunching the game. There's quite a lot of errors from other things going on
happens even with MARC and WAR disabled. It's got to be something else but idk what
tjhis is so fucking good LOL
It's always the low quality ones
We need a gif that goes "Feiopar my beloved"
YEAAAAAA
