![]() |
SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997 |
|
|
09-20-10, 06:58 PM
|
#1 |
|
Black Magic
![]() |
ran into a little problem with Automation's Navigate from file. Problem deals with calculating an offset heading to add to the sub's current heading so that the sub will head to the current/new waypoint. The waypoints are stored in a file as x,y meters from game origin (I added a new order to the nav officer's order bar that will show the sub's current position in the messagebox so that one can 'plot' a pattern/navigation). The code gets the sub's current fix as x,y meters from game origin. It then calculates the distance between the sub's fix and the current waypoint. That part is fine - distance shows perfect. The problem is this offset heading. When the sub is < 250m from the waypoint or when the half distance to the waypoint is reached it's supposed to calculate the offset to add to the current heading to keep it heading to the current/new waypoint. Something is wrong with my math and I'm not sure what it is. What would the formula be for calculating this offset given sub's current heading, current fix (x,y) and current waypoint (x,y)?? Using trig I tried using offset = atan2( fix.X - waypoint.X / fix.Y - waypoint.Y ) and adding this offset to the sub's current heading. Everything works fine as long as the waypoint is north of the sub. Any waypoints to the west or east are screwed up
|
|
|
09-20-10, 07:50 PM
|
#2 | |
|
The Old Man
![]() Join Date: Jan 2007
Location: Warszawa, Polska
Posts: 1,452
Downloads: 46
Uploads: 4
|
Quote:
__________________
Long, hard, wet and full of seamen. My precious. SH3+GWX+OLC — sunk x4, retired x2; SH5+TDW — still exploring My SH5 mods: EQuaTool - Elite Quality Map Tools, Patrol Routine Scripts, No Logo Intro Menu_Animation, Less Annoying Stopwatch Links: SH5 mods I use, FileFront, Manual plotting how-to |
|
|
|
09-20-10, 07:54 PM
|
#3 | |
|
Black Magic
![]() |
Quote:
Being able to navigate search patterns and all is just about complete |
|
|
|
09-20-10, 07:58 PM
|
#4 | |
|
The Old Man
![]() Join Date: Jan 2007
Location: Warszawa, Polska
Posts: 1,452
Downloads: 46
Uploads: 4
|
Quote:
__________________
Long, hard, wet and full of seamen. My precious. SH3+GWX+OLC — sunk x4, retired x2; SH5+TDW — still exploring My SH5 mods: EQuaTool - Elite Quality Map Tools, Patrol Routine Scripts, No Logo Intro Menu_Animation, Less Annoying Stopwatch Links: SH5 mods I use, FileFront, Manual plotting how-to |
|
|
|
09-20-10, 09:49 PM
|
#5 |
|
Black Magic
![]() |
new command added to Automation: Navigate_from_file. Parameter 3 of the command specifies the file to be used (without extension). The code will automatically add the .SHN extension.
You define the waypoints to navigate from in the file. The waypoints are specified as x,y meters from game origin. A new order has been added to the navigator's order bar that will allow you to get the current x,y position in meters from game origin for 'mapping' out a navigation route or pattern. When the order is pressed the current x,y position will be displayed in the messagebox. The code will create a new folder in your \Silent Hunter 5\data folder. The folder will be named Navigation. All your navigation 'scripts' need to be stored here as that is where parameter 3 of the command will find them. Here are the contents of a test navigation script that will do a box search pattern (these are absolute coordinates): 3039731,9004347,1,5,0 3041023,9004587,1,5,0 3041234,9003242,1,5,0 3039943,9003011,1,5,0 3039740,9004364,1,5,0 the first entry is the X position. Second entry is Y position. Third entry is TC level to use. Fourth entry is speed to use. Fifth entry is depth to use. Looking into being able to define relative coordinates. These relative coordinates would be relative to your sub for defining things like search patterns. |
|
|
09-21-10, 02:25 AM
|
#6 |
|
Chief
![]() Join Date: Aug 2010
Location: Rivoli (Italy)
Posts: 310
Downloads: 162
Uploads: 0
|
Can someone tell me about the interaction of
U-boat Historical Specifications 1.4 with NewUIs_TDC_4_3_1_ByTheDarkWraith and IRAI_0_0_25_TheDarkWraith? |
|
|
09-21-10, 05:03 AM
|
#7 | |
|
The Old Man
![]() Join Date: Jan 2007
Location: Warszawa, Polska
Posts: 1,452
Downloads: 46
Uploads: 4
|
Quote:
U-boat Historical Specifications 1.4 NewUIs_TDC_4_3_1_ByTheDarkWraith New_UIs_TDC_4_3_1_Patch_3_ByTheDarkWraith NewUIs_TDC_4_3_1_No_Hydrophone_On_Surface_No_Aircr aft_Spotting IRAI_0_0_25_ByTheDarkWraith IRAI_0_0_25_No_hydrophone_on_surface_No_Aircraft_s potting
__________________
Long, hard, wet and full of seamen. My precious. SH3+GWX+OLC — sunk x4, retired x2; SH5+TDW — still exploring My SH5 mods: EQuaTool - Elite Quality Map Tools, Patrol Routine Scripts, No Logo Intro Menu_Animation, Less Annoying Stopwatch Links: SH5 mods I use, FileFront, Manual plotting how-to |
|
|
|
![]() |
| Tags |
| dbrn, favorite, new ui |
| Thread Tools | |
| Display Modes | |
|
|
