![]() |
SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997 |
![]() |
#1 |
Ace of the Deep
![]() Join Date: Mar 2006
Posts: 1,138
Downloads: 147
Uploads: 12
|
![]()
Hi,
I am currently working on a perl script that automatically adds entries to the captain's log book depending on what happened during a patrol. Here is an example: Stock log book entries: ![]() Uploaded with ImageShack.us Log book after running the script: ![]() Uploaded with ImageShack.us The script uses the *.crp file of a save-game which contains all entries in the 'console' during a patrol. It reads these entries, looks for certain patterns, and adds corresponding entries to the log book. At the moment it looks for these entries (first line is the text in the 'console', the second line the corresponding text that is added to the log book. The third line is the time in hours that must pass before another entry of this kind is added. E.g., this allows you to have weather reports only every 24h in your log book): EntryText=Torpedo Impact! EntryText=Torpedo impact. 0 EntryText=Torpedo missed, sir! EntryText=Torpedo missed. 0 EntryText=Torpedo is a dud, sir! EntryText=Torpedo is a dud. 0 EntryText=Tube 1 ready, sir! EntryText=Tube 1 reloaded. 0 EntryText=Tube 2 ready, sir! EntryText=Tube 2 reloaded. 0 EntryText=Tube 3 ready, sir! EntryText=Tube 3 reloaded. 0 EntryText=Tube 4 ready, sir! EntryText=Tube 4 reloaded. 0 EntryText=Tube 5 ready, sir! EntryText=Tube 5 reloaded. 0 EntryText=Tube 6 ready, sir! EntryText=Tube 6 reloaded. 0 EntryText=Firing tube 1, sir! EntryText=Firing tube 1. 0 EntryText=Firing tube 2, sir! EntryText=Firing tube 2. 0 EntryText=Firing tube 3, sir! EntryText=Firing tube 3. 0 EntryText=Firing tube 4, sir! EntryText=Firing tube 4. 0 EntryText=Firing tube 5, sir! EntryText=Firing tube 5. 0 EntryText=Firing tube 6, sir! EntryText=Firing tube 6. 0 EntryText=Crash dive EntryText=Crash dive. 0 EntryText=Man the deck gun EntryText=Order to man the deck gun. 0 EntryText=Man the flak gun(s) EntryText=Order to man the flak gun. 0 EntryText=We're under attack, sir! EntryText=Under attack. 1 EntryText=Enemy is pinging us, sir! EntryText=Destroyer is using ASDIC. 1 EntryText=Depth charges in the water, sir! EntryText=Depth charges. 1 EntryText=Detecting radar signals! EntryText=Radar signals detected! 6 EntryText=We have to surface, sir! EntryText=We have to surface. 0 Keyword=Wind Speed EntryText= 24 Keyword=Sound contact, sir! Merchant EntryText=Sonar operator reports sound contact. 6 Keyword=Sound contact, sir! Warship EntryText=Sound operator reports warship. 6 Keyword=Ship spotted, sir! EntryText=Ship spotted. 6 Keyword=Aircraft spotted, sir! EntryText=Aircraft spotted. 1 Keyword=Submarine spotted, sir! EntryText=Submarine spotted. 1 Keyword=damaged, sir! Remove=7 0 Keyword=destroyed, sir! Remove=7 0 Keyword=Flooding in Remove=7 1 Keyword=repaired, sir! Remove=7 0 Keyword=intact, sir! Remove=7 0 Keyword=Diesel fuel reserve down to Remove=8 0 At the moment these entries are still very short and I would like to replace them with longer once. It would be great if you could make some suggestions for better entries (but please keep in mind that they must be quite generic). Thanks for any suggestions! Cheers, LGN1 PS: After a patrol these entries can also be easily extended by JScones excellent Patrol-Log editor in SH Commander! |
![]() |
![]() |
![]() |
#2 |
Pacific Aces Dev Team
|
![]()
Amazing mate
![]()
__________________
One day I will return to sea ... |
![]() |
![]() |
![]() |
#3 |
Silent Hunter
![]() |
![]()
WOW, very good Idea !!!!
![]() Best regards, Magic ![]() |
![]() |
![]() |
![]() |
#4 |
Admiral
![]() Join Date: Feb 2006
Location: PQ AN 25
Posts: 2,178
Downloads: 70
Uploads: 0
|
![]()
Together with SH3 LogEditor this will be as close as it gets to a real logbook!
Kudos mate°!!°
__________________
SH3+GWX SH5+WoS Still Sailing....still Deep ![]() |
![]() |
![]() |
![]() |
#5 | |
Planesman
![]() Join Date: Dec 2006
Posts: 192
Downloads: 77
Uploads: 0
|
![]() Quote:
Then my questions ![]() Are these entrys your Entrys or the Entries of the game? I ask because if u search for that patterns it will not work in german i assume. |
|
![]() |
![]() |
![]() |
#6 |
Ace of the Deep
![]() Join Date: Mar 2006
Posts: 1,138
Downloads: 147
Uploads: 12
|
![]()
Thanks for the encouraging words!
At the moment I have only a German and English version. However, it's easy to add other languages if someone wants to support them. It's also very easy to add other words/items as you like. The script is quite easy to modify,..., but since I don't know how to program a GUI, you have to have perl ![]() ![]() Anyway, any suggestions for good entries for firing torpedoes,... ![]() Cheers, LGN1 |
![]() |
![]() |
![]() |
#7 |
Eternal Patrol
![]() |
![]()
Looks pretty cool so far!
![]()
__________________
“Never do anything you can't take back.” —Rocky Russo |
![]() |
![]() |
![]() |
#8 |
Krusty Krab
Join Date: Mar 2002
Location: Decks awash in the North Atlantic
Posts: 1,450
Downloads: 493
Uploads: 0
|
![]()
WOW!!!
Look forward to more. ![]() ![]() ![]() ![]() Good Hunting, FUBAR295
__________________
Good judgment comes from experience. Unfortunately, the experience usually comes from bad judgment. |
![]() |
![]() |
![]() |
#9 |
SUBSIM Newsman
|
Cool,
![]()
__________________
Nothing in life is to be feard,it is only to be understood. Marie Curie ![]() |
![]() |
![]() |
![]() |
#10 |
Engineer
![]() Join Date: Jul 2010
Location: Derby, UK
Posts: 200
Downloads: 86
Uploads: 0
|
![]()
LGN1,
Very interesting stuff, I used to update my logs in SH3 Commander with most of this, but had to stop as it was consuming too much paper during patrols and too much time after patrols. I used to include "evasion begun" and "evasion complete" entries which could be tied to the requests for silent running on/off. I also used include oxygen level reports whilst under long evasions but not if I was diving to keep out of a storm. (or the 100% report you get after every dive!) Can your script include IF statements? or maybe just include the 50% 25% 10% reports? And the Medic!!!!!! text could be linked to crew wounded/killed Just my suggestions, feel free to ignore if it isn't easy to do |
![]() |
![]() |
![]() |
#11 |
Ace of the Deep
![]() Join Date: Mar 2006
Posts: 1,138
Downloads: 147
Uploads: 12
|
![]()
Hi,
here is an automatically generated log of an interesting patrol. Page 1: I am leaving Brest on the 30. Dec. 1942. Many radar warnings and crash dives because of airplanes in the Bay of Biscay. ![]() Page 2: 4. Jan. 1943. I receive a radar warning and dive. The sound operator reports a warship and merchant. I found a convoy. I shoot 5 torpedoes, but only 3 hit. Two ships sunk. Destroyer starts to use ASDIC. ![]() Page 3: I find a slow tanker behind the convoy and sink it. 5. to 15. Jan. only weather reports. Poor visibility and strong winds. At least no planes. ![]() Page 4: For training purposes I order the crew to man the deck gun and flak. Planes start to show up again. ![]() Page 5 to 7: The boat is damaged by a plane. After receiving a radar warning and diving, the sound operator reports a merchant and warship. Another convoy. I shoot four torpedoes. 3 hits, 2 ships sunk. Another convoy is found after diving because of a radar warning. I shoot 3 torpedoes. 3 hits, 2 ships sunk. Destroyer starts to throw depth charges. Fuel down to 50%. ![]() ![]() ![]() Page 8: Trip back through the Bay of Biscay. Many radar warnings. Feb. 7th 1943 sound operator reports sound contact. Our escort. ![]() It's quite interesting, the crew did not spot a single ship. All contacts were made via radar warnings. I wonder whether it worked that well in real-life, too. I doubt it. As you can see the entries are quite generic because you don't have much information. However, the automatically generated log can serve well as a first draft for a more detailed log with JScones' SH3 Patrol Log Editor. |
![]() |
![]() |
![]() |
#12 |
Chief
![]() Join Date: Jul 2005
Posts: 320
Downloads: 508
Uploads: 0
|
![]()
Superb, back to SH3 from SH5
|
![]() |
![]() |
![]() |
#13 |
Admiral
![]() |
![]()
Great Idea. Sh3 is not yet dead. NOT YET.
Could it work in the background during gameplay? |
![]() |
![]() |
![]() |
#14 |
Planesman
![]() Join Date: Dec 2006
Posts: 192
Downloads: 77
Uploads: 0
|
![]()
Ah suggestion: as i see for example in the log for the sunked Passagierdampfer.
There are many messages which are similiar like the "Torpedotreffer". All the same time and the same message. Would it be possible to group them? for example "3 Torpedotreffer" or when u launch many torpedos in small intervalls something like "Torpedoschuss aus Rohren 3, 4, 5, 6". Just an idea if its possible to implement would be nice, because of a shorter log ![]() |
![]() |
![]() |
![]() |
#15 |
Loader
![]() Join Date: Jul 2007
Location: Central FL
Posts: 88
Downloads: 337
Uploads: 0
|
![]()
This is cool! I look forward to seeing this mod ready to use.
Happy hunting, rea00cy
__________________
ATROPOS-the deadly nightshade |
![]() |
![]() |
![]() |
|
|