Matrix Games Forums

Forums  Register  Login  Photo Gallery  Member List  Search  Calendars  FAQ 

My Profile  Inbox  Address Book  My Subscription  My Forums  Log Out

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

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
  Printable Version
All Forums >> [New Releases from Matrix Games] >> World in Flames >> Mods and Scenarios >> A Layman's Guide to Successfully Editing the MWiF Game File. Page: [1] 2 3 4 5   next >   >>
Login
Message << Older Topic   Newer Topic >>
A Layman's Guide to Successfully Editing the MWiF Game ... - 8/20/2016 11:15:15 PM   
rkr1958


Posts: 23483
Joined: 5/21/2009
Status: offline
A Layman's Guide to "Successfully" Editing the MWiF Game File

Well, that's my hope and the reason I started this thread. Through necessity I've learned a few things, and I do mean a few, about how to edit the MWiF game file. In some instances these edits were required to continue my game. In others, when playing solo, I had forgotten to move units in an entire theater. Instead of having to revert back to an earlier game save and redo a bunch of moves just to be able to move the units I forgot to move, I made a series of edits to my game file that did this.

Now, I will at this point caution anyone who plans to edit their game file to back it up before editing. Speaking from experience I have fouled up a game file so badly that it was unplayable and I had to revert back to the saved version. With that caution in place I hope to build a comprehensive guide of safe edits that includes how to move units around, how to change their status and eventually how to "manually" setup production and convoy routes. MWiF is a fantastic game, and with that said, how production is handled in MWiF is by far the most frustrating and sometimes infuriating part of the game. My goal is to be able through editing the file to get my convoy routes and production setup the way I want them setup.

I hope to achieve all this through sharing of knowledge in this, and possibly other threads. To get things started I will now share with you the few things I've figured out by editing the MWiF game file.




Attachment (1)

_____________________________

Ronnie
Post #: 1
RE: A Layman's Guide to Successfully Editing the MWiF G... - 8/20/2016 11:17:11 PM   
rkr1958


Posts: 23483
Joined: 5/21/2009
Status: offline
The MWiF Game File.

MWiF game files are comma delimited text files that can be opened and edited with any text editor. I happen to prefer Notepad. MWiF game files end in the extension .GAM.




Attachment (1)

_____________________________

Ronnie

(in reply to rkr1958)
Post #: 2
RE: A Layman's Guide to Successfully Editing the MWiF G... - 8/20/2016 11:21:10 PM   
rkr1958


Posts: 23483
Joined: 5/21/2009
Status: offline
Saving MWiF Edited Game Files in Notepad.

In Notepad there's a right way and a wrong way of saving your edited game file. If you save without putting the filename in double quotes then Notepad will append a .txt to the end of the filename. For example, MyGame.GAM would be saved as MyGame.GAM.txt. This is an issue for MWiF. The only game files that it will open have to end .GAM. So the correct way to save MyGame in notepad is "MyGame.GAM" which prevents .txt from being appended and allows MWiF to open the file.




Attachment (1)

_____________________________

Ronnie

(in reply to rkr1958)
Post #: 3
RE: A Layman's Guide to Successfully Editing the MWiF G... - 8/20/2016 11:23:58 PM   
rkr1958


Posts: 23483
Joined: 5/21/2009
Status: offline
MWiF Version Number.

The MWiF version number is on the first line of the game file. In order to revert back to an earlier version of MWiF this number must be change to that version or earlier. For example if my game file was saved with version 2.2.7 and I wished to reverted back to 2.2.5, then I'd have to change that number to 2.2.5 or earlier in order for that version to open the file.




Attachment (1)

_____________________________

Ronnie

(in reply to rkr1958)
Post #: 4
RE: A Layman's Guide to Successfully Editing the MWiF G... - 8/20/2016 11:35:42 PM   
rkr1958


Posts: 23483
Joined: 5/21/2009
Status: offline
Now lets edit a game file to move a unit and then disorganize it. Say for whatever reason I forgot to move my French NAV at Oran to the 3-box of the West Med during the naval air phase. I can do that using the following edits.

First, let me tell you what I know about how unit locations are stored in the game file. A unit's location is defined by a [x,y] coordinate pair. For example, Oran's coordinate pair is [74,23] and the 3-box of the West Med is [70,31]. MWiF uses the equation 512x + y to encode a [x,y] coordinate pair into a single value. For example, Oran's encoded coordinate value is 37911 and the allied 3-box of the West Med is 35871.

I've also noticed that factory and resource [x,y] locations are stored in two values in reverse order (i.e., y,x) within a relevant MWiF data record.

Now back to moving and disorganizing the French NAV.




Attachment (1)

< Message edited by rkr1958 -- 8/21/2016 4:57:13 PM >


_____________________________

Ronnie

(in reply to rkr1958)
Post #: 5
RE: A Layman's Guide to Successfully Editing the MWiF G... - 8/20/2016 11:45:25 PM   
rkr1958


Posts: 23483
Joined: 5/21/2009
Status: offline
Based on my understanding, all information on the French NAV, or any other land, air or naval unit, is stored in 6 data records which I've outlined in dark blue. The units encoded location is the 8th field in the 4th record that I'm calling the Unit Status Record (USR). I will refer to a given field of that record, say f, as USR(f). For example USR(8), which is equal to 37911, is the encoded location of that unit.

I've also figured out that USR(4) is the unit id, USR(5) is the unit status (e.g., not disorganized, disorganized), and USR(13) is movement status. I don't know all values of even these few fields but I have successfully modified them. For example, in one of my solo games I encountered a bug that units placed on the map at the beginning of the turn couldn't be moved on the 1st impulse even though they were in supply and organized. This didn't happen often but it did happen on a few units at a very critical time in the game. I had to figure out what and how to reset in ordered to allow them to move. I figured out that by setting USR(13) to 224 that I could move the units as I should have been able to.




Attachment (1)

< Message edited by rkr1958 -- 8/21/2016 5:01:24 PM >


_____________________________

Ronnie

(in reply to rkr1958)
Post #: 6
RE: A Layman's Guide to Successfully Editing the MWiF G... - 8/20/2016 11:46:07 PM   
rkr1958


Posts: 23483
Joined: 5/21/2009
Status: offline
French Nav successfully moved from Oran to West Med, allied sea box 3.




Attachment (1)

_____________________________

Ronnie

(in reply to rkr1958)
Post #: 7
RE: A Layman's Guide to Successfully Editing the MWiF G... - 8/20/2016 11:49:56 PM   
rkr1958


Posts: 23483
Joined: 5/21/2009
Status: offline
French Nav "successfully" disorganized.

I would think the ability to do this would be a "must" for those of you who've been clamoring for the yet to be coded optional rule, "Isolated Reorganization Limits (RAW Option 47, Section 13.5).




Attachment (1)

< Message edited by rkr1958 -- 8/21/2016 5:01:48 PM >


_____________________________

Ronnie

(in reply to rkr1958)
Post #: 8
RE: A Layman's Guide to Successfully Editing the MWiF G... - 8/21/2016 1:35:04 AM   
Courtenay


Posts: 4003
Joined: 11/12/2008
Status: offline
Thank you.

For those to whom it is not obvious, disorganized is the 12 bit -- i.e. add 4096 to the current value to disorganize a unit and leave everything else the same. (Or, to organize, subtract 4096.)

_____________________________

I thought I knew how to play this game....

(in reply to rkr1958)
Post #: 9
RE: A Layman's Guide to Successfully Editing the MWiF G... - 8/21/2016 4:54:27 PM   
rkr1958


Posts: 23483
Joined: 5/21/2009
Status: offline

quote:

ORIGINAL: Courtenay

Thank you.

For those to whom it is not obvious, disorganized is the 12 bit -- i.e. add 4096 to the current value to disorganize a unit and leave everything else the same. (Or, to organize, subtract 4096.)
Wow, didn't see that! Thanks.

So, USR(5) = 1023 is "normal status". So it's adding 4096 to this value that changes it from organized to disorganized. Now what I need to figure out are what other values (if any) are there for USR(5) and what do they represent.




_____________________________

Ronnie

(in reply to Courtenay)
Post #: 10
RE: A Layman's Guide to Successfully Editing the MWiF G... - 10/25/2016 10:34:09 PM   
rkr1958


Posts: 23483
Joined: 5/21/2009
Status: offline
...




Attachment (1)

_____________________________

Ronnie

(in reply to rkr1958)
Post #: 11
RE: A Layman's Guide to Successfully Editing the MWiF G... - 10/25/2016 10:34:44 PM   
rkr1958


Posts: 23483
Joined: 5/21/2009
Status: offline
...




Attachment (1)

_____________________________

Ronnie

(in reply to rkr1958)
Post #: 12
RE: A Layman's Guide to Successfully Editing the MWiF G... - 10/25/2016 10:41:29 PM   
rkr1958


Posts: 23483
Joined: 5/21/2009
Status: offline
1. The encoded hex location of the BP, or any RP for that matter, is in the 8th column of the RP status record, or RPSR(8).

2. The value of the BP, or any RP, marker is encoded in the 12th column of that same record (i.e., RPSR(12)). The formula for the encodeing is, RPSP(12) = # BPs (or RPs) x 256.

3. The number of saved BPs by the French at Nantes (i.e., hex [56, 25], encoded hex 28697) is increased by 4 BPs by changing the value of RPSR(12) from 256 to 1024. That is, RPSR(12) = 4 BP's x 256 = 1024.




Attachment (1)

< Message edited by rkr1958 -- 10/25/2016 10:44:44 PM >


_____________________________

Ronnie

(in reply to rkr1958)
Post #: 13
RE: A Layman's Guide to Successfully Editing the MWiF G... - 10/25/2016 10:41:57 PM   
rkr1958


Posts: 23483
Joined: 5/21/2009
Status: offline
...




Attachment (1)

< Message edited by rkr1958 -- 10/25/2016 10:42:21 PM >


_____________________________

Ronnie

(in reply to rkr1958)
Post #: 14
RE: A Layman's Guide to Successfully Editing the MWiF G... - 10/26/2016 12:35:19 AM   
rkr1958


Posts: 23483
Joined: 5/21/2009
Status: offline
...




Attachment (1)

< Message edited by rkr1958 -- 10/26/2016 12:36:14 PM >


_____________________________

Ronnie

(in reply to rkr1958)
Post #: 15
RE: A Layman's Guide to Successfully Editing the MWiF G... - 10/26/2016 12:35:39 AM   
rkr1958


Posts: 23483
Joined: 5/21/2009
Status: offline
...




Attachment (1)

< Message edited by rkr1958 -- 10/26/2016 1:02:15 AM >


_____________________________

Ronnie

(in reply to rkr1958)
Post #: 16
RE: A Layman's Guide to Successfully Editing the MWiF G... - 10/26/2016 12:35:57 AM   
rkr1958


Posts: 23483
Joined: 5/21/2009
Status: offline
...




Attachment (1)

_____________________________

Ronnie

(in reply to rkr1958)
Post #: 17
RE: A Layman's Guide to Successfully Editing the MWiF G... - 10/26/2016 12:36:17 AM   
rkr1958


Posts: 23483
Joined: 5/21/2009
Status: offline
...




Attachment (1)

_____________________________

Ronnie

(in reply to rkr1958)
Post #: 18
RE: A Layman's Guide to Successfully Editing the MWiF G... - 10/26/2016 12:36:38 AM   
rkr1958


Posts: 23483
Joined: 5/21/2009
Status: offline
...




Attachment (1)

_____________________________

Ronnie

(in reply to rkr1958)
Post #: 19
RE: A Layman's Guide to Successfully Editing the MWiF G... - 10/26/2016 3:17:19 AM   
Shannon V. OKeets

 

Posts: 22095
Joined: 5/19/2005
From: Honolulu, Hawaii
Status: offline
At the extreme risk of encouraging this behavior (NOT RECOMMENDED), here is some more information.

----------

For All units in the game:

// ****************************************************************************
// Data0
(*
Bits Mask Data
0-6 $0000007F Type (128 possible unit types).
7-14 $00007F80 Country (254 countries).
15-20 $001F8000 Year (-1890).
21 $00200000 Not built at start (air & naval units only).
22 $00400000 Small (land units only).
23-30 $7F800000 Source country (254 countries).
31 $80000000 No adjacent ZOC (land units only).
*)
// ****************************************************************************
UnitTypeMask = $0000007F;
UnitTypeShift = 0;
CountryMask = $00007F80;
CountryShift = 7;
YearMask = $001F8000;
YearShift = 15;
NotBuiltMask = $00200000;
NotBuiltShift = 21;
SmallMask = $00400000;
SmallShift = 22;
SourceCountryMask = $7F800000;
SourceCountryShift = 23;
NoAdjacentZOCMask = $80000000;
NoAdjacentZOCShift = 31;
// ****************************************************************************
// Data1
(*
Bits Mask Data
0-12 $00001FFF Unit ID # (13 bits = 8192).
13-16 $0001E000 TransType (4 bits).
17-25 $03FE0000 Unused (9 bits).
26-31 $FC000000 Fort hexsides (land units only) (6 bits).
*)
// ****************************************************************************
UnitIDReadMask = $00001FFF; // Unit's ID # read from CSV file (13 bits).
UnitIDReadShift = 0;
TransTypeMask = $0001E000; // TransType (4 bits). Used to be $03FFE000.
TransTypeShift = 13;
FortHexsidesMask = $FC000000; // (6 bits).
FortHexsidesShift = 26;
// ****************************************************************************
// Data2
(*
Bits Mask Data // Unit IDs of transported units.
0-12 $00001FFF Trans1 (13 bits).
13-25 $03FFE000 Trans2 (13 bits).
26 $04000000 Picked.
27 $08000000 Sentry.
28 $10000000 Disorganized.
29 $20000000 Disorganized at reorganization start.
30 $40000000 Out of supply.
31 $80000000 Isolated.
*)
// ****************************************************************************
Trans1Mask = $00001FFF;
Trans1Shift = 0;
Trans2Mask = $03FFE000;
Trans2Shift = 13;
PickedMask = $04000000;
PickedShift = 26;
SentryMask = $08000000;
SentryShift = 27;
DisorganizedMask = $10000000;
DisorganizedShift = 28;
DisorganizedAtReorgStartMask = $20000000;
DisorganizedAtReorgStartShift = 29;
OutOfSupplyMask = $40000000;
OutOfSupplyShift = 30;
IsolatedMask = $80000000;
IsolatedShift = 31;
// ****************************************************************************
// Data3
(*
Bits Mask Data
0-8 $000001FF Column (9 bits = 512).
9-16 $0001FE00 Row (8 bits = 256).
17-23 $00FE0000 Sea area (7 bits = 128).
24-26 $07000000 Section (3 bits = 8).
27-31 $F8000000 On/Off map location (5 bits = 32).
*)
// ****************************************************************************
ColumnMask = $000001FF;
ColumnShift = 0;
RowMask = $0001FE00;
RowShift = 9;
SeaAreaMaskUnits = $00FE0000;
SeaAreaShiftUnits = 17;
SectionMask = $07000000;
SectionShift = 24;
UnitPlaceMask = $F8000000;
UnitPlaceShift = 27;
// ****************************************************************************
// Data4
(*
Bits Mask Data
0-6 $0000007F Parent carrier sea area (air units only).
7-9 $00000380 Parent carrier section (air units only).
10 $00000400 Unused.
11 $00000800 Permananent factory (factory units only).
12 $00001000 Invading (land units only).
13 $00002000 Sea invading (land units only).
14 $00004000 Paradropping (land units only).
15 $00008000 Offensive HQ.
16 $00010000 Primary supply source (land units only).
17 $00020000 Emergency supply.
18 $00040000 Emergency supply HQ (land units only).
19 $00080000 Combat engineer (land units only).
20 $00100000 Flying extended (air units only).
21 $00200000 Night mission (air units only).
22 $00400000 Supply checked.
23 $00800000 Selectable.
24 $01000000 Selectable cleared.
25 $02000000 ActiveUnit.
26 $04000000 Overrunning (land units only).
27-30 $78000000 Offensive points used (land units only).
31 $80000000 HQ moved off rail (land units only).
*)
// ****************************************************************************
ParentCarrierSeaAreaMask = $0000007F;
ParentCarrierSeaAreaShift = 0;
ParentCarrierSectionMask = $00000380;
ParentCarrierSectionShift = 7;
PermanentMask = $00000800;
PermanentShift = 11;
InvadingMask = $00001000;
InvadingShift = 12;
SeaInvadingMask = $00002000;
SeaInvadingShift = 13;
ParadroppingMask = $00004000;
ParadroppingShift = 14;
OffensiveHQMask = $00008000;
OffensiveHQShift = 15;
PrimarySupplySourceMask = $00010000;
PrimarySupplySourceShift = 16;
EmergencySupplyMask = $00020000;
EmergencySupplyShift = 17;
EmergencySupplyHQMask = $00040000;
EmergencySupplyHQShift = 18;
CombatEngineerMask = $00080000;
CombatEngineerShift = 19;
FlyingExtendedMask = $00100000;
FlyingExtendedShift = 20;
NightMissionMask = $00200000;
NightMissionShift = 21;
SupplyCheckedMask = $00400000;
SupplyCheckedShift = 22;
SelectableMask = $00800000;
SelectableShift = 23;
SelectableClearedMask = $01000000;
SelectableClearedShift = 24;
ActiveUnitMask = $02000000;
ActiveUnitShift = 25;
OverrunningMask = $04000000;
OverrunningShift = 26;
OffensivePtsMask = $78000000;
OffensivePtsShift = 27;
HQMovedOffRailMask = $80000000;
HQMovedOffRailShift = 31;
// ****************************************************************************
// Data5
(*
Bits Mask Data
0-6 $0000007F Invasion sea area (land units only) (7 bits = 128).
7 $00000080 Synth oil lost (synth oil units only).
8-15 $0000FF00 Points: oil resources/build points only (8 bits = 256).
16-20 $000F0000 Year the unit arrives as a reinforcement.
21-22 $00600000 Role (air units only).
23 $00800000 AA fired (land units only).
24 $01000000 Aborted this combat.
25 $02000000 Aborting.
26 $04000000 Bombarding (land units only).
27 $08000000 Landing.
28 $10000000 Doubled (land units only).
29 $20000000 Forced abort.
30 $40000000 Force extended range (air units only).
31 $80000000 Unit initiating an Interception (air/naval units only).
*)
// ****************************************************************************
InvasionSeaAreaMask = $0000007F;
InvasionSeaAreaShift = 0;
SynthOilLostMask = $00000080;
SynthOilLostShift = 7;
PointsMask = $0000FF00;
PointsShift = 8;
YearArrivesMask = $001F0000;
YearArrivesShift = 16;
RoleMask = $00600000;
RoleShift = 21;
AAFiredMask = $00800000;
AAFiredShift = 23;
AbortedThisCombatMask = $01000000;
AbortedThisCombatShift = 24;
AbortingMask = $02000000;
AbortingShift = 25;
BombardingMask = $04000000;
BombardingShift = 26;
LandingMask = $08000000;
LandingShift = 27;
DoubledMask = $10000000;
DoubledShift = 28;
ForcedAbortMask = $20000000;
ForcedAbortShift = 29;
ForceExtendedMask = $40000000;
ForceExtendedShift = 30;
InterceptionMask = $80000000;
InterceptionShift = 31;
// ****************************************************************************
// Data6
(*
Bits Mask Data
0 $00000001 Returning to base (air/naval units only).
1 $00000002 Staying at sea (air/naval units only).
2-8 $000001FC Range used (air/naval units only) (7 bits = 128).
9-16 $0001FE00 Working8Bits (8 bits).
17 $00020000 US naval combat.
18-20 $001C0000 Movement points used (3 bits = 8).
21-24 $01E00000 Setup status: 0 = not being setup (4 bits = 16).
25-30 $EE000000 Setup group index (6 bits = 64).
31 $80000000 Built this turn.
*)
// ****************************************************************************
ReturningToBaseMask = $00000001;
ReturningToBaseShift = 0;
StayingAtSeaMask = $00000002;
StayingAtSeaShift = 1;
RangeUsedMask = $000001FC;
RangeUsedShift = 2;
Working8BitsMask = $0001FE00; // (8 bits = 256).
Working8BitsShift = 9; // Working8Bits.
ReorgTagMask = $3F; // Used in combination with Working8Bits.
USNavalCombatMask = $00020000;
USNavalCombatShift = 17;
MPUsedMask = $001C0000;
MPUsedShift = 18;
SetupStatusMask = $01E00000; // Step in setup process (4 bits = 16).
SetupStatusShift = 21;
SetupGroupIndexMask = $7E000000; // Setup Location Group Index (6 bits = 64).
SetupGroupIndexShift = 25;
BuiltThisTurnMask = $80000000;
BuiltThisTurnShift = 31;
// ****************************************************************************
// Data7
(*
Bits Mask Data
0 $00000001 Whether unit's bitmap image was loaded (air and naval only).
1-5 $0000003E Bitmap page (31 possible - 22 used).
6-12 $00001FC0 Bitmap cell within page (127 possible - 100 used).
13-21 $003FE000 From column (512 possible - 360 used).
22-29 $3FC00000 From row (256 possible - 195 used).
30 $40000000 Moved in impulse.
31 $80000000 Moved in turn.
*)
BitmapLoadedMask = $00000001; // Whether the unit's bitmap has been loaded.
BitmapLoadedShift = 0;
BitmapPageMask = $0000003E;
BitmapPageShift = 1;
BitmapCellMask = $00001FC0;
BitmapCellShift = 6;
FromColumnMask = $003FE000; // Hex unit started from. Used for returning
FromColumnShift = 13; // air units back to the hex from which they
FromRowMask = $3FC00000; // started, and artillery units back to the hex
FromRowShift = 22; // from which they bombarded.
MovedInImpulseMask = $40000000;
MovedInImpulseShift = 30;
MovedInTurnMask = $80000000;
MovedInTurnShift = 31;

// ****************************************************************************
// TTransType is used to record the linkages between units that are transporting
// other units, transported by other units, or have recently unloaded from
// another unit.
// trtyIng1 - Self is currently transporting 1 other unit.
// trtyIng2 - Self is currently transporting 2 other units.
// trtyIng1U - Self is currently transporting 1 other unit, but it had been
// transporting a second. Self is a non-carrier naval unit.
// trtyBy1 - Self is currently transported by 1 other unit.
// trtyBy2 - Self is currently transported by 2 air transports.
// trtyByR - Self is currently transported by a carrier & rebased from a
// different carrier in the current pAirRebase phase.
// trtyUnloaded1 - Self (a naval unit) unloaded 1 unit after moving.
// trtyUnloaded2 - Self (a naval unit) unloaded 2 units after moving.
// trtyNormalUnload - Self unloaded from a naval transport that returned to
// port or Self unloaded from an air transport that was
// aborted in the pParadrop or pAirTransport phases.
// trtyFromUnload - Self (a land unit) unloaded from a naval transport in the
// current pUnloadLandUnits phase.
// trtyFromInv - Self (a land unit) unloaded from a naval transport in the
// current or immediately previous pInvasion phase.
// trtyFromAirRebase - Self (an air unit) unloaded from a naval transport or
// carrier in the current pAirRebase phase.
// trtyFromCarrier - Self is a carrier air unit flying either an air mission or
// is engaged in a naval air combat.
//
// o In all the above cases the other units are TransLink[1] and TransLink[2].
// o In the trtyBy2 case, TransLink[1] and TransLink[2] both have a TransType of
// trtyIng1, even though they each are only carrying half of the transported
// unit.
// o In the trtyFrom and trtyNormalUnload cases, the TransLink[1] value is used
// to undo the move.
// o In the trtyFromInv case, the TransLink[1] value is used to determine from
// which the sea area section box the unit is invading.
// o In the trtyFromCarrier, the TransLink[1] value is used when the player
// wants the carrier air unit to return to the carrier from which it started
// the mission.
// ****************************************************************************


For Land units (only):


(*
TLandUnit data storage.

LandData0:
Bits Mask Data
0-3 $0000000F Combat.
4-6 $00000070 Movement.
7-9 $00000380 Reorganization.

A:
10 $00000400 Elite.
11 $00000800 Heavy.
OR B:
10-11 $00000C00 Anti-tank type.

12-14 $00007000 Reserve type.

A:
15-23 $00FF8000 City column.
24-31 $FF000000 City row.
OR B:
15-22 $00FF0000 War country.
23-31 $FF000000 Unused.

CombatMask = $0000000F;
CombatShift = 0;
MoveMask = $00000070;
MoveShift = 4;
ReorgMask = $00000380;
ReorgShift = 7;
EliteMask = $00000400;
EliteShift = 10;
HeavyMask = $00000800;
HeavyShift = 11;
AntiTankMask = $00000C00;
AntiTankShift = 10;
ReserveMask = $00007000;
ReserveShift = 12;
ReserveCountryMask = $00FF0000;
ReserveCountryShift = 16;
CityColumnMask = $00FF8000;
CityColumnShift = 15;
CityRowMask = $FF000000;
CityRowShift = 24;

*)

For Naval Units only:

(*
NavalData0
Bits Mask Data
0-3 $0000000F Attack
4-7 $000000F0 Defense
8-11 $00000F00 Anti-air
12-15 $0000F000 Air class/bombardment/air capacity.
16-19 $000F0000 Supply
20 $00100000 Supply active
21-24 $01E00000 Movement
25-28 $1E000000 Range
29-31 $E0000000 Cost (2nd cycle)
*)
AttackMask = $0000000F;
AttackShift = 0;
DefenseMask = $000000F0;
DefenseShift = 4;
AntiAirMask = $00000F00;
AntiAirShift = 8;
BombardmentMask = $0000F000;
BombardmentShift = 12;
SupplyMask = $000F0000;
SupplyShift = 16;
SupplyActiveMask = $00100000;
SupplyActiveShift = 20;
MoveMask = $01E00000;
MoveShift = 21;
RangeMask = $1E000000;
RangeShift = 25;
Cost2Mask = $E0000000;
Cost2Shift = 29;
(*
NavalData1
Bits Mask Data
0-7 $000000FF Convoy points.
8-10 $00000700 New construction time.
11-16 $0001F800 Year sunk (-1890).
17-20 $001E0000 Month sunk.
21-25 $03E00000 Day sunk.
26 $04000000 Replacement. True means this unit is a replacement unit.
27 $08000000 Override default construction time.
28 $10000000 In 1st cycle/changed location.
29 $20000000 Damaged.
30-31 $C0000000 Naval move number.
*)
ConvoyMask = $000000FF;
ConvoyShift = 0;
TimeMask = $00000700;
TimeShift = 8;
SunkYearMask = $0001F800;
SunkYearShift = 11;
SunkMonthMask = $001E0000;
SunkMonthShift = 17;
SunkDayMask = $03E00000;
SunkDayShift = 21;
ReplacementMask = $04000000;
ReplacementShift = 26;
OverrideTimeMask = $08000000;
OverrideTimeShift = 27;
FirstCycleMask = $10000000;
FirstCycleShift = 28;
DamagedMask = $20000000;
DamagedShift = 29;
NavalMoveNumberMask = $C0000000;
NavalMoveNumberShift = 30;


For Air units only:

(*
AirData0:
Bits Mask Data
0-3 $0000000F Tactical 0 - 15
4-8 $000001F0 Strategic 0 - 31
9-14 $00007E00 Range 0 - 63
15 $00008000 Extended capability binary
16 $00010000 Flying boat binary
17-18 $00060000 Flying bomb type 0 - 3
19 $00080000 No interception binary
20 $00100000 No attack binary
21 $00200000 Parent carrier moved Not used
22-24 $01C00000 Class/movement 0 - 7
25-27 $0E000000 Air transport 0 - 7
28 $10000000 Tank buster binary
29 $20000000 Night capability binary
30-31 $C0000000 Class change count 0 - 3

AirData1:
Bits Mask Data
0-5 $0000003F Class year 2 (-1890) 0 - 63
6-8 $000001C0 Class 2 0 - 7
9-14 $00007E00 Class year 3 (-1890) 0 - 63
15-17 $00038000 Class 3 0 - 7
18-20 $001C0000 Cost 0 - 7
21-24 $01E00000 Air-air 0 - 15
25-28 $1E000000 Air-sea 0 - 15
29 $20000000 Pilot binary
30 $40000000 Twin engine binary
31 $80000000 Can carry Okha binary
*)
const
TacticalMask = $0000000F;
TacticalShift = 0;
StrategicMask = $000001F0;
StrategicShift = 4;
RangeMask = $00007E00;
RangeShift = 9;
ExtendedMask = $00008000;
ExtendedShift = 15;
FlyingBoatMask = $00010000;
FlyingBoatShift = 16;
FlyingBombMask = $00060000;
FlyingBombShift = 17;
NoInterceptMask = $00080000;
NoInterceptShift = 19;
NoAttackMask = $00100000;
NoAttackShift = 20;
ClassMoveMask = $01C00000; // Both movement points and starting carrier
ClassMoveShift = 22; // class are stored here.
AirTransportMask = $0E000000;
AirTransportShift = 25;
TankBusterMask = $10000000;
TankBusterShift = 28;
NightMask = $20000000;
NightShift = 29;
ClassChangesMask = $C0000000;
ClassChangesShift = 30;
ClassYear2Mask = $00000003F;
ClassYear2Shift = 0;
ClassClass2Mask = $000001C0;
ClassClass2Shift = 6;
ClassYear3Mask = $00007E00;
ClassYear3Shift = 9;
ClassClass3Mask = $00038000;
ClassClass3Shift = 15;
BaseCostMask = $001C0000;
BaseCostShift = 18;
AirAirMask = $01E00000;
AirAirShift = 21;
AirSeaMask = $1E000000;
AirSeaShift = 25;
PilotMask = $20000000;
PilotShift = 29;
TwinEngineMask = $40000000;
TwinEngineShift = 30;
OhkaMask = $80000000;
OhkaShift = 31;





_____________________________

Steve

Perfection is an elusive goal.

(in reply to rkr1958)
Post #: 20
RE: A Layman's Guide to Successfully Editing the MWiF G... - 10/26/2016 4:08:59 AM   
rkr1958


Posts: 23483
Joined: 5/21/2009
Status: offline
Wow, Steve thanks! I promise I'll only use this information for good.

_____________________________

Ronnie

(in reply to Shannon V. OKeets)
Post #: 21
RE: A Layman's Guide to Successfully Editing the MWiF G... - 10/26/2016 4:14:56 AM   
paulderynck


Posts: 8201
Joined: 3/24/2007
From: Canada
Status: offline
quote:

ORIGINAL: rkr1958

Saving MWiF Edited Game Files in Notepad.

In Notepad there's a right way and a wrong way of saving your edited game file. If you save without putting the filename in double quotes then Notepad will append a .txt to the end of the filename. For example, MyGame.GAM would be saved as MyGame.GAM.txt. This is an issue for MWiF. The only game files that it will open have to end .GAM. So the correct way to save MyGame in notepad is "MyGame.GAM" which prevents .txt from being appended and allows MWiF to open the file.


A quick note here. If you find the game file you want to edit using File Explorer, you can right click on it and use "Open With" and select Notepad to open it. Once finished editing, you can then just save the file and the correct extension of "GAM" will be neither altered nor have anything appended to it.

AAMOF as long as the extension "GAM" is not registered to another application (FREX Cyberboard registers that extension), your PC should remember the above and will show all your "GAM" files with a Notepad icon thereafter.

< Message edited by paulderynck -- 10/26/2016 4:17:23 AM >


_____________________________

Paul

(in reply to rkr1958)
Post #: 22
RE: A Layman's Guide to Successfully Editing the MWiF G... - 10/26/2016 4:26:51 AM   
paulderynck


Posts: 8201
Joined: 3/24/2007
From: Canada
Status: offline
This thread really ought to be a sticky up at the top of the list!

_____________________________

Paul

(in reply to paulderynck)
Post #: 23
RE: A Layman's Guide to Successfully Editing the MWiF G... - 11/22/2016 11:59:53 PM   
rkr1958


Posts: 23483
Joined: 5/21/2009
Status: offline
Here's my next installment of safely editing the MWiF game file.




Attachment (1)

_____________________________

Ronnie

(in reply to paulderynck)
Post #: 24
RE: A Layman's Guide to Successfully Editing the MWiF G... - 11/23/2016 12:00:14 AM   
rkr1958


Posts: 23483
Joined: 5/21/2009
Status: offline
...




Attachment (1)

< Message edited by rkr1958 -- 11/23/2016 12:04:17 AM >


_____________________________

Ronnie

(in reply to rkr1958)
Post #: 25
RE: A Layman's Guide to Successfully Editing the MWiF G... - 11/23/2016 12:00:41 AM   
rkr1958


Posts: 23483
Joined: 5/21/2009
Status: offline
...




Attachment (1)

< Message edited by rkr1958 -- 11/23/2016 12:03:51 AM >


_____________________________

Ronnie

(in reply to rkr1958)
Post #: 26
RE: A Layman's Guide to Successfully Editing the MWiF G... - 11/23/2016 12:01:13 AM   
rkr1958


Posts: 23483
Joined: 5/21/2009
Status: offline
...




Attachment (1)

< Message edited by rkr1958 -- 11/23/2016 12:05:10 AM >


_____________________________

Ronnie

(in reply to rkr1958)
Post #: 27
RE: A Layman's Guide to Successfully Editing the MWiF G... - 11/23/2016 12:05:45 AM   
rkr1958


Posts: 23483
Joined: 5/21/2009
Status: offline
...




Attachment (1)

_____________________________

Ronnie

(in reply to rkr1958)
Post #: 28
RE: A Layman's Guide to Successfully Editing the MWiF G... - 11/23/2016 12:06:03 AM   
rkr1958


Posts: 23483
Joined: 5/21/2009
Status: offline
...




Attachment (1)

_____________________________

Ronnie

(in reply to rkr1958)
Post #: 29
RE: A Layman's Guide to Successfully Editing the MWiF G... - 11/23/2016 12:06:25 AM   
rkr1958


Posts: 23483
Joined: 5/21/2009
Status: offline
...




Attachment (1)

_____________________________

Ronnie

(in reply to rkr1958)
Post #: 30
Page:   [1] 2 3 4 5   next >   >>
All Forums >> [New Releases from Matrix Games] >> World in Flames >> Mods and Scenarios >> A Layman's Guide to Successfully Editing the MWiF Game File. Page: [1] 2 3 4 5   next >   >>
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts


Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI

1.625