SUBSIM Radio Room Forums

SUBSIM Radio Room Forums (https://www.subsim.com/radioroom/index.php)
-   SH5 Mods Workshop (https://www.subsim.com/radioroom/forumdisplay.php?f=249)
-   -   Stadimeter Solution by Reaper7 (https://www.subsim.com/radioroom/showthread.php?t=171085)

reaper7 06-15-10 03:20 PM

Stadimeter Solution by Reaper7
 
I have found the Solution to the Stadimeter.
You say "But TDW has done it already".

Yes but I fixed it with no complex scripting or no external progamming at all. All done with just the Stock UI.

Can be added to any SH5 easily.

The solution struck me at work Today, and I thought no that can't work its to simple and to obvious.
But guess what it works and perfectly.

The Solution is hidden away in SH5 like most things, they never got rid of most of the SH3/4 UI.
And that includes the SH4 Targetting TDC Interface. With Range, Speed etc.
Including its stadimeter - thats the one thats being referenced in the Dials.cfg from SH4 and still in SH5.

Code:

[Dial58]
; will be changed by code
Name=TorpedoSolution_Mast_Height
Type=70; DIAL_TGT_MAST_HEIGHT_INTERNATIONAL
Cmd=Set_tgt_mast_height_international;
Dial=0x431A0002
CrtVal=0x431A0001
NewVal=0x0
DialVal=-90,98
RealVal=15,130; height
Circular=Yes
CmdOnDrag=Yes
Logarithmic=7.189;4.656
RelativeDrag=Yes
SndStep=5
SndList=1,Menu.TDC.AngleOnBow,360
 
[Dial59]
; will be changed by code
Name=TorpedoSolution_Temporary_Range
Type=68; DIAL_TGT_RANGE
;Cmd=Set_tgt_sel_value;
Dial=0x431A0001
CrtVal=0x431A0003
NewVal=0x0
DialVal=10,0
RealVal=11000,220; range
Circular=Yes
;CmdOnDrag=Yes
Logarithmic=-0.98;51.0
;RelativeDrag=Yes
;SndStep=5

And here is my Test - Puleed the SH4 Targeting TDC into my Attack Scope via script.

http://i236.photobucket.com/albums/f...tadimeter1.jpg

http://i236.photobucket.com/albums/f...tadimeter2.jpg

http://i236.photobucket.com/albums/f...tadimeter3.jpg

http://i236.photobucket.com/albums/f...tadimeter4.jpg

So all thats needed is a button to be placed on screen to activate the stadimeter:

Is to Replacce the value in the Dials.cfg
CrtVal=0x431A0001 ; ID of stadimeter button.
with the value of your Button.

The Send Range Button to TDC ID is:
CrtVal=0x431A0005

Will do some further tests to see if I can replace the SH4 TDC with a single button via script. I think this should be easy enough :rock:.


You may notice is the last pic the range is 1080m in the Sh4 TDC and 4623m in the XO manual thats because the XO manual is getting the broken SH5 value (Mast height is always 20M).
To fix that all that should be required is to change the following

Type=68; DIAL_TGT_RANGE
;Cmd=Set_tgt_sel_value;
Dial=0x431A0001
CrtVal=0x431A0003

to match the Dial ID on the SH5 Range Dial.

TheDarkWraith 06-15-10 03:39 PM

two problems with this:

1) the XO TDC dialog box is showing the incorrect range (4623m vice the 1080m on the dial). So the user would have to either change the XO TDC dialog box value or change the TDC range dial to the correct value. This is because the correct mast height is not being set (for those dials). Check your TDC range dial and you'll see the incorrect range is reported with this method. I explored this method also already. If there was a way to set the dials 'hands' by code then this solution would be viable as you could take the range reading from the SH4 style dial and set the TDC range dial to that value. But I haven't found any way to set the Range, AOB, or Speed dials by code yet.

2) that's an american dial from an american sub that would have to be visible at all times so the user can read the correct range and change either of the above listed items. That makes a two step method vice an automatic one. Plus we are using German subs not American subs.

reaper7 06-15-10 03:54 PM

Quote:

Originally Posted by TheDarkWraith (Post 1420085)
two problems with this:

1) the XO TDC dialog box is showing the incorrect range (4623m vice the 1080m on the dial). So the user would have to either change the XO TDC dialog box value or change the TDC range dial to the correct value. This is because the correct mast height is not being set (for those dials).

2) that's an american dial from an american sub that would have to be visible at all times so the user can read the correct range and change either of the above listed items. Plus we are using German subs not American subs.


Yes, that was just my proof of concept. Both very easy to fix.:D

1)Just fixed the first one 2 secs ago.
In the dials.cfg change the highlighted item

;Cmd=Set_tgt_sel_value; to
Cmd=Set_tgt_sel_value;

Code:

[Dial59]
; will be changed by code
Name=TorpedoSolution_Temporary_Range
Type=68; DIAL_TGT_RANGE
Cmd=Set_tgt_sel_value;
Dial=0x431A0001

http://i236.photobucket.com/albums/f...tadimeter5.jpg

Now it sends the range to TDC repalacing the current SH5 one :D.

2) The American dial is not needed that was just from my proof on concept.
All thats needed is the stadimeter ID replace the Id in the dials.cfg with the Id from your own button.

Code:

[Dial58]
; will be changed by code
Name=TorpedoSolution_Mast_Height
Type=70; DIAL_TGT_MAST_HEIGHT_INTERNATIONAL
Cmd=Set_tgt_mast_height_international;
Dial=0x431A0002
CrtVal=0x431A0001

Change to the Id of your button

and in
Code:

[Dial59]
; will be changed by code
Name=TorpedoSolution_Temporary_Range
Type=68; DIAL_TGT_RANGE
Cmd=Set_tgt_sel_value;
Dial=0x431A0001
CrtVal=0x431A0003

Change to the Id of your button.



EDIT: (I'm wrong about Note2)

Jumped the gun aliitle bit the Device ID's for buttons are hardcoded so the XO manual and the TDCCOmputer ID can not be swapped.

Will look for a simple workaround. You could always pull the 2 buttons from the dial into the UI - that is what I will be doing in my Mod.
Will post the results.

Gorshkov 06-15-10 04:00 PM

This is some TDC stuff from American subs present in SH4. Is this SH5 game so screwed-up you cannot find anything more historically accurate?

reaper7 06-15-10 04:07 PM

Quote:

Originally Posted by Gorshkov (Post 1420104)
This is some TDC stuff from American subs present in SH4. Is this SH5 game so screwed-up you cannot find anything more historically accurate?


Yes, the above is just proof of concept. The fix will not require the dial onscreen.
That is just some of the reduntant sh3/4 stuff left in the game from the devs.
All very handy stuff, allows alot of mod options.
Also those are the American dials but they are just graphics 2 mins in photoshop and they wouldn't look american :D.
That is how most graphic mods are done - change whats there to what you want it to be.

TheDarkWraith 06-15-10 04:17 PM

Quote:

Originally Posted by reaper7 (Post 1420111)
Yes, the above is just proof of concept. The fix will not require the dial onscreen.
That is just some of the reduntant sh3/4 stuff left in the game from the devs.
All very handy stuff, allows alot of mod options.
Also those are the American dials but they are just graphics 2 mins in photoshop and they wouldn't look american :D.
That is how most graphic mods are done - change whats there to what you want it to be.

I think you're onto something but it's still not completely automated. You have to click on the use stadimeter and then you have to click on send range to TDC. Maybe there's a way to completely automate it :hmmm: Is the TDC range dial showing the correct range reading? Something tells me it isn't.

reaper7 06-15-10 04:31 PM

Quote:

Originally Posted by TheDarkWraith (Post 1420121)
I think you're onto something but it's still not completely automated. You have to click on the use stadimeter and then you have to click on send range to TDC. Maybe there's a way to completely automate it :hmmm: Is the TDC range dial showing the correct range reading? Something tells me it isn't.


It should, I will check. Maybe something like:

(ButtonName).MouseLeftButtonDown +=
Game.SubmarineCommands.ExecuteCommand( "Set_tgt_mast_height_international" )

(ButtonName).MouseLeftButtonUp +=
Game.SubmarineCommands.ExecuteCommand( "DIAL_TGT_RANGE" )

These are the 2 buttons:
PageTorpedoSolution_RightPanel_Range_SendRangeButt on and PageTorpedoSolution_RightPanel_StadimeterButton

TheDarkWraith 06-15-10 04:32 PM

I got an idea for completely automating it.....trying it now :up: This find of yours might be the most excellent thing so far for SH5 if it also cures the resetting of the speed and AOB when using the stadimeter :D

reaper7 06-15-10 04:44 PM

A picture says a 1000 words :D

http://i236.photobucket.com/albums/f...tadimeter6.jpg

TheDarkWraith 06-15-10 04:47 PM

what about the speed and AOB? Did they get reset to 0?

reaper7 06-15-10 04:49 PM

They were at 0 already. Will try a proper test :up:

reaper7 06-15-10 04:58 PM

:damn: No reset to 0. The reason is because the built SH5 on top os Sh4.

The Sh4 Targetting TDC is made up of 3 parts Range, Speed and AOB.
In Sh4 you dragged the dial to value and clicked on send to tdc for each item.

Thats still happening in SH5 even though its meant to only use the stadimeter.

Here are the buttons used in SH4 TDC

PageTorpedoSolution_RightPanel_Range_SendRangeButt on
PageTorpedoSolution_RightPanel_Range_StadimeterBut ton
PageTorpedoSolution_RightPanel_Speed_SendSpeedButt on
PageTorpedoSolution_RightPanel_AngleOnBow_SendAngl eOnBowButton

Maybe we can get them all to activate at the same time sending the correct values :06:

TheDarkWraith 06-15-10 05:01 PM

Quote:

Originally Posted by reaper7 (Post 1420174)
:damn: No reset to 0. The reason is because the built SH5 on top os Sh4.

The Sh4 Targetting TDC is made up of 3 parts Range, Speed and AOB.
In Sh4 you dragged the dial to value and clicked on send to tdc for each item.

Thats still happening in SH5 even though its meant to only use the stadimeter.

Here are the buttons used in SH4 TDC

PageTorpedoSolution_RightPanel_Range_SendRangeButt on.Visible PageTorpedoSolution_RightPanel_Range_StadimeterBut ton.Visible PageTorpedoSolution_RightPanel_Speed_SendSpeedButt on.Visible
PageTorpedoSolution_RightPanel_AngleOnBow_SendAngl eOnBowButton

Maybe we can get them all to activate at the same time sending the correct values :06:

I got an idea.....:D

reaper7 06-15-10 05:04 PM

By commenting out the following that should fix the reset to 0 problem, will give it a try. :)

EDIT: No good either just stopped the SH4 dials turning

Code:

[Dial56]
Name=TorpedoSolution_Temporary_AngleOnBow
Type=42; DIAL_TGT_ANG_ON_BOW
;Cmd=Set_tgt_sel_value; shared between dials
Dial=0x43010002
CrtVal=0x43010003
NewVal=0x0
DialVal=0.1,-0.1
RealVal=180,-180; degrees
Circular=Yes
CmdOnDrag=Yes
RelativeDrag=Yes
SndStep=5
SndList=1,Menu.TDC.AngleOnBow,360
 
[Dial57]
Name=TorpedoSolution_Temporary_Speed
Type=69; DIAL_TGT_SPEED
;Cmd=Set_tgt_sel_value; shared between dials
Dial=0x43020002
CrtVal=0x43020003
NewVal=0x0
DialVal=0.01,-8.78; 360/41
RealVal=0,40; knots
Circular=Yes
CmdOnDrag=Yes
RelativeDrag=Yes
SndStep=5
SndList=1,Menu.TDC.AngleOnBow,360


John Channing 06-15-10 05:24 PM

This is better than watching the World Cup!

JC


All times are GMT -5. The time now is 02:30 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 1995- 2025 Subsim®
"Subsim" is a registered trademark, all rights reserved.