SUBSIM Radio Room Forums



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

Go Back   SUBSIM Radio Room Forums > Downloads > Silent Hunter III > Gameplay mods
Mods, missions, patches, & files for every subsim there ever was!
Forget password? Reset here

Navigation

If you are experiencing trouble downloading, it could be due to an ad-blocker or extension in your Chrome browser.
Try turning off the ad-blocker or whitelisting www.subsim.com in your ad-blocker extension
or switching to Microsoft Edge browser or Firefox to complete the download. Thanks.

Main | Legacy Downloads | Utilities | Category Tree | Stats | Search

You must be registered with this forum to download files. If you are registered and getting this message,
then the Downloads section is experiencing heavy load volumes and has been temporarily restricted to members
who are in the Subsim Navy (donors). Please try again later.

 

Become an officer in the Subsim Navy here and have your download limit increased to 25, 35 or even 60 a day! Click here to join.

A website this big uses a lot of bandwidth and needs a really powerful server to stay online day after day, for 20 years. Thanks for the support!

File Name: PerlScripts_for_ SH3V0.7.7z (11.54 MB) Download
Author: LGN1 (Uploaded by LGN1)
Date Added: 03-27-10
Downloads: 417
Grade: A+
Description
Contains campaign layers for GWX!

Perl scripts for editing SH3 campaign files, Readme.

Version 0.7

Written by LGN1, July 2010 / June 2013


I have added a gui version of the zigzag.pl script and also an executable for the script. The executable can be opened, e.g., with 7zip and you can check it if you want. If you are using the executable, installing perl should not be neccessary anymore.


This package contains six Perl scripts for editing SH3 campaign files. In order to use them you need Perl on your system (see below).

**************************************
PosTimeFilter.pl script:
-------------------
The first script, called PosTimeFilter.pl, extracts all units from the campaign layers that enter a specified area during a specified time. The script will first ask the relevant data (see PosTimeFilter.jpg):

First, it asks whether you want to modify the Campaign_SCR.mis file (enter 's', without the ''), the Campaign_RND.mis file ('r'), or the Campaign_LND.mis file ('l').

Second, it will ask the start date of the date 'window'. The default value is shown in brackets (just press enter to choose the default option).

Third, it will ask the end date of the date 'window'.

Finally, it will ask for the upper longitude, lower longitude, upper latitude, and lower lattitude of the rectangle in which the traffic will NOT be deleted. The desired values can be obtained from the Mission Editor (see MissionEditorCoord.jpg. Be careful, the Mission Editor shows meters and the script wants kilometers). A rough overview for the North Atlantic can be seen in Worldmap.jpg.

After these steps the scripts checks all the units and reports how many it found,... You can then choose to delete the units outside the area/time. The modified file is called PosTime_Campaign_*.mis. The original file Campaign_*.mis is not modified.
**************************************


**************************************
zigzag.pl script (for an example for GWX see ReadmeMedCampaign.txt):
--------------------------------------------------------------------
This script adds a zigzag pattern around the main course of all units satisfying user-specified criteria. It only works for the Campaign_RND.mis file. In detail, the criteria are (see zigzag.jpg):

Max. distance: the maximum distance a group will travel on average without changing course.

Zigzag angle: the average angle for the zigzag pattern around the main course.

Probability for switching zigzag pattern: higher values lead to a less regular zigzag pattern.

Probability for a unit to have a zigzag pattern: allows to specify a random chance that a ship zigzags

Min. ColumnsNo: groups with less columns than the specified value will not zigzag.

Max. ColumnsNo: groups with more columns than the specified value will not zigzag.

Min. Speed: groups with a speed below the chosen value (at any waypoint) will not zigzag.

Max. Speed: groups with a speed above the chosen value (again, at any waypoint) will not zigzag.

Check origin: groups containing a unit from either Japan, Spain, Germany, Sweden, Ireland, Italy, Finland, Portugal, or Environmental will not zigzag.

Min. spawn probability: only groups with a spawn probability higher than the chosen value will zigzag.

Zigzag only for escorted (e), only for unescorted (u), or for all (a) (default a): Allows the user to limit the zigzagging to either escorted groups or unescorted groups.

Start/End date: only groups that exist between start and end date will zigzag.

Zigzag in North Sea: adds zigzag patterns to the North Sea (see Worldmap.jpg for exact area. Specifying 'no' does not prevent zigzag pattern in the area if it's included in the user's specified area, see below).

Zigzag in Bay of Biscay: same for Bay of Biscay (see Worldmap.jpg for exact area).

Upper longitude,...: boundary values for the area in which groups zigzag (in addition to North Sea, Bay of Biscay if chosen).

The modified file is called ZigZag_Campaign_RND.mis. The original file is not modified. The random radii around all the zigzag waypoints do not overlap. Usually, the random radius is equal to the distance of the waypoint to the main course. This guarantees random course changes. The Loop feature has been disabled for zigzagging units.
**************************************


**************************************
ClassFilter.pl script (mainly for Mission/Campaign designer):
-------------------------------------------------------------
This script extracts all groups/units that contain a specified class, e.g., KLS, NavalBase, Minefield,... from the Campaign_*.mis files. A new Campaign_*.mis file (called 'ClassName'_Campaign_*.mis) is created which contains only the groups containing the specified class (the original file is not touched). You can choose whether you want to extract only groups consisting purely of the chosen type or groups that have at least one unit with the chosen class.
**************************************


**************************************
OriginFilter.pl script (mainly for Mission/Campaign designer):
-------------------------------------------------------------
The same as ClassFilter.pl but in this case you can choose the origin not the class. If you want to choose the class and the origin, just run both scripts after each other. Don't forget to rename the campaign file in-between.
**************************************


**************************************
TypeFilter.pl script (mainly for Mission/Campaign designer):
-------------------------------------------------------------
The same as ClassFilter.pl but in this case you can choose the type not the class. Again, you can combine all the filters. Just rename in-between running the different scripts.
**************************************


**************************************
RemoveClass.pl and RemoveType.pl script:
-------------------------------------------------------------
This script removes all groups/units that contain a specified class/type, e.g., KLS, NavalBase, Minefield,... from the Campaign_*.mis files. A new Campaign_*.mis file (called 'Rem_ClassName'_Campaign_*.mis) is created which contains only the groups not containing the specified class (the original file is not touched).
**************************************


**************************************
Some important notes:
---------------------

1) These scripts are my first Perl scripts and they are probably not 100% foolproof. Unreasonable input parameters may lead to messed-up campaign layers. It is not checked whether the input parameters make sense.

2) With the given zigzag script it is very easy to overload the campaign layer with waypoints. I recommend to first reduce the size of the campaign layers with the first script before adding new zigzag waypoints. Just choose an area you will not leave during the patrol.

3) Use the available parameters to keep the number of new waypoints in a reasonable range. For instance, if you think that attacking convoys is already difficult enough, use Max. ColumnsNo = 1 to have only single ships and one column convoys zigzag. You may also limit the zigzagging to a smaller area where you will spend most of your time during a patrol. Clearly, a small max. distance makes it more realistic and challenging, but also increases the number of waypoints! In general, one has to find an appropriate balance between zigzag area, zigzagging groups, and zigzag distance. User feedback is very important here. Please share your experiences!

4) The zigzag script does not check whether a new waypoint is on land. I guess this is no problem if you are not close to land (I think ships that are not rendered just travel over land). If you are close, the ships might end up on the beach. So, you either stay away from the coast or, even better, avoid to use the zigzag script in areas close to land. If you use it in these areas, you may later check with the Mission Editor whether there are any waypoints on land (and correct it if necessary).

4) The scripts report how many units they found, how many they removed,... It's a good idea to check whether they found all the units and whether the new files have the correct number of ships (just open the files with Notepad and look for the number of the last unit/group). You can also check whether the last unit/group in the new file is also the last unit in the Mission Editor. If not, then there is a problem with renumbering. I have never encountered any such problem, but it is better if you check it also.
The zigzag script writes the new data with different number of decimal digits (not always six). I guess that's fine. If you don't like it, just open the new file in the Mission Editor and save it again. All numbers should have six decimal digits now. The new gui version always writes six digits.

5) Feel free to modify/improve the script as you wish. If you do so, please share it with others. The script is probably not very elegant, but straight-forward. If you have any question don't hesitate to ask.

6) Use at own risk! Please post any feedback here:

http://www.subsim.com/radioroom/show...55f37&t=165794

Cheers, LGN1

Not for comercial use!

**************************************
Getting Perl and using the script:
----------------------------------

you can download Perl from here:

http://www.perl.org/get.html

After installing it, go to 'Start' and click 'Run...'. Enter 'cmd' and press OK. You should now have a window similar to the one in PosTimeFilter.jpg. Go to the directory with the script and the Campaign* files you want to modify (If you have the files on the Desktop write 'cd Desktop' and press return. That should be enough).
Now enter 'perl PosTimeFilter.pl' or 'perl zigzag.pl' depending on which script you want to run. Press return and enter the parameters. Return and you are done.
Images
PerlScripts_for_ SH3V0.7.7z by LGN1 on 06-18-13

You must be registered with this forum to download files. If you are registered and getting this message,
then the Downloads section is experiencing heavy load volumes and has been temporarily restricted to members
who are in the Subsim Navy (donors). Please try again later.

 

Become an officer in the Subsim Navy here and have your download limit increased to 25, 35 or even 60 a day! Click here to join.

A website this big uses a lot of bandwidth and needs a really powerful server to stay online day after day, for 20 years. Thanks for the support!



Comments


DownloadsII 5.1.0 by CyberRanger & Jelle
Based on ecDownloads 4.1 © Ronin
Graphics by Danlisa

All times are GMT -5. The time now is 10:36 PM.


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