A Layman's Guide to Successfully Editing the MWiF Game File.

Post new mods and scenarios here.

Moderator: Shannon V. OKeets

User avatar
Courtenay
Posts: 4396
Joined: Wed Nov 12, 2008 4:34 pm

RE: A Layman's Guide to Successfully Editing the MWiF Game File.

Post by Courtenay »

This sounds like a bug to me. Why would saving a Chinese BP in Sian make it Russian? It is still a Chinese city.

For production, both Chinese factions are combined.

Please post this in the Tech Support section. I might be wrong, but this really does look like a bug.
I thought I knew how to play this game....
User avatar
craigbear
Posts: 769
Joined: Tue Jan 21, 2020 2:30 am
Location: Calgary, Alberta

RE: A Layman's Guide to Successfully Editing the MWiF Game File.

Post by craigbear »

In any case, this has happened to me before. I should have known better. I will post it as a bug.

But my original request for a method of fixing it still stands
User avatar
craigbear
Posts: 769
Joined: Tue Jan 21, 2020 2:30 am
Location: Calgary, Alberta

RE: A Layman's Guide to Successfully Editing the MWiF Game File.

Post by craigbear »

Will changing the BP number in the file from 256 to 0 fix things, or will it cause problems. It is easy enough to increase the BP saved in a nationalist city from 1 to 2.
User avatar
rkr1958
Posts: 29638
Joined: Thu May 21, 2009 10:23 am

RE: A Layman's Guide to Successfully Editing the MWiF Game File.

Post by rkr1958 »

ORIGINAL: craigbear

I foolishly saved a Chinese BP in Sian, and now it has become Russian and is unusable. I even have tried to save another Chinese BP in another city, and get the opportunity to move the BP during the BP save phase, but an error comes up when I try to pick the BP up.

I recall somewhere that this has been dealt with by modding, but I cannot seem to find the entry and am uncertain of the search terms needed. Does anyone recall how I can change the BP to Chinese owned, and move it to a nationalist city?

I know it is easy enough to change 1 BP to 2 in the Nationalist city, but what do I do about the unusable one in Sian? I suppose if Japan eventually captures it, they can voluntarily destroy it, but that lacks elegance.

Can anyone point me the way?
I've done this before. I don't think I've "documented" it. However, if you post your game file I'll go through and document the edits to change ownership and nationality of the BP. I think having it documented would be valuable for the future for many of us.
Ronnie
User avatar
craigbear
Posts: 769
Joined: Tue Jan 21, 2020 2:30 am
Location: Calgary, Alberta

RE: A Layman's Guide to Successfully Editing the MWiF Game File.

Post by craigbear »

My first impulse was to ask you not to bother, as the effect on my game is minimal and we could otherwise ignore it...

However, that you are offering to document, I do believe is important. The file I am sending is actually out-of-date. I am in a PBEM game and the turn is in the other player's hands. That being said, if you are documenting the process, I ought to be able to copy the process when my file is returned and rectify the problem at that point.

I just want you to know that whatever work you put into this particular file will not be useful for me... however the process is one that I believe should be documented as the issue is repeatable (simply save a Chinese BP in Sian (or any communist city), and will likely happen to someone else in future (I think the previous example I recall had to do with Vichy BP which ended up being non-Vichy owned somehow?).

Also note that there is an Chinese BP already saved in Kweiyang... and this could be used to recompense for a Chinese BP simply by adding to it... but ultimately, the solution should be accomplished by simply changing ownership (and perhaps location) of the affected BP.

Another aside, I did try to move the Sian resource to another city by picking it up and transfering via the save BP screen; however, the program would not allow me to do so and gave an error message that even if ignored, did not allow the BP to be moved by this route.

Thank-you in advance for documenting this as I think it will be useful. The file is attached:
Attachments
SianBP.zip
(1.47 MiB) Downloaded 6 times
User avatar
rkr1958
Posts: 29638
Joined: Thu May 21, 2009 10:23 am

RE: A Layman's Guide to Successfully Editing the MWiF Game File.

Post by rkr1958 »

ORIGINAL: craigbear
My first impulse was to ask you not to bother, as the effect on my game is minimal and we could otherwise ignore it...

However, that you are offering to document, I do believe is important. The file I am sending is actually out-of-date. I am in a PBEM game and the turn is in the other player's hands. That being said, if you are documenting the process, I ought to be able to copy the process when my file is returned and rectify the problem at that point.

I just want you to know that whatever work you put into this particular file will not be useful for me... however the process is one that I believe should be documented as the issue is repeatable (simply save a Chinese BP in Sian (or any communist city), and will likely happen to someone else in future (I think the previous example I recall had to do with Vichy BP which ended up being non-Vichy owned somehow?).

Also note that there is an Chinese BP already saved in Kweiyang... and this could be used to recompense for a Chinese BP simply by adding to it... but ultimately, the solution should be accomplished by simply changing ownership (and perhaps location) of the affected BP.

Another aside, I did try to move the Sian resource to another city by picking it up and transfering via the save BP screen; however, the program would not allow me to do so and gave an error message that even if ignored, did not allow the BP to be moved by this route.

Thank-you in advance for documenting this as I think it will be useful. The file is attached:
I moved the USSR BP in Sian to Chengtu and then change it's ownership from USSR to Chinese.

Image
Attachments
SianBPChengtu.jpg
SianBPChengtu.jpg (1.57 MiB) Viewed 886 times
Ronnie
User avatar
rkr1958
Posts: 29638
Joined: Thu May 21, 2009 10:23 am

RE: A Layman's Guide to Successfully Editing the MWiF Game File.

Post by rkr1958 »

The first thing I did was locate the BP and the way I did that was by location. The Soviet BP was located in Sian [76,137]. I converted these coordinates to the encoded coordinate value (i.e., 76 x 512 + 137 = 39049) and searched for that value in the 8th position of the Unit Status Record (USR).

The definition of this BP occupies lines 34418 - 34423 of the game file. The first line for this counter, of any counter, is [Country ID],[Unit Type Code],[Year]. USSR country id is 51 and China is 53. The unit type code for a BP is 70. Country ids can be found on pages 199-202 and unit type codes on pages 204-205 of vol 2 of the MWiF players manual.

To move the BP to Chentgu [81,131] all one needs to do is change the encoded location of the USR from 39049 to 41603 (i.e., 81 x 512 + 131 = 41603).

Changing the nationality of the BP from Soviet to Chinese is a bit more difficult than one might think. For example, changing the country id from 51 to 53 won't do it! While the BP will be moved it will still be Soviet.

Now what to do to make it Chinese?

Image
Attachments
SianBPGF.jpg
SianBPGF.jpg (74.25 KiB) Viewed 886 times
Ronnie
User avatar
rkr1958
Posts: 29638
Joined: Thu May 21, 2009 10:23 am

RE: A Layman's Guide to Successfully Editing the MWiF Game File.

Post by rkr1958 »

I keep a library of various counters, including a Chinese BP. I copied the Chinese BP (in this example lines 2 - 7) and pasted those lines over the Soviet BP in the game file (lines 34418 - 34423). I also changed the encoded location of the copied lines to Chengtu (i.e, 41603).

Image
Attachments
BPLibrary.jpg
BPLibrary.jpg (31.01 KiB) Viewed 886 times
Ronnie
User avatar
rkr1958
Posts: 29638
Joined: Thu May 21, 2009 10:23 am

RE: A Layman's Guide to Successfully Editing the MWiF Game File.

Post by rkr1958 »

Below is the output of ExamDiff, which shows the changes. That is, (all) the differences between the before and after edited game files.

Image
Attachments
SiantoCh..fference.jpg
SiantoCh..fference.jpg (125.87 KiB) Viewed 886 times
Ronnie
User avatar
craigbear
Posts: 769
Joined: Tue Jan 21, 2020 2:30 am
Location: Calgary, Alberta

RE: A Layman's Guide to Successfully Editing the MWiF Game File.

Post by craigbear »

Thank-you. That will be very useful. I will be altering our game file when received.
User avatar
craigbear
Posts: 769
Joined: Tue Jan 21, 2020 2:30 am
Location: Calgary, Alberta

RE: A Layman's Guide to Successfully Editing the MWiF Game File.

Post by craigbear »

Does anyone have the entries for Free French BP and Oil Points.

Can I just paste them without replacing any BP or Oil, but by simply pasting them into the file (with adjustments for location)? Or is there a particular order all of the entries must be in?

This is due to some sort of bug with the Free French that has arisen in my game. They were Vichified and all territories became Vichy... France was completely conquered. However, when the Axis collapsed Vichy, the Free French were able to select a new home country, in this case Senegal. However, this seems to have led to oddities... both the CW and US have traded build points to the French, but it cannot seem to accept them... no path is always the indication in the production chart. Similarly, Oil is not able to arrive from the USA. I assure you that there is more than enough CPs to guarantee delivery. I have done these trades before in previous games and never had such trouble, this despite putting numerous resources on idle to guarantee a route with more than enough capacity. Another oddity is that the CW oil cannot be used by France despite cooperation. Hence, I want the US to send some via Allied (CS/FF) convoys.
User avatar
rkr1958
Posts: 29638
Joined: Thu May 21, 2009 10:23 am

RE: A Layman's Guide to Successfully Editing the MWiF Game File.

Post by rkr1958 »

ORIGINAL: craigbear

Does anyone have the entries for Free French BP and Oil Points.
I pretty sure I've got a Free French BP "lying around somewhere". Will post once I dig it up. Don't believe I have an oil point but will look and see what I can do.
ORIGINAL: craigbear
Can I just paste them without replacing any BP or Oil, but by simply pasting them into the file (with adjustments for location)? Or is there a particular order all of the entries must be in?
That I don't know. But would be worth finding out. Definitely back up your original file before trying.
Ronnie
User avatar
craigbear
Posts: 769
Joined: Tue Jan 21, 2020 2:30 am
Location: Calgary, Alberta

Re: A Layman's Guide to Successfully Editing the MWiF Game File.

Post by craigbear »

Thank-you... much appreciated if you could.
User avatar
craigbear
Posts: 769
Joined: Tue Jan 21, 2020 2:30 am
Location: Calgary, Alberta

Re: A Layman's Guide to Successfully Editing the MWiF Game File.

Post by craigbear »

I managed to find some FF oil and BP units in another game. I hope I have made not errors... someone might find them useful.

Code: Select all

Free French Oil (1)

,80,69,1936
1
148,3898,,0,-1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0

10263,10309,0,0,1023,65535,0,51206,0,0,0,256,0,0,0,0
-1,UndoData


Free French BP  (3)

,80,70,1936
3
148,3994,,0,-1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0

10263,10310,0,0,1023,65535,0,51206,0,0,0,768,0,0,0,0
-1,UndoData
 
User avatar
rkr1958
Posts: 29638
Joined: Thu May 21, 2009 10:23 am

Re: A Layman's Guide to Successfully Editing the MWiF Game File.

Post by rkr1958 »

Craig,

Below is the entry for a Free French BP in Dakar, Senegal.

,80,70,1936
1
11,3955,,0,-1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0

10263,10310,0,0,1023,65535,0,51206,0,0,0,256,0,0,0,0
-1,UndoData

FYI. See you already found both. I'm going to do a little experimenting and see what happens when I insert (i.e., add in) an oil point and BP counter. Will post what I find.
Ronnie
User avatar
rkr1958
Posts: 29638
Joined: Thu May 21, 2009 10:23 am

Re: A Layman's Guide to Successfully Editing the MWiF Game File.

Post by rkr1958 »

My experiment: (1) Add (i.e., insert) a Free French oil (1) at Dakar, Senegal & (2) Add (insert) a German BP at Prague.

Result: (Apparently) Successful.

Method:
(1) IMPORTANT. The number of counters currently in the game is on the line just above the first counter included in the game file. This count MUST be updated to include the number of counters added/deleted, in this case 2 added. If not (i.e., count inconsistent with number of counters in the game file), MWIF will hang when trying to load the game file.
(2) Insert counter(s), taking great care to insert all the lines that define the counter(s) and making sure not to accidentally insert any blank line(s) or delete/overwrite line(s) of any other counter(s). In my experiment, (a) I inserted the Free French Oil counter directly under a Free French BP counter already in the game at Dakar and (b) inserted the German BP counter directly under a German BP counter already in the game at Berlin.
(3) Change the encoded hex location to the desired location. In my experiment, [100,6]=51206 for Dakar and [54,40]=27688 for Prague. Recall, encoded hex location = 512 x row + col.
(4) As always, backup your original file before attempting any edits, especially one as complicated/dangerous as this one is.
Attachments
adding-Oil-BP.jpg
adding-Oil-BP.jpg (1.33 MiB) Viewed 963 times
Last edited by rkr1958 on Sat Feb 26, 2022 6:04 pm, edited 1 time in total.
Ronnie
User avatar
craigbear
Posts: 769
Joined: Tue Jan 21, 2020 2:30 am
Location: Calgary, Alberta

Re: A Layman's Guide to Successfully Editing the MWiF Game File.

Post by craigbear »

Very useful information.
User avatar
craigbear
Posts: 769
Joined: Tue Jan 21, 2020 2:30 am
Location: Calgary, Alberta

Re: A Layman's Guide to Successfully Editing the MWiF Game File.

Post by craigbear »

Sorry to impose again. I need to create a Japanese BP to fix a bug with MWIF resource transportation (nothing new here)... unfortunately, I do not have a listing for a saved Japanese Build Point. I anyone could kindly provide me with one, it would be much appreciated.
User avatar
rkr1958
Posts: 29638
Joined: Thu May 21, 2009 10:23 am

Re: A Layman's Guide to Successfully Editing the MWiF Game File.

Post by rkr1958 »

craigbear wrote: Sun Apr 03, 2022 7:12 pm Sorry to impose again. I need to create a Japanese BP to fix a bug with MWIF resource transportation (nothing new here)... unfortunately, I do not have a listing for a saved Japanese Build Point. I anyone could kindly provide me with one, it would be much appreciated.
I have one but am away from my computer. Give me an hour or two and will post a Japanese BP when I get back.
Ronnie
User avatar
rkr1958
Posts: 29638
Joined: Thu May 21, 2009 10:23 am

Re: A Layman's Guide to Successfully Editing the MWiF Game File.

Post by rkr1958 »

rkr1958 wrote: Mon Apr 04, 2022 3:22 pm
craigbear wrote: Sun Apr 03, 2022 7:12 pm Sorry to impose again. I need to create a Japanese BP to fix a bug with MWIF resource transportation (nothing new here)... unfortunately, I do not have a listing for a saved Japanese Build Point. I anyone could kindly provide me with one, it would be much appreciated.
I have one but am away from my computer. Give me an hour or two and will post a Japanese BP when I get back.
Below is the code for 1 Japanese BP in Tokoyo.

Code: Select all

,49,70,1936
2
0,4929,,0,-1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0

6295,6342,0,0,1023,65535,0,38056,0,0,0,256,0,0,0,0
-1,UndoData
Ronnie
Post Reply

Return to “Mods and Scenarios”