SUBSIM Radio Room Forums



SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997

Go Back   SUBSIM Radio Room Forums > Silent Hunter 3 - 4 - 5 > SH5 Mods Workshop
Forget password? Reset here

Reply
 
Thread Tools Display Modes
Old 08-31-10, 06:38 PM   #1
Abd_von_Mumit
The Old Man
 
Join Date: Jan 2007
Location: Warszawa, Polska
Posts: 1,452
Downloads: 46
Uploads: 4
Default

Thanks guys - just found out that the loop is ill placed.

The condition would be: if [any sound contact detected] then [drop TC to 1] and [report nearest contact] and [generally make a lot of noise so that I hear even when washing dishes] and [terminate the script].
__________________
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
Abd_von_Mumit is offline   Reply With Quote
Old 08-31-10, 06:55 PM   #2
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by Abd_von_Mumit View Post
Thanks guys - just found out that the loop is ill placed.

The condition would be: if [any sound contact detected] then [drop TC to 1] and [report nearest contact] and [generally make a lot of noise so that I hear even when washing dishes] and [terminate the script].
ah, that functionality of dropping to TCx would best be put into the command....let me see if I have a parameter available or not......ah, param 5 is open.....what I'll do is add another bit to the sweep hydrophone command (bit 12) that will be set TC to 1 on contact detected
TheDarkWraith is offline   Reply With Quote
Old 08-31-10, 07:05 PM   #3
Abd_von_Mumit
The Old Man
 
Join Date: Jan 2007
Location: Warszawa, Polska
Posts: 1,452
Downloads: 46
Uploads: 4
Default

Quote:
Originally Posted by TheDarkWraith View Post
ah, that functionality of dropping to TCx would best be put into the command....let me see if I have a parameter available or not......ah, param 5 is open.....what I'll do is add another bit to the sweep hydrophone command (bit 12) that will be set TC to 1 on contact detected
Wouldn't it be better and more consistent to set it to TCxOnMessageBoxTextDesiredTCLevel value?


As to the script I came to this so far:
[COMMANDS]
Activate_NavMap_Station,0,0,0,0,0,0,1
Set_Time_Compression,128,0,0,0,0,0,1
Set_new_depth,20,0,0,0,0,0,60
All_stop,0,0,0,0,0,0,5
Report_nearest_sound_contact,0,0,0,0,0,0,10
Surface,0,0,0,0,0,0,60
Set_new_speed,7.5,0,0,0,0,0,3240
Loop,-1,0,0,0,0,0,0
[COMMANDS_END]

If Trevally. doesn't mind I'd publish it after some more testing as a mod.


EDIT: Also if you put it into a command, it won't give user ability to terminate the script on an event. Also it won't let them to terminate the script on other contacts (like a plane). You would also need to modify number of options for some commands only, which would be inconsistent, wouldn't you?


EDIT 2: I found a bug: script doesn't recognize that game TC level changed and its [internal?] clock is still set to x128 when the game is for example in TC1.
__________________
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
Abd_von_Mumit is offline   Reply With Quote
Old 08-31-10, 07:15 PM   #4
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by Abd_von_Mumit View Post
Wouldn't it be better and more consistent to set it to TCxOnMessageBoxTextDesiredTCLevel value?


As to the script I came to this so far:
[COMMANDS]
Activate_NavMap_Station,0,0,0,0,0,0,1
Set_Time_Compression,128,0,0,0,0,0,1
Set_new_depth,20,0,0,0,0,0,60
All_stop,0,0,0,0,0,0,5
Report_nearest_sound_contact,0,0,0,0,0,0,10
Surface,0,0,0,0,0,0,60
Set_new_speed,7.5,0,0,0,0,0,3240
Loop,-1,0,0,0,0,0,0
[COMMANDS_END]

If Trevally. doesn't mind I'd publish it after some more testing as a mod.


EDIT: Also if you put it into a command, it won't give user ability to terminate the script on an event. Also it won't let them to terminate the script on other contacts (like a plane). You would also need to modify number of options for some commands only, which would be inconsistent, wouldn't you?


EDIT 2: I found a bug: script doesn't recognize that game TC level changed and its [internal?] clock is still set to x128 when the game is for example in TC1.
change these commands:

Activate_NavMap_Station,0,0,0,0,0,0,1
Set_Time_Compression,128,0,0,0,0,0,1

to:

Activate_NavMap_Station,0,0,0,0,0,1,1
Set_Time_Compression,128,0,0,0,0,1,1

what the second to last 1 says is execute this command only once. This is used in loops where there's no need to be executing the command more than once.

Script will terminate just fine if I add bit 12. All it will do it set TC to 1 if bet 12 is set.

Explain your edit 2 more. I'm not following you.

I won't use parameter 5 for the TC level. I like your suggestion of using TCxOnMessageBoxTextDesiredTCLevel value
TheDarkWraith is offline   Reply With Quote
Old 08-31-10, 07:21 PM   #5
Abd_von_Mumit
The Old Man
 
Join Date: Jan 2007
Location: Warszawa, Polska
Posts: 1,452
Downloads: 46
Uploads: 4
Default

Quote:
Originally Posted by TheDarkWraith View Post
change these commands:

Activate_NavMap_Station,0,0,0,0,0,0,1
Set_Time_Compression,128,0,0,0,0,0,1

to:

Activate_NavMap_Station,0,0,0,0,0,1,1
Set_Time_Compression,128,0,0,0,0,1,1

what the second to last 1 says is execute this command only once. This is used in loops where there's no need to be executing the command more than once.
Copy that, changing.


Quote:
Originally Posted by TheDarkWraith View Post
Explain your edit 2 more. I'm not following you.
When the script is running I press Esc, which drops TC to 1 and switches to first person view. According to game's clock script loop should end/start in, say, 30 more minutes, so I have 30 more minutes to run all around my sub before script switches me back to the map. But the script still runs as if TC was still x128, and interrupts my merry running after 15 seconds instead of 30 minutes.
__________________
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
Abd_von_Mumit is offline   Reply With Quote
Old 08-31-10, 07:25 PM   #6
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by Abd_von_Mumit View Post
When the script is running I press Esc, which drops TC to 1 and switches to first person view. According to game's clock script loop should end/start in, say, 30 more minutes, so I have 30 more minutes to run all around my sub before script switches me back to the map. But the script still runs as if TC was still x128, and interrupts my merry running after 15 seconds instead of 30 minutes.
that's interesting. I've hooked into the game's TC level function to 'trap' that command so anytime TC level is changed I should get notified of it and take appropriate action (high precision timer gets changed - has nothing to do with the script). I'll have to test your script you posted to see what's going on by pressing the ESC key

It's also ok to have an ending 0 for the command instead of 1. That's just the delay before executing the next command. If 0 then it's sets the minimum time for you (is like 0.1 seconds)

EDIT:

valid bug. Bug is not because of me but because game doesn't follow it's own rules.....nice....ok I'll have to figure out why and how to fix it.......

EDIT 2:

found a solution. Luckily I know this game and it's files pretty well......bug fixed. Fix will appear in v4.2.0 which is ready for release but I'm working on the options migrater now so you don't have to manually redo your options file everytime I release a new version.

Last edited by TheDarkWraith; 08-31-10 at 07:47 PM.
TheDarkWraith is offline   Reply With Quote
Old 08-31-10, 08:20 PM   #7
Abd_von_Mumit
The Old Man
 
Join Date: Jan 2007
Location: Warszawa, Polska
Posts: 1,452
Downloads: 46
Uploads: 4
Default

Quote:
Originally Posted by TheDarkWraith View Post
found a solution. Luckily I know this game and it's files pretty well......bug fixed. Fix will appear in v4.2.0 which is ready for release but I'm working on the options migrater now so you don't have to manually redo your options file everytime I release a new version.
That's some good news.


Would these nested loops work?:

[COMMANDS]
Set_new_depth,10,0,0,0,0,0,30
Surface,0,0,0,0,0,0,30
Loop,4,0,0,0,0,0,0
Sing_a_dolphin_song
Loop,-1,0,0,0,0,0,0
[COMMANDS_END]
__________________
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
Abd_von_Mumit is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 07:44 AM.


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