![]() |
SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997 |
![]() |
#1 |
Loader
![]() Join Date: Apr 2005
Location: Madrid, Spain
Posts: 86
Downloads: 0
Uploads: 0
|
![]()
Hi everybody,
Maybe I'm reinventing the wheel here, but I have the beginings of something interesting. I wanted to do some mass editing of the campaign files, to give all merchants a chance of getting a patrol boat as escort. Not wanting to do the edit by hand, I wrote a program to do it. This has evolved into a Java library to edit mission files. Right now the library allows adding/removing/changing random groups and their units. Waypoints would be trivial to add, and with a little effort you could add pretty much everything else. To make things clear, this is a library for writing programs, not a program in itself, so you need to know how to write Java programs to use it. But if you do, it's easy to use. As an example, if you wanted to make all elite destroyers veteran, you could use something like this: Code:
Mission mission = new Mission (); mission.read(filename); for (RndGroup group : mission.getRandomGroups()) { for (RndUnit unit : group.getUnits()) { if (unit.getType() == UnitType.DESTROYER && unit.getCrewRating() == CrewRating.ELITE) { unit.setCrewRating(CrewRating.VETERAN); } } } mission.write(filename); Now, if there is enough interest in it, I can clean it up a bit, add some documentation, and release it under the GNU GPL. But the API already does what I wanted it to do, so I can't promise to develop it much further. Anyone interested in this? |
![]() |
![]() |
![]() |
#2 |
Seasoned Skipper
![]() Join Date: Mar 2005
Location: UK
Posts: 683
Downloads: 104
Uploads: 1
|
![]()
Simple answer is yes!
I have been looking at mass changes also... Changing speed from 5 knts for convoys Increasing competence of escorts and merchants etc So far, I've been having to do most of it by hand as I can't program, so I would be interested in anything that could speed up mass editing of the campaign files. Find/Replace is not specific enough... |
![]() |
![]() |
![]() |
#3 |
Navy Seal
![]() Join Date: Mar 2007
Location: New Mexico, USA
Posts: 9,023
Downloads: 8
Uploads: 2
|
![]()
This will be cool if someone turns it into an application. Wow, really awesome.
|
![]() |
![]() |
![]() |
#4 | ||
Loader
![]() Join Date: Apr 2005
Location: Madrid, Spain
Posts: 86
Downloads: 0
Uploads: 0
|
![]() Quote:
![]() Quote:
I'm curious what people would consider their perfect mass-edition application. |
||
![]() |
![]() |
![]() |
#5 |
Loader
![]() Join Date: Apr 2005
Location: Madrid, Spain
Posts: 86
Downloads: 0
Uploads: 0
|
![]()
Okay, I've changed my mind and started work on an application to make this slightly easier. The idea is to avoid the need for Java knowledge and development tools (except for the Java Virtual Machine, of course), while keeping all the power of the current API.
I can do that by integrating a different programming language (python, which is famously easy to use) into the application, so you can write your instructions in a text box, press a button, and have it run. Right now it works, although the interface is very rough. All of my Java work has been server-side and I'm still learning how to make pretty windows with it (If anyone has that knowledge, help would be appreciated). For simple changes, what I have now is not more complex to use than editing the files by hand. As an example, if you want to change all the groups speed to 5 knots (as Jace11 mentioned), you would just write into the textbox: Code:
group.speed = 5 group.updateWaypointSpeed () ![]() Is anyone interested in testing the program when it reaches that stage? I could do with a few more eyes looking at it. If so, let me know and I'll send it over. Once it's a bit more mature than that, and I have arranged for hosting somewhere, I will do a public release with full source. |
![]() |
![]() |
![]() |
#6 |
Seasoned Skipper
![]() Join Date: Mar 2005
Location: UK
Posts: 683
Downloads: 104
Uploads: 1
|
![]()
Good stuff.
Will this program be able to change some variables and not others... Just one example: "Spawnprobabilty=" can refer to a group like a convoy but also all the ships in that convoy have there own spawnprobabilty too.. Could you associate the search with another line or the group name or something so that one can easily replace the values for convoys and not ships.. Find/Replace cannot distinguish these apart, and my editing is taking forever... A complete rehash of the campaign is daunting and ive only completed 1941 so far.. |
![]() |
![]() |
![]() |
#7 |
Loader
![]() Join Date: Apr 2005
Location: Madrid, Spain
Posts: 86
Downloads: 0
Uploads: 0
|
![]()
Jace11, all that is possible right now. The program has four entry fields:
- Condition for changing a group, for example: Code:
group.groupName.contains("Jap_Convoy") Code:
group.spawnProbability = group.spawnProbability/2 Code:
unit.unitType == UnitType.DESTROYER Code:
unit.shipClass = None Press the "change" button, and all japanese convoys will have half the spawn probability, and generic escorts. I'll send you a PM once I have it ready. |
![]() |
![]() |
![]() |
|
|