Hi all,
In this post, I would like to explain how to make campaign mods with MechVM. Many mods and levels have already been made for MW2. They modify various aspects of the game, but for improved immersion, it would be necessary to combine them into a campaign. This post will show you how to use MechVM for doing this. I hope it's not too complicated. If you run into problems, please let me know so that I can help. I very much would like to improve support for mods in MechVM. I may update this post in the future to add further information or clarify. Also, this tutorial assumes that you use the latest edition of MechVM.
Select one edition of MW2 to base your mod on. Mercenaries obvioulsy has the most mechs, but there are some favourites missing as well, like the Marauder, Warhammer, Rifleman, or Stone Rhino. The campagin file for Mercs uses contracts, whereas the other versions have a simple list of missions. The file defining the missions for Mercs in MechVM is campaigns\mercs-contracts.xml. Please let me know if you want to make a mod that uses a different contracts list.
Next, install the DOS edition you selected. This will produce the following entries in MechVm.cfg (here, for Mercs):
GameName MW2: Mercenaries (MechVM shell + DosBox)
StartMethod InternalShell
CampaignFile campaign-mercs.xml
SetShellVar GamePathInDosBox=mw2-merx
SetShellVar SimType=DosBox
SetShellVar SimExec=_mercsml.bat
SetShellVar MEKFileVersion=1
SetShellVar GamePath=P:\devel\MechVM-2020-03-01\games\mw2-merx
SetShellVar MEKdir=P:\devel\MechVM-2020-03-01\games\mw2-merx\mek
archive P:\devel\MechVM-2020-03-01\games\mw2-merx\database.mw2
archive P:\devel\MechVM-2020-03-01\games\mw2-merx\mw2.prj
We can just copy that section and modify it for our needs. The following entries should be modified:
GameName - defines the name that MechVM will use to show your mod
CampaignFile - this file resides in the campaigns subfolder. Copy one of the existing files and point this variable to that copy
CampaignFile actually defines the screens that your campaign will use. Take a good look at that file.
You may want to extract MW2 screens to modify them. Click "View File" and select database.mw2 or mw2.prj from the folder where MechVM installed MW2, then select images to view from the list of files shown. You can export images by using the context menu on that list. Then, modify any images as you like them to be in your favourite image editing software.
Next, we want the campaign file to use the newly produced screen. Open the campaign file you copied earlier in a text editor (I recommend Notepad++ on Windows). The campaign file describes the screens used by the shell (called "rooms"). It's an XML file. The background attribute in each room tag defines the background used for that room. For example, "1|0.EFA" tells MechVM to open 0.EFA from its first archive (database.mw2). Since your newly created screen background obviously isn't in database.mw2, we need to place the new file somewhere where MechVM can find it. Save the edited image in the campaigns subfolder of MechVM. The edited file needs to be in BMP format for now.
A room has text buttons and regions you may click. A text button will show a text at the specified coordinates. A region displays text only when the cursor is placed over the specified coordinates. Both text buttons and regions can take you to other rooms. You may have to adjust the coordinates for the buttons and regions in the new room. Whenever you click somewhere, MechVM will print the coordinates where you clicked to the console. You can use the coordinates printed there to adjust the regions given in that room.
The available missions and mechs are controlled by variables. Let me know when you are ready to dive into MechVM's variables, then I will add a tutorial on that as well.
MechVM campaign mods
Moderator: Skyfaller