| View previous topic :: View next topic |
| Author |
Message |
jasonb885
Joined: 27 Mar 2002 Posts: 1749
|
Posted: Sun May 29, 2005 2:21 am Post subject: Works! Perl script to modify Campaign_RND.mis |
|
|
While working on migrating RuB1.30 changes to RuB1.2x for SH3 v1.2 users, I decided I didn't want to miss out on any changes in RuB1.30 to the RND layer. But with so many entries to modify with the cumbersome mission editor, what to do?
I spent the last 18 hours writing a Perl script to parse the Campaign_RND file and produce a valid, non-SH3-crashing layer with properly reordered escorts for SH3 v1.2 users.
Great, but that's that mean to the majority that adopted SH3 v1.3?
Well, I already have the script modifying RndGroup entries. It's a short walk to have it, at the very least, allow for modification of the ReportPosProbability and, well, any other value in each RndGroup's header. I know someone wanted to mess with trying out different Spacing= items, for example. Or greater area for each waypoint. It'd be easy to modify the middle 50% of RndGroup $n.Waypoint $z to have a larger radius.
It'd be easy to have it check the GameEntryDate and allow for a different ReportPosProbability for different years, and string match on GroupName so, for example, US Coastal single ship RNDs could have a higher probability right after the US enters the war, for example.
What I can't offer is the human touch, though. It would take forever to pragmatically write a set of a rules to have particular convoys with particular ships have certain cargos, for example. (Perhaps all convoys bound for the US should be empty?) I can automate some of the more mudane tasks, though, for testing or release.
I can clean up the source and stick it some place if there are any other Perl hackers out there. If not, I'll entertain feature requests.
I've only run it on a fully POSIX system. I don't know if ActiveState's Perl will get the job done or not.
 |
|
| Back to top |
|
 |
Castorp24
Joined: 03 Apr 2005 Posts: 68 Location: Spain
|
Posted: Sun May 29, 2005 6:40 am Post subject: |
|
|
| Do you think it would be possible to make a working merged Campaing_RND.mis with RUB1.3 settings and port traffic of World Mod 3.01? :hmm: |
|
| Back to top |
|
 |
ICBM
Joined: 29 Aug 2004 Posts: 580 Location: Holland.
|
Posted: Sun May 29, 2005 6:56 am Post subject: |
|
|
| Castorp24 wrote: | | Do you think it would be possible to make a working merged Campaing_RND.mis with RUB1.3 settings and port traffic of World Mod 3.01? :hmm: |
That would rock, however I'm not looking forward to having 2 lone merchants on every grid again.. |
|
| Back to top |
|
 |
pampanito
Joined: 19 May 2005 Posts: 96 Location: Spain
|
Posted: Sun May 29, 2005 9:28 am Post subject: Re: Works! Perl script to modify Campaign_RND.mis |
|
|
| jasonb885 wrote: | (Perhaps all convoys bound for the US should be empty?)  |
No! More than one third of the west-bound ships should have cargo. I'm just having a look at ONS-5, 13 ships lost on April/May 1943, 5 of them had cargo:
HARBURY - Swansea for St. John - 6,129 tons of anthracite
HARPERLEY - Newport for Buenos Aires - 6,005 tons of coal & 200 bags of mail
BRISTOL CITY - Bristol for New York - 2,500 tons of china clay & general
BONDE - Swansea dor Chatham - 1,891 tons of anthracite
NORTH BRITAIN - Glasgow for Halifax - 993 tons of firebricks & fireclay in bags
How much love letters lost with HARPERLEY's mail...  |
|
| Back to top |
|
 |
jasonb885
Joined: 27 Mar 2002 Posts: 1749
|
Posted: Sun May 29, 2005 1:14 pm Post subject: |
|
|
| Castorp24 wrote: | | Do you think it would be possible to make a working merged Campaing_RND.mis with RUB1.3 settings and port traffic of World Mod 3.01? :hmm: |
That would be pretty amazing.
Fortunately, you don't need to script that. Just replace RuB's Campaign_* files with World's. I think that's all there is to it. You get all the other realism stuff from RuB, but the arcade style ships and such from World.
I'm not sure it would make sense to try to merge the files.
It could be that the more interesting part of World is their SCR layer, where they have ships in port and such. Since the SCR is independent of the RND, you could keep RuB's RND layer, with the 20/20 reduction, and have the SCR with dozens of ships and port and stuff from World.
Having never actually looked at or even downloaded world's SCR and RND layers, though, I can't be positive. |
|
| Back to top |
|
 |
jasonb885
Joined: 27 Mar 2002 Posts: 1749
|
Posted: Mon May 30, 2005 12:03 pm Post subject: |
|
|
Yay.
I have verified it works, after fixing a silly issue where random ships of a given class were assigned Class=any and I forgot to remove that temporary, internal designation. (SH3 obviously didn't like looking up a Class that didn't exist in the roster files.)
I happily played a modified SH3 v1.3 RND layer under SH3 v1.2 for six hours last night. All the stuff spawned. The convoys were escorted, albeit with somewhat predictable types since the spawn bug really precludes you from using random escort types. (Or, again, some could randomly not spawn.)
I should upload the script after I clean up some naughty comments, in case anyone's actually curious. (I get the impression I'm the only Perl junkie, but whatever...)
 |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|