![]() |
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? |
![]() |
![]() |
Thread Tools | |
Display Modes | |
|
|