PDA

View Full Version : Idea for fixing magnetic detonator


Moldycheese
03-04-12, 12:44 PM
I'm new on subsim but i was wondering if anyone could help me. I was wondering how hard it would be to create a mod that fixes the issue with magnetic detonator's not working on GR2 ship files. TheBeast mentioned adding a Damage Zone for the Magnetic Influence Detonator that extended above the torpedo which is then linked to the detonator to detonate the torpedo(sort of a buffer zone). I was wondering if this would be possible and how hard it would be. I'm barely beginning to mod, otherwise I would do it myself.

I absolutely love SH5 but this thing with mag detonators is driving me crazy and robbing me of one of my most favorite features of Silent Hunter.:damn::damn:

Dignan
03-04-12, 06:13 PM
I absolutely love SH5 but this thing with mag detonators is driving me crazy and robbing me of one of my most favorite features of Silent Hunter.:damn::damn:


...You and most everyone on this forum.

I think its one of those things that isn't fixable by mods. I know some of the best modders on this forum have looked into it.

TheDarkWraith
03-04-12, 07:02 PM
Rongel made a great discovery that the magnetic detonator works on .dat rendered units. Now it's just figuring out why and what the major differences between .dat and .GR2 units is :yep:

Rongel
03-05-12, 07:28 AM
The problem with adding invisible zone to magnetic torpedoes is that both magnetic and impact torpedoes use the same actual torpedo. So we can't add new zone only in magnetic torpedo, it will affect the impact-detonator too.

I think the answer is in the DMG_col_-node and it's 3d model. SH 4 ships work just well, something is different in SH 5 damage 3d model. And I believe that dud- and magnetic torpedo issues are related, if we get one working, other will work too.

Moldycheese
03-06-12, 02:41 PM
I don't mind if it affects both torpedoes. I know it's kind of an ugly fix, but I would just like something that makes the torpedoes able to detonate under the ship 100% of the time. So if someone could create it would be greatly appreciated.

If someone does create it could you do two versions-one the standard height and another 20m high? I like to mod the blast range to 20-30m sometimes.

pedrobas
03-06-12, 02:46 PM
I don't mind if it affects both torpedoes. I know it's kind of an ugly fix, but I would just like something that makes the torpedoes able to detonate under the ship 100% of the time. So if someone could create it would be greatly appreciated.

If someone does create it could you do two versions-one the standard height and another 20m high? I like to mod the blast range to 20-30m sometimes.
Anything else? :har:

Moldycheese
03-06-12, 08:05 PM
Anything else? :har:

No, would you be able to make it? if so...:rock::rock::rock:

TheDarkWraith
04-26-12, 11:10 AM
Today I finally narrowed down the routine that checks for magnetic 'collision' of the torpedoes in shcollision.act. I was able to get the game to detonate the torpedo when using magnetic detonators on GR2 ships :D There are a few 'problems' I'm working out before I can release a patch for this. One of the problems is that the unit takes no damage from the torpedo (this is because of something that is missing in the GR2 type units) and I'm looking for a way to tell the game that it does exist :yep:

0rpheus
04-26-12, 11:14 AM
Today I finally narrowed down the routine that checks for magnetic 'collision' of the torpedoes in shcollision.act. I was able to get the game to detonate the torpedo when using magnetic detonators on GR2 ships :D There are a few 'problems' I'm working out before I can release a patch for this. One of the problems is that the unit takes no damage from the torpedo (this is because of something that is missing in the GR2 type units) and I'm looking for a way to tell the game that it does exist :yep:

I know the GR2 editor is the most important thing, but it's been so good to see you working on IRAI again - and then I see this! Fantastic news, we'd be lost without you TDW :rock:

TheDarkWraith
04-26-12, 11:39 AM
I also found the routine that is called when the unit hits the bottom of the ocean...I'll flag this for further looking into so that maybe units will stay sitting on the bottom when they are destroyed :DL

I've also found the routines that are called when debris should be shown, when the damage effects (the explosions, etc.) should be shown, when to add unit destroyed mark to the map, and many other things. Been a very productive day so far!

Trevally.
04-26-12, 11:42 AM
I know the GR2 editor is the most important thing, but it's been so good to see you working on IRAI again - and then I see this! Fantastic news, we'd be lost without you TDW :rock:

:agree:

Sartoris
04-26-12, 11:55 AM
I also found the routine that is called when the unit hits the bottom of the ocean...I'll flag this for further looking into so that maybe units will stay sitting on the bottom when they are destroyed :DL

I've also found the routines that are called when debris should be shown, when the damage effects (the explosions, etc.) should be shown, when to add unit destroyed mark to the map, and many other things. Been a very productive day so far!

Sounds exciting! It would be cool to know that the destroyed ships are still on the bottom. Maybe one day you could make the game export a chart of all the destroyed ships in your campaign, so that all the marks are shown on a map, would be a nice way to study one's progress...

TheDarkWraith
04-26-12, 12:12 PM
My fix works :rock: The GR2 unit takes damage from magnetic torpedoes! Of course this needs full testing but I'll put together a patch for it now :D

0rpheus
04-26-12, 12:13 PM
Sounds exciting! It would be cool to know that the destroyed ships are still on the bottom. Maybe one day you could make the game export a chart of all the destroyed ships in your campaign, so that all the marks are shown on a map, would be a nice way to study one's progress...

Would be cool but I suspect it'd end up being a resource hog pretty fast. If it were possible for them to only remain in shallow waters of say 50 metres or less (not much point in them sitting there thousands of feet down at the bottom of the Atlantic after all, you'll never see them), and only for the duration of that patrol, reset upon bunker load maybe, that could work - but would probably be quite difficult to implement!:hmmm:


Edit: woop!


My fix works :rock: The GR2 unit takes damage from magnetic torpedoes! Of course this needs full testing but I'll put together a patch for it now :D

TheDarkWraith
04-26-12, 12:26 PM
I see some problems with the GR2 units as far as collision spheres go and magnetic detonators. Since almost all the GR2 units have a sphere in the middle of the ship and nowhere else (on the root node) the magnetic detonator will only detonate near the middle of the ship. We'll have to add collision spheres to all the GR2 units (ships) so that the entire unit is covered :shifty:

TheDarkWraith
04-26-12, 12:28 PM
I have to update my patcher app so that it can patch .act files. Currently I have it hard-coded to sh5.exe. I'll make it so that it reads the file it's supposed to patch from the patch file :yep:

0rpheus
04-26-12, 12:57 PM
I see some problems with the GR2 units as far as collision spheres go and magnetic detonators. Since almost all the GR2 units have a sphere in the middle of the ship and nowhere else (on the root node) the magnetic detonator will only detonate near the middle of the ship. We'll have to add collision spheres to all the GR2 units (ships) so that the entire unit is covered :shifty:

Just out of interest, is that the same thing that caused the wonky sea floor collisions? Or is it something different? Just made me think of it is all. :O:

Captain Joe
04-26-12, 01:15 PM
Im no expert but just an idea, is that not maybe why the subs are not taking DC damage to the hull?

TheDarkWraith
04-26-12, 01:16 PM
Just out of interest, is that the same thing that caused the wonky sea floor collisions? Or is it something different? Just made me think of it is all. :O:

Possibly. I've been watching the 'collisions' in the debugger and I can see everytime an object collides with something. I've haven't really dove deep into the sea floor collision yet though (I know when it happens though because it triggers a breakpoint). Right now all I cared about was finding the routines for collisions and I found them.

Patcher app updated and I have patched my shcollisions.act file. Now testing in game

0rpheus
04-26-12, 01:20 PM
Possibly. I've been watching the 'collisions' in the debugger and I can see everytime an object collides with something. I've haven't really dove deep into the sea floor collision yet though (I know when it happens though because it triggers a breakpoint). Right now all I cared about was finding the routines for collisions and I found them.

Patcher app updated and I have patched my shcollisions.act file. Now testing in game

Quite right too, don't let me distract you :O: It just made me think of the testing I did back then and I've learned (as I'm sure you have too) to trust those little sparks of connection that sometimes fly :|\\

Looking forward to seeing this implemented :up:

TheDarkWraith
04-26-12, 01:23 PM
Alright, testing works! I fired torpedo at NLL ship (GR2) with magnetic detonator turned on. As soon as the torpedo was under the keel kaboom! Now I wanted to see if I switched off the magnetic detonator what would happen. So with magnetic detonator turned off I fired another torpedo at NLL. Torpedo passed under keel without exploding :rock: I fired another torpedo at NLL this time with depth set to 1m (surface). Torpedo exploded on impact with ship.

Did all the same tests with dat style units and they passed also. Look for release here very soon! :|\\

Hinrich Schwab
04-26-12, 01:27 PM
It's great to hear that the magnetic torpedo issue is almost fixed. :) Not trying to complicate things, but how has the realistic magnetic pistol dud rate been factored in or is that a challenge for later?

TheDarkWraith
04-26-12, 01:31 PM
It's great to hear that the magnetic torpedo issue is almost fixed. :) Not trying to complicate things, but how has the realistic magnetic pistol dud rate been factored in or is that a challenge for later?

I see where it checks for duds in the code but that'll be for later :yep:

Now there is one anomoly with GR2 units and magnetic detonators - when the torpedo explodes from magnetic detonation the unit will incur damage BUT there will be NO visible signs of damage to the hull WHEN viewed below water (camera is below water). When camera is above water you can see the damage to the hull. Minor annoyance :yep:

EDIT: just tried with impact detonation and same thing happens. Guess I never noticed this before.

Hinrich Schwab
04-26-12, 01:37 PM
I see where it checks for duds in the code but that'll be for later :yep:

Now there is one anomoly with GR2 units and magnetic detonators - when the torpedo explodes from magnetic detonation the unit will incur damage BUT there will be NO visible signs of damage to the hull WHEN viewed below water (camera is below water). When camera is above water you can see the damage to the hull. Minor annoyance :yep:

EDIT: just tried with impact detonation and same thing happens. Guess I never noticed this before.

That's actually pretty funny considering a clean under-keel detonation can potentially break a ship's back outright. :haha:

TheDarkWraith
04-26-12, 02:10 PM
You can find the new version of the patcher and the patch file for the broken magnetic detonator here: http://www.subsim.com/radioroom/showpost.php?p=1621039&postcount=1

TheDarkWraith
04-26-12, 02:33 PM
Im no expert but just an idea, is that not maybe why the subs are not taking DC damage to the hull?

Enable the patch and see if the sub takes damage now :yep:

I overrided the missing item in the GR2 files that the game was looking for. If this item doesn't exist the game doesn't check for collision - if no collision then no damage.

I have no idea what all is impacted by this change so we have to test it and see what is now working/not working/etc.

Rongel
04-26-12, 03:01 PM
That's really good news TDW!

Glad to see you working with this, as it's the the biggest bug in SH 5 currently. Maybe I have some free time to test this in the weekend. Sounds promising! :yeah:

0rpheus
04-26-12, 03:16 PM
Downloaded, will test alongside IRAI .36 shortly :up:

TheDarkWraith
04-26-12, 03:32 PM
Downloaded, will test alongside IRAI .36 shortly :up:

IRAI v37 is releasing here very soon. This will hopefully keep the capitol ships out of the way :yep:

0rpheus
04-26-12, 04:36 PM
IRAI v37 is releasing here very soon. This will hopefully keep the capitol ships out of the way :yep:

Blast, yes just seen it! Updating..:up:

ADMIRALTIA
04-27-12, 12:04 AM
Ok So I just Applied the magnetic detonator fix. And It works great finally.


I managed to split a ship right down the middle.
But for some reason I lost the XO portrait when I target a ship.

Ship: Large Liner
How: Four Torpedoes Detonated under the hull.
Mechanics of sinking: Split right down the middle





http://i1253.photobucket.com/albums/hh587/ADMIRALTIA/Rightdownthemiddle.jpg

Moldycheese
04-28-12, 04:49 PM
Holy crap!! I haven't' looked at this thread I started for awhile and when I come back I find this!:woot::rock: Thank the stars for you TDW! You rock out loud!:rock::rock::rock:

Moldycheese
04-29-12, 11:06 AM
O.k So I used the patcher but I must have done something wrong because the torpedoes will not detonate magnetically.:06: Can someone please explain exactly how to use the patcher and what to do?

Thanks

TheDarkWraith
04-29-12, 11:51 AM
O.k So I used the patcher but I must have done something wrong because the torpedoes will not detonate magnetically.:06: Can someone please explain exactly how to use the patcher and what to do?

Thanks

There are two 'problems' with SH5 regarding magnetic detonators still. The fix will make the magnetic detonators work but in order to detonate:
- torpedo must be in the middle of the ship (this is due to the SH5 ships missing collision spheres on everything but the middle of the ship)
- torpedo must be <= 2m from keel of ship (this is what the magetic detonator range is set for in the stock torpedoes .sim file)

The fix for the magnetic detonators will also allow your sub to incur hull damage from DCs (a nice side benefit!)

Moldycheese
04-29-12, 11:57 AM
@TDW How many meters wide is the zone that detonates the torpedoes?
Also, will you be adding spheres in a later fix?

Rongel
04-29-12, 12:01 PM
There are two 'problems' with SH5 regarding magnetic detonators still. The fix will make the magnetic detonators work but in order to detonate:
- torpedo must be in the middle of the ship (this is due to the SH5 ships missing collision spheres on everything but the middle of the ship)
- torpedo must be <= 2m from keel of ship (this is what the magetic detonator range is set for in the stock torpedoes .sim file)

The fix for the magnetic detonators will also allow your sub to incur hull damage from DCs (a nice side benefit!)

I tried this myself, but didn't get the expected results, it seemed that the torpedoes explode if they are basically touching the bottom of the ship, like 0.1 meters from the bottom. So still not sure if it's working for me. I aimed at the middle of the ship but no luck. :06:

Trevally.
04-29-12, 12:05 PM
Just a wee reminder for the tool that allows you to measure when testing:DL
http://www.subsim.com/radioroom/showthread.php?t=179718

Moldycheese
05-05-12, 02:30 PM
I recently had to uninstall and reinstall SH5 but after reinstalling the patch comes up with an error message saying "file version is different than expected version" Help!:dead:

TheDarkWraith
05-05-12, 02:59 PM
I recently had to uninstall and reinstall SH5 but after reinstalling the patch comes up with an error message saying "file version is different than expected version" Help!:dead:

That means what it was expecting to see in the memory address (actually file location) the patch file specifies does not equal either the 'as designed' values or the patch. Are you sure you are patched to v1.2? :06:

Moldycheese
05-07-12, 01:11 PM
That means what it was expecting to see in the memory address (actually file location) the patch file specifies does not equal either the 'as designed' values or the patch. Are you sure you are patched to v1.2? :06:I patched but it still says the same thing! Although I have a question. I did at one point set the default type of program to open act files to word-pad. Would that have any effect? If so how do I reset it to default?

TheDarkWraith
05-07-12, 03:06 PM
I patched but it still says the same thing! Although I have a question. I did at one point set the default type of program to open act files to word-pad. Would that have any effect? If so how do I reset it to default?

Sounds like your act file you are trying to patch is already patched or is corrupt. Load a backup copy of it into the \Silent Hunter 5 folder and try patching it again :yep:

col_Kurtz
05-07-12, 04:24 PM
Sounds like your act file you are trying to patch is already patched or is corrupt. Load a backup copy of it into the \Silent Hunter 5 folder and try patching it again :yep:

I have noticed something similar. It`s looks like the SH5.exe is already patched - without Hex Editor. Clear installation (the second one or next no matter). I can open the patcher and change the "Falses" to "True" values. But I can`t edit with Hex editor - problem above.
Is it possible that a previous installation and modification of Hex Editor had an influence?
Yes, I think - yes! I can`t describe this - sorry, my English. Maybe this screens.
1. Picture - Clear SH5.exe - patched to 1.2
http://www.subsim.com/radioroom/picture.php?albumid=632&pictureid=5637
2. Hex is showing value 75! I didn`t touch this.
http://www.subsim.com/radioroom/picture.php?albumid=632&pictureid=5638
3. Closed the Hex Editor. Open the Patcher. I changed these values False to True. And have a look on the Hex value! Changed to 74 now!
http://www.subsim.com/radioroom/picture.php?albumid=632&pictureid=5639

Also, if it was made to re-install the game do not need to re-use Hex Editor - if you've done this before. Just patch the SH5.exe via patcher :)
:salute: