MGPCkpt; MGPRS2 cockpit image extraction and replacement utility v1.0c ---------------------------------------------------------------------- Foreword ======== F1RS used to have a cockpit editor, F1RSCkpt, made by Grant Reeve, while datafiles were being decrypted by Martin Granberg's F1Crypt.dll. This new MGPCkpt editor is just the same program, except I had to break Ubisoft's new encryption and make some other small changes. That's why most of the rest of this text file is also a copy of the one supplied with F1RSCkpt. Although Ubisoft supplied a bitmap replacer with the game, I've left in this feature in MGPCkpt as it allows for easy processing from the command line. Note that due to resizing of the cockpit for different resolutions the coordinates of the instruments can be slightly incorrect when designed for one resolution and viewed with another. Rene Smit Feb 10, 1999 ====================================================================== This program is Freeware. Use at your own risk. The author does not accept any responsibility for anything that may happen to your system. Synopsis ======== You can now move around the positions of all the dashboard instrumentation. MGPCkpt will create two files when you extract a cockpit - a .bmp file containing the 24bit image, and a .cp (short for CockPit) file which is just a text file that contains the coordinate locations of each of the dashboard instruments. You can edit this file to match your new cockpit .bmp file, and when MGPCkpt goes to replace the cockpit it will refer to this file and install the new instrument locations. See the section further on regarding more details about this. I recommend that people who are distributing new cockpits should include their matching .cp file, even cockpits that still have the original dashboard instrument arrangement. IMPORTANT: Please make sure you have backed up the Datab\Voitures\cock.b (location of the cockpit images) and Datab\Scripts\forgrnd.rsb (contains the dashboard coords) before you go and mangle them with my program! Just in case, you can always just copy it back off the CD. Usage ===== To extract cockpits: -------------------- (parameters in [square brackets] are optional) MGPCkpt e number/all [filename] e: Command that means "extract" number/all: Cockpit number to extract (0-10 or "all") This is a required argument. This tells MGPCkpt which cockpit to extract. Numbers 0 to 10 correspond to which cockpit you want to extract. See the table at the bottom of this document to see which numbers correspond to which teams. If you use the word "all" instead, MGPCkpt will dump out all 11 cockpits in one go. If no [filename] is specified, MGPCkpt will by default output the cockpits as files called "cockXX.bmp" and "cockXX.cp" where the XX is the cockpit number, such as "cock00.bmp" & "cock00.cp", "cock04.bmp" & "cock04.cp", "cock10.bmp" & "cock10.cp". filename: Filename to save output files as. This is an optional argument. This isn't really the whole filename. MGPCkpt will automatically attach "XX.bmp" and "XX.cp" to the end of this filename parameter, so in effect this parameter is just the start of the final .bmp and .cp files' names. If you don't specify this parameter MGPCkpt will use a default value of "cock", thus producing the "cock04.bmp" and "cock04.cp" type of filenames. If you specify, for example, a value of "frog" then MGPCkpt will output files named "frog09.bmp" and "frog09.cp". If you put a ".bmp" on the end of the filename parameter, MGPCkpt will strip that off before using it. ie: if you used "frog.bmp" as the filename parameter, then MGPCkpt will remove the .bmp part and will end up with "frog" and the results will be just like my previous example. To replace cockpits: -------------------- MGPCkpt r number/all [filename] r: Command that means "replace" number/all: Cockpit number to extract (0-10 or "all") This is a required argument. This tells MGPCkpt which cockpit image to replace. Numbers 0 to 10 correspond to which cockpit you want to replace. See the table at the bottom of this document to see which numbers correspond to which teams. If you use the word "all" instead, MGPCkpt will try to replace all 11 cockpits in one go. It will expect to find the files filename00.bmp and filename00.cp through to filename10.bmp and filename10.cp in the current dir, but it's OK if some are not there - MGPCkpt will replace just the cockpits it can find, and leave any missing ones as they were. This is handy if you are just replacing a selected number of cockpits at once. You can install a cockpit .bmp without a matching .cp file, but the image had better match the instrument coordinates that were already in the game or the dashboard will not look so good. If no [filename] is specified, MGPCkpt will by default try to load the images as files called "cockXX.bmp" and "cockXX.cp". filename: Filename of cockpit files to load This is an optional argument. This isn't really the whole filename, although it can be. If you are replacing just one single cockpit, MGPCkpt will not attach "XX.bmp" and "XX.bmp" to the rest of the filename like it usually does - this is the one situation where it will only attach to the filename ".bmp" and "cp". This allows you to load any filename at all into MGPRS2. So if for example you want used "MGPCkpt r 4 mclaren" it would work fine loading the files "mclaren.bmp" and "mclaren.cp", it will not try to load files called "mclaren04.bmp" and "mclaren04.cp". However if you don't specify this filename while replacing a single cockpit, MGPCkpt will still look for "cockXX.bmp" and "cockXX.cp" by default, where XX is the number of the cockpit you are replacing. If you are replacing all images, MGPCkpt will automatically attach "XX.bmp" and "XX.cp" to the end of this filename parameter. If you put a ".bmp" on the end of the filename parameter, MGPCkpt will strip that off before using it. Guide to the .CP file format ============================ When you open up a .cp file with your favourite text editor, you will see many lines. Each line is formatted like this: key = x , y where the key is the name of one of the dashboard components, and the x,y values are its location. MGPRS actually stores the x,y values as full screen coordinates, offset from the bottom left of the screen (-ve), but for ease of use I save the y coordinates to the .cp file as offset from the top left of the cockpit image itself, so the x,y values in this file match the x,y values of your cockpit .bmp file. The order of the lines does not matter. You can have spaces in between the parts of a line, but not before the keyname, in case you want to format the file all very nicely. The way each component is located is not consistant. Some are specified by the lower left corner of their screen area, some are specified by the lower right corner. Here's a table for each dashboard component. It gives the reference point of each, bl = bottom-left, br = bottom-right. And a brief description of what it is. key reference point description gear bl What gear the car is in. idealgear bl Suggested gear for current corner. speed br Speed. (Duh, did I need to say that?) speedunit bl The little "KM/H" text. revcounter br Current RPM. revunit bl The "RPM" text. revcoef bl The "x100" text. fuel br Amount of fuel left. fuelunit bl The "L" text. revfuel br Fuel user per lap. revfuelunit bl The "L/T" text. radio bl For messages from the pit. pitled bl To indicate that you are pitting. revled1 bl First RPM light. revled2 bl Second RPM light. revled3 bl Third RPM light. revled4 bl Fourth RPM light. damage bl The car damage panel. [Rene: compared to F1RS I've changed the damage panel reference point from top-left to bottom-left.] Reference: number to F1 team table ================================== number team 0 Arrows 1 Williams 2 Ferrari 3 Benetton 4 McLaren 5 Jordan 6 Prost 7 Sauber 8 Tyrrell 9 Minardi 10 Stewart History ======= V1.0 11-Feb-1999 Ported from F1RSCkpt Credits ======= As explained at the top of this file, all credits go to Grant Reeve regarding this editor. Thanks to Martin Granberg and John Bogle for help with the data file decryption/encryption. Last but not least, thanks to Rick Devente for lots of support and testing, and to all others who supported me. Contact info ============ Rene Smit More utilities and latest versions can be found at: http://www.xs4all.nl/~rsdi/