mcoca
04-27-07, 07:23 AM
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:
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);
The insides of the library are not that clean but it works.
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?
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:
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);
The insides of the library are not that clean but it works.
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?