Creating New MechWarrior Pilots for MechCommander Gold

18
Creating New MechWarrior Pilots for MechCommander Gold By CMunsta Once again, I present a preliminary document from my research for part 4 of the MechCommander Gold Campaign Builder's Guide. As the title implies, this will be on creating custom MechWarriors. As before, this document is considered an early release of information. That is, I want to get the info out there as quickly as possible, but the real tutorial guide will take some time to finish up. This does mean that some info in here may not be as clear as it should. I'm also not going to delve as deeply into the task as I'm likely going to in the full guide. Mostly because pilots have video and audio files and it would take an eternity to delve into all those aspects, not to mention the development of another tool to package the audio together. Instead, I'll use existing video and audio as the source, this way we can make our pilots, and when the tools and document actually get done, it'll be a simple matter to replace these files. *** WARNING! *** One of the files we need to edit affects the entire game. Therefore, edit this file with caution. Don't come crying to me if the game locks up after messing with this file. As with my other preliminary document, if I say to put a file in a given folder and that folder doesn't exist, create the folder. For this tutorial I'm going to create a completely new MechWarrior pilot that we will then be able to hire and use in-game. Doing so will require some fancy image manipulation though so I'll be taking a little side trip into using GIMP. I'm using GIMP in this tutorial because it is both quite powerful, and completely free (you can get it from www.gimp.org ). In the process, I'll be creating a template image that will have a special palette that can be used for creating the icons we'll need. Well, no time like the present.

Transcript of Creating New MechWarrior Pilots for MechCommander Gold

Page 1: Creating New MechWarrior Pilots for MechCommander Gold

Creating New MechWarrior Pilots for MechCommander Gold

By CMunsta

Once again, I present a preliminary document from my research for part 4 of the MechCommander Gold Campaign Builder's Guide. As the title implies, this will be on creating custom MechWarriors.

As before, this document is considered an early release of information. That is, I want to get the info out there as quickly as possible, but the real tutorial guide will take some time to finish up. This does mean that some info in here may not be as clear as it should.

I'm also not going to delve as deeply into the task as I'm likely going to in the full guide. Mostly because pilots have video and audio files and it would take an eternity to delve into all those aspects, not to mention the development of another tool to package the audio together. Instead, I'll use existing video and audio as the source, this way we can make our pilots, and when the tools and document actually get done, it'll be a simple matter to replace these files.

*** WARNING! ***

One of the files we need to edit affects the entire game. Therefore, edit this file with caution. Don't come crying to me if the game locks up after messing with this file.

As with my other preliminary document, if I say to put a file in a given folder and that folder doesn't exist, create the folder.

For this tutorial I'm going to create a completely new MechWarrior pilot that we will then be able to hire and use in-game. Doing so will require some fancy image manipulation though so I'll be taking a little side trip into using GIMP. I'm using GIMP in this tutorial because it is both quite powerful, and completely free (you can get it from www.gimp.org). In the process, I'll be creating a template image that will have a special palette that can be used for creating the icons we'll need.

Well, no time like the present.

Page 2: Creating New MechWarrior Pilots for MechCommander Gold

Step 1

The first thing we'll need to do is to define our MechWarrior. We do this by creating a custom warrior profile. We will however also need to give it a new ID number. Having a look through the MISSION.FST file we find that there are 324 warrior profiles already created. The first 323 range in IDs from 1 to 459, and the last has ID 1000. We could of course simply use one of the values in those ranges that isn't defined by the game, but why bother?

I'll be giving my MechWarrior the ID 2000. It's well outside the range of what is defined already, and yet well inside the 5 digit ID that profile files have.

Now to make our profile, we can simply modify one of the existing ones. And since we want this to be player usable profile, we'll start with one that already is. Let's grab Beast's profile. His ID is 51, so extract PMW00051.FIT from MISSION.FST and put it in your data\missions\warriors folder. Rename it to PMW02000.FIT so that it now has our new ID in the name, and open it in a text editor.

Decide on a name for this Warrior. I'm calling mine “Jeffrey”. Change the Name and Callsign entries to the new name. I did this:

st Name = "Jeffrey"st Callsign = "JEFFREY"

We also want to change the ID entry to 2000, since this is the ID for this warrior.

We can ignore the Rank entry since it gets re-calculated by the game when the skills change. So changing the skills will his rank, regardless of what you put here. So having said this, let's go change the skills. The maximum value for the skill entries is 80, and the minimum is 32 (halfway is then 56). You can use higher or lower values, but they render oddly in game and I don't know what effect it will have on the use of these values, so stick with values from 32 to 80. Now I've decided that Jeffrey here is going to be “Uber, Uber Leet” and so I'm putting 80 across the board here.

Now we have a few decisions to make.

First, we are going to need a description for this pilot, but those are in DESC.FIT and so we'll need a description ID. Fortunately, this Warrior profile indicates what ID to actually use, so all we need is to find a safe description ID value to use. Looking through DESC.FIT we see that the highest ID number shown (at least that I saw) is 555. Let's add a little to that just to be safe, and use a nice round number like 600. With that decided, change the DescIndex entry in the warrior profile to 600.

We are also going to need a “NameIndex”. This is used by the game at the logistics screen to figure out what icon and nameplate to use when at the hiring screen etc. The game's pilots use name indexes from 0 to 29. So we could use 30 and up. To show that we don't have to go in sequence, I'm going to set my NameIndex to 50.

We are going to need a set of audio files, video files, and icons for this Warrior. The “pilotAudio” entry tells the game which PAK file to use for this pilot's audio files. We'll be re-using the audio from another pilot, but we'll be copying it to its own file. Since we can name it whatever we want, I'm calling mine “jefry”. This will make the game look for the file JEFRY.PAK when it want the audio. We'll deal with the audio itself later. For now, just set the pilotAudio entry to “jefry”.

Page 3: Creating New MechWarrior Pilots for MechCommander Gold

For the “pilotVideo” entry, this tells the game the prefix for the pilot videos to use for this pilot. There are in all only 3 pilot videos, and they will all start with this entry. Again I simply set my pilotVideo entry to “jefry”.

Lastly, we need to tell the game what icon to use when in-game. This icon is slightly different from the Logistics screen one (really just slightly thinner) I set my Picture entry to “PILOT50.TGA” because the “PILOT” is what the game will want to look for, and the 50 is the NameIndex as described above.

Here's a look at the whole file after changes (I deleted the comments):

FITini

[General]st Brain = "pbrain"st Name = "Jeffrey"l Rank = 0 st Callsign = "JEFFREY"ul ID = 2000 l NameIndex = 50 l DescIndex = 600 ul HeadIcon = 1000 l paintScheme = 68 st pilotAudio = "jefry"st pilotVideo = "jefry"st Picture = "PILOT50.TGA"

[PersonalityTraits]c Professionalism = 50 c Decorum = 50 c Aggressiveness = 50 c Courage = 50

[Skills] // 138 pts totalc Piloting = 80 c Jumping = 80c Sensors = 80c Gunnery = 80

[Affinities]c MechClass = 0 c MechType = 0 c WeaponClass = 0 uc[2] WeaponTypes = 0,0

[Status]c Wounds = 0

FITEnd

Save the file. It's time to add that pilot description.

Page 4: Creating New MechWarrior Pilots for MechCommander Gold

Step 2

This is an incredibly easy step. Just extract DESC.FIT from MISC.FST and place it in the data\objects folder (if you haven't already got one there that is).

Now open DESC.FIT in a text editor and go to the end of the file (well OK, we could also add the entry to where all the other pilot descriptions are, but I'm being lazy).

Since in the Warrior profile we said the DescIndex was 600, we need to add a [Desc600] section into this file. I added this:

[Desc600] // Jeffreyst DescString = "Jeffrey refuses to have a nickname given to him despite those around him.

Fortunately, he has the skills to back him up, so no-one pushes him too hard about it."

I split the text so that it shows up nicely here, but you get the idea. Don't make the text too long. In fact, this is getting close to the maximum length. Just look at other warrior descriptions to get a feel for what to write as a description, and for what the maximum length should be.

When done, save the file and move on to the next step.

Page 5: Creating New MechWarrior Pilots for MechCommander Gold

Step 3

Here we'll be dealing with the audio and video files. Now as mentioned at the start of the document, I won't be creating new audio or video, I'll leave that for the full blown guide. So instead we'll copy the files from one of the game's audio and video files.

For the audio, the WAV files are help in the PAK files found in the data\sound folder. All the PILOTxx.PAK files contain the audio for the pilots, and the CREWx.PAK files contain generic ones for the vehicle crews. You can use my PAKEXTRACT tool (get it from my site) to get at the files if you want, every file in there is a WAV file, so you can extract a few and listen to them. Note that some audio files are missing in the crew audio PAK files. Trying to extract that file will give you a 0 byte file. This is normal. The missing files tend to be the ones where a MechWarrior would say his callsign etc.

If I had a utility made to create PAK files, then we could record our own audio and package it up, but that will have to wait.

Anyway, since I want to use one of these audio PAK files for my warrior, and I'd rather he didn't go saying “This is the Beast” or “Lynx here”, I'm going to use one of the crew PAK files. Specifically, I'm going to copy CREWB.PAK.

So simply make a copy of CREWB.PAK and rename it to JEFRY.PAK. Remember that we set the audio PAK filename to “jefry” in the Warrior profile.

That takes care of the audio, now for the video files. As I said when making the warrior profile, the name we set in there was “jefry” and that it was going to be the prefix for the videos. Well this will be the prefix we'll use when we copy the files.

When I listened to the audio from CREWB.PAK, it seemed to me that it was voiced by the same guy that did Beast's voice. Therefore, I'm going to copy Beast's video files for my pilot. Go to the data\movies folder and find the the three files PILOT00A.SMK, PILOT00C.SMK and PILOT00D.SMK. These are Beast's videos. Copy each of these and rename the copies so that we have JEFRYA.SMK, JEFRYC.SMK and JEFRYD.SMK. The “A” version is used when the pilot sends a simple radio message, the “C” version is used when the pilot is under attack and the “D” version is when the pilot is ejecting. The JEFRY part of the name is of course, the prefix we set in the warrior profile.

That does it for this step. I know we are only re-using audio and video from the game, but we are creating new files for this pilot. So if we did have new audio and video, we could simply replace these files.

Page 6: Creating New MechWarrior Pilots for MechCommander Gold

Intermediate Step

Now we come to the point where we need to make icons and such. But before we do that, I want to sidetrack a little and setup a template file with an appropriate palette. In the process, we'll learn a little about using GIMP.

GIMP itself doesn't seem to allow for the saving, loading or remapping of an images palette directly. It does have palette functions, but they all use built-in palettes instead. I guess it is because GIMP's focus is to prepare images for the Web.

This means that we have to jump through a couple hoops to get a feature we want. Namely, remapping an image to a specific palette.

Now to top this off, there are actually two warrior icons, and they are used in different situations. Namely, one icon is for the hiring list in the logistics screen, and the other is used when the Warrior is assigned to a mech (both in game and at the deployment screen) and in the inventory. This means that the image needs to look right in two slightly different palettes.

To alleviate the problem, we are going to create a template image with a specially modified palette that will allow us to make our icons work in either mode.

So first thing we need is an image that will provide us with the palette we need to modify. Extract the file X_MFDTBN03.TGA from ART.FST. Put this in a work directory somewhere so we can work on it. Start GIMP and open the file we just extracted.

If the “Colormap” dialog isn't open, you can open it by selecting from the menu: Windows → Dockable Dialogs → Colormap.

Now we need to remove some of the colors so that they don't get selected because these colors can change dramatically from in-game to the logistics screen.

Page 7: Creating New MechWarrior Pilots for MechCommander Gold

It won't be perfect, but it'll get us close. Which in the end, is good enough.

The game uses those magenta colors (the purple-y colors we see in the Colormap dialog) to mean transparent (though it does use colors there, just not for this image). So to remove colors in the colormap, we can replace them with one of these magenta ones. First let's copy one of these colors so we can easily select it later. Double-click any of the magenta colors to bring up the color selection dialog. Then hit the button with the right pointing arrow on it (circled in yellow in image) to add this color to the extra color boxes. Now press OK.

Now that this special color has been saved to the quick color picker, we can use it to fill the areas we want to remove from the colormap.

I won't bother describing the procedure I did for picking which colors to remove, it was more or less trial and error really. Instead I'll tell you what colors I chose to remove (and how to do it) and then you can later decide to try removing more or creating a different template.

Page 8: Creating New MechWarrior Pilots for MechCommander Gold

To remove a color, simply Double-click the color you want to remove in the colormap, and press the button in the color picker that now has our saved magenta color.

Note that the colormap dialog has a “Color Index” box. You can select a color by its number here, and the highlight will show you which color that is. This way, I'll simply tell you which color indices I removed, and you can easily find them.

Basically, remove colors 99 – 107, 112 – 159, 181 – 191, and 214 – 223. The end result will look like this:

Save the image as “Color_Template.TGA”. Put it in the work folder so we know where to find it again.

Now when we need to create an icon, we can load up this template image, rescale it to the size we need, and then we paste the real image into this one and save the final result as the finished image. The pasting operation will remap the other image's colors to that used by this template image, which happens to have our modified palette.

With this done, the next step will be a little easier to deal with.

Page 9: Creating New MechWarrior Pilots for MechCommander Gold

Step 4

Now to actually make the icons. As I mentioned I the intermediate step, there are actually two icons. One is used in the list of warriors available for hire, the other is used when a warrior is assigned to a mech, and inside the game.

First up is the icon for the hiring list. The icons in here are 30x30. The filename for this icon will be PILOTxx.TGA where xx is the NameIndex we set in the warrior profile. Since we set it to 50, this means our icon will be called PILOT50.TGA. So copy that color template file we just finished making and call this copy PILOT50.TGA.

Open PILOT50.TGA in GIMP and resize the image so that it is 30 pixels by 30 pixels. To do this, select from the menu: Image → Scale Image. Set the width and height to 30 (make sure the little chain to the right of the edit boxes is broken or else GIMP will attempt to keep the aspect ratio or the image and mess you up.

Leave this image open for now, and open another image that we will use for the actual picture. For this example I'm using that avatar picture of me I'm using on the Mechcommander.org forums.

Load your image up and using the selection tool, select an area around the face. Get fairly close on the top and bottom, but leave a little room on the left and right. If your image is small enough to begin with, you can make the selection box exactly 30 x 30. If not, make the selection box square, so that the dimensions of the selection box are the same in width and in height.

If the box isn't exactly where you want it, don't fear. Clicking the center of the selection area will allow you to drag it around. If the area you are trying to grab is rather small, use the zoom tool to zoom in on the image for finer detail.

Page 10: Creating New MechWarrior Pilots for MechCommander Gold

Now hit Ctrl-C to copy this area into the clipboard (or if you prefer, select Edit → Copy from the menus).

Now that the clipboard has the area we want, we can create a new image from this by selecting File → Create → From Clipboard. Now that we have an new image that only has the area we want we can rescale this new image to 30x30 (if it isn't already).

When it is the correct size, select the entire image (hit Ctrl-A) then copy it (Hit Ctrl-C). Now go to our first paletted image (the PILOT50.TGA image) that we still have loaded and paste the clipboard into it. Click just off the image but still inside the window in order to anchor the pasting to the image. GIMP will remap the colors we are pasting in so that they fit this image's palette.

Here's a zoomed-in view of what I got:

Now before we can save this, we need to “flatten” the image. This is because our paste job has created an extra layer. Flattening the image means that it merges all the layers together to create a single image. To do this, right click the image in the “Layers” toolbox.

Page 11: Creating New MechWarrior Pilots for MechCommander Gold

This is what the layer toolbox should look like (well a small part of it anyway).

The highlighted area is what you want to right-click on. From this menu, select “Flatten Image” (it should be the last entry in the menu).

Now we can save the image. But as we want to make sure that the TGA is saved in a way that will make MCG happy, instead of simply saving, we select “Save As” from the file menu instead of save.

Don't change anything here (unless you really want to), just click the “Save” button. GIMP will then ask if you want to overwrite the image since it already exists. Select “Replace”.

GIMP will then come up with a new dialog box called “Save as TGA”. In here, you can select how the image should be saved. Make sure that the RLE is turned off (not checked) and that the image origin is set to “Top Left”.

Click “Save” and we are done with this icon. Copy the PILOT50.TGA image to the data\art\logart folder.

But we aren't done yet. We have another icon to make. Basically, it'll be much the same but its size will be 22x30 instead of 30x30. We'll use the small image we created when we first selected the area around the head (we can't use the PILOT50.TGA icon because the “create image from clipboard” feature will make it an RGB image and so we'll lose the palette.

Page 12: Creating New MechWarrior Pilots for MechCommander Gold

So on the small image, we select a 22x30 area, fit it properly so that the head fits nicely in the area (this is why we wanted a little extra space on the left and right when we did the first icon). Then copy this area.

With the desired area in the clipboard, select the PILOT50.TGA image again and from the menu, select Image → Duplicate. This will create another version of the icon that we can play with without worrying about overwriting PILOT50.TGA.

Now resize this duplicate icon to have a 22x30 size, paste the clipboard into it, flatten the image and save this version as PILOT50.TGA. Save it to the data\art folder. Make sure you don't overwrite the previous one. It would be easy to do since they are called by the same name, just in different directories.

Phew. Quite a bit of work, but that's image processing for ya.

Page 13: Creating New MechWarrior Pilots for MechCommander Gold

Step 5

Now we need to make a nameplate for this warrior. The nameplate is used in the logistics screen when it displays all the available pilots for hire. Now since this image is only used in the logistics screen, we won't have to worry about palettes the way we had to for the icons. But we will need to maintain a palette that can be used in the logistics screen.

The easiest way to do this is to simply use one of the standard nameplates in the game as our template. We'll once again call on Beast to provide the nameplate for this.

Extract the file LSPFLP00.TGA, rename it to LSPFLP50.TGA (we use 50 here because that was the NameIndex we used in the warrior profile) and copy it to data\art\logart.

Now open GIMP again (if you closed it that is) and load the file LSPFLP50.TGA.

We will use this version as the actual template, but we will want an RGB version to work on because it will allow us to do antialiasing and other good stuff. So from the menus, select Image → Duplicate to create a second copy of it, then on this copy select Image → Mode → RGB. This will set the mode to full RGB color editing for this image (don't do it to LSPFLP50.TGA though, we want that one left in indexed color mode).

On the duplicate image, expand the window and zoom in a bit so that you can see what you are doing. Now we'll be writing text on this bar once we get rid of Beast's name, but before we do that we should get a copy of the text color. So using the Color Picker tool, click on one of the brighter yellows in the image. This will make the current drawing color (the foreground color) to be identical to the color we just clicked on.

Now that we got the text color, use the selection tool to select a wide chunk of the image that doesn't have Beast's name on it and then copy it back onto this image. You may need to move it over so that Beast's name is completely gone.

Select the text tool and the click on the image. Now resize the box so that it is wide enough to see something. Don't worry if it isn't centered or text gets cut off, we'll adjust that in a bit. In the “GIMP Text Editor” dialog box, enter the name of this warrior (in my case it is JEFFREY). Use all caps for this as that is how it is in the game. You may need to resize the text box on the image again. No worries. Just resize it. Now in the text options (the bottom half of the toolbox should now show them), select a font and point size for the text. I use the Franklin Medium Condensed Italic font with a 14 point size (this is as close as I've come to something resembling the MCG font). Also select or de-select the hinting, antialiasing and force auto-hinter checkboxes as desired (I have all three checked).

Once that is selected, adjust the position and size of the text box so that the text appears correctly on the image.

Now we need to create some shadows for the text. I couldn't find an option to turn this on, so we are going to fake it by duplicating the text, and make the one “underneath” black and shifted to the right and down by a pixel or two.

Page 14: Creating New MechWarrior Pilots for MechCommander Gold

So to duplicate the text, highlight the text layer in the layers toolbox, right click it and select Duplicate Layer.

Now select the layer that is between the new text layer and the background, and in the text options, set the color to black. Now choose the “Move Tool” and in it's options, make sure the “Move the active layer” radial button is selected. Now drag the layer slightly to the right and down so that you get a nice shadow effect.

Once satisfied, right click on any layer in the “Layers” toolbox and select “Flatten Image”. Select the entire image (Ctrl-A) and then copy it (Ctrl-C).

Now go back to the original Indexed-color version of LSPFLP50.TGA and paste the clipboard into it (Ctrl-V). Flatten this image, and do the “Save As” trick to make sure the TGA gets saved correctly.

This is what I ended up with:

OK, all the bits we need are done. Time to go test him out.

Page 15: Creating New MechWarrior Pilots for MechCommander Gold

Step 6

OK. Once again, to test this out, we'll modify the default solo mission purchase file the editor uses. I won't bother mentioning how exactly to do that as it is described in the quicky document on making weapons. So go read that one if you need the gory details.

Basically, open ISSOLO.PUR from the \teditor folder and add the warrior to it (may also want to add him to the CLANSOLO.PUR file).

I added this:

[Warrior30]st Profile = "pmw02000"l Status =0

Pretty straightforward really.

Now go make a simple solo mission and try it out.

Page 16: Creating New MechWarrior Pilots for MechCommander Gold

The Results

Ooooo look. There he is... and in gory browns no less

Again, the font doesn't quite fit, but it is close enough. We may find a better one eventually. By the way, no, my name isn't Jeffrey. It was just the first name that went through my head at the time.

Page 17: Creating New MechWarrior Pilots for MechCommander Gold

About to deploy...

We can see both icons on this screen. The smaller one is the one next to the mech while the larger one is in the display at the bottom.

Page 18: Creating New MechWarrior Pilots for MechCommander Gold

Jeffrey in action...

Here we see the small icon in game. We can also see the mini-video playing in the TAC map. Hehehe... he even sort of looks like the icon :).

Well that's about it.

Happy Warrior Building...

-cmunsta