UBOAT
(2022.1) TDC MOD (TVh-Re/S3)
Snork 1 Apr, 2024 @ 9:22am
A kind person gave me the code necessary to patch in FAT/LUT functionality, am I doing it right?
Saving the code as a .cs file, including it in the TDC's workshop folder, in the source directory with all the rest of the .cs files.

That's generally how it's done, yes?
< >
Showing 1-8 of 8 comments
Urfisch  [developer] 9 Apr, 2024 @ 7:18am 
Yes, i think so ;)
Snork 14 Apr, 2024 @ 7:05am 
I appreciate your response and I appreciate your dev work
Urfisch  [developer] 16 Apr, 2024 @ 4:38am 
Thx ;)
Frosty Steve 16 Apr, 2024 @ 5:13pm 
@Snork, did that ending up working as you expected?

If so, any chance you might be able to share that .cs file or link to it? If that fix works, I'm sure a lot of folks (myself included) would love to use it as a stop-gap until we have a full TDC modeled in the base game.

I say this recognizing fully well that it may not be perfect or break on the next patch, but I figure it's worth a shot!

@FreeOly, echoing Snork's comments, appreciate all the work that's gone into bringing a well modeled TDC into UBoat, and excited for its future!
Snork 18 Apr, 2024 @ 6:34pm 
I don't mind sharing it with anyone at all, I'd actually like to share so as to share results.

From what I can tell, though, with the code as entered, what it does is let you fire FAT/LUT with the TDC switch turned off - and in that state, they work as you'd hope and expect.

What it doesn't do, is make the two play totally nice .

But I mean, it's a lot better than FAT/LUT simply being unusable as long as TDC was installed.

Are you any good with c# code? I'd be curious to know if what it's doing matches the intent of what was written.

I can paste it right to the window if you're still interested, it's not more than a quarter page

but though someone gave me pretty much perfect code, there were a few errors amounting to little more than typographical that i had to figure out and fix. so for all i know i don't have it working exactly right even though it is working
Last edited by Snork; 18 Apr, 2024 @ 11:15pm
Snork 19 Apr, 2024 @ 1:38am 
diff --git a/Source/INJECTOR.cs b/Source/INJECTOR.cs
index 40f2728..78f7625 100755
--- a/Source/INJECTOR.cs
+++ b/Source/INJECTOR.cs
@@ -431,7 +431,7 @@ public class INJECTOR
{
[Inject] private static PlayerShip playerShip;

- static bool Prefix(ref bool ___isLaunchingTorpedoes, ref ISpeakController ___speakController, float depth, float velocity)
+ static bool Prefix(ref bool ___isLaunchingTorpedoes, ref ISpeakController ___speakController, float ___torpedoProgramAngleAdjust, float depth, float velocity)
{
if (TDC_MANAGER.IsActive)
{
@@ -451,7 +451,7 @@ public class INJECTOR
dynMethod.Invoke(Skipper.Instance.Character, new object[] {"LOS"});
}

- Globals.Instance.StartCoroutine(LaunchAllTorpedoesInternalPatch(depth, velocity));
+ Globals.Instance.StartCoroutine(LaunchAllTorpedoesInternalPatch(depth, velocity, ___torpedoProgramAngleAdjust));

return false; // Скипаем оригинальный метод
}
@@ -459,7 +459,7 @@ public class INJECTOR
return true;
}

- static IEnumerator LaunchAllTorpedoesInternalPatch(float depth, float velocity)
+ static IEnumerator LaunchAllTorpedoesInternalPatch(float depth, float velocity, float torpedoProgramAngleAdjust)
{
yield return new WaitForSeconds(1.5f);

@@ -482,7 +482,7 @@ public class INJECTOR
{
if (launchers.IsFlooded)
{
- launchers.Launch(null, Vector2.one, Vector2.one, depth, velocity, index, false);
+ launchers.Launch(null, Vector2.one, Vector2.one, depth, velocity, i, false, playerShip.TorpedoProgramDirection, playerShip.TorpedoProgramDistance, torpedoProgramAngleAdjust);

index++;
yield return new WaitForSeconds(4f);

just use something like notepad++ to save it as a .cs file, then it goes in the mod's folder. steammod376738638/source

And please let me know what result you experience with it. Uboat has been messing with my head bigtime lately so some outside verification/collaboration would be fantastic.

As I said at the very least it should make FAT usable with tdc's switch set to off. However, i have a suspicion that applied correctly it sould actually make it work fine regardless of switch.

If anyone can parse cs code (i'm illiterate at programming beyond lua, or just can test it themselves, it'd do my sanity a big favor.
Snork 22 Apr, 2024 @ 6:58pm 
Jusst fyi, I've managed to figure it all out. The code as I originally received it turned out to be flawed in several ways and my total laymen status meant the research took a while, but now I can share with anyone else who wants it and the final result is FAT/LUT works with the TDC on and active as you'd expect.
Urfisch  [developer] 23 Apr, 2024 @ 4:59am 
Originally posted by Snork:
Jusst fyi, I've managed to figure it all out. The code as I originally received it turned out to be flawed in several ways and my total laymen status meant the research took a while, but now I can share with anyone else who wants it and the final result is FAT/LUT works with the TDC on and active as you'd expect.

Sent you a friend request
< >
Showing 1-8 of 8 comments
Per page: 1530 50