Author Topic: Adding a Mechwarrior  (Read 3718 times)

0 Members and 1 Guest are viewing this topic.

Adding a Mechwarrior
While there is a guide on adding mechs, warrior brains and modifying purchase files, I cannot seem to find a guide on adding a new Mechwarrior to MCO. I have dug around the MCO files a bit but could not figure out how new Mechwarriors (such as those from MC1) were added. Much thanks for an answer.

 

Offline Karl

  • 211
Re: Adding a Mechwarrior
Hi Autohummer,

I think it can be done easily with the new abl codes of recent releases.

I will have a crack and report back if you would like?

 
Re: Adding a Mechwarrior
I have looked a bit at the abl library (this is new to me) and the following concerns pilots:

Code: [Select]
25.
New ABL command - hirepilot(pilotFileName)
Effect: Add pilot to players roster; Example: hirepilot("pmwlynx");

26.
addnewpilot(MechID, "pilotFileName", "brainFileName");
MechID - part id for mover (getunitmates(squadID)) from squad ID.
pilotFileName - name of the pilot file (pmwlynx).
brainFileName - name of the brain file (pbrain, dredattack01,...)

Effect: Create new pilot from file and add to selected mech. It also sets the brain file.
If the pilot exists it will overwrite the pilot. DO NOT add pilots that are used in SP campaign before, it will erase
all accumulated experience. Use only to add new pilots. If the pilot is already on players roster, pilot icon will
not change. Must use script to remove mover from player then add it back after calling this command eg.:
   addnewpilot(Commando, "pmwgator", "pbrain");
   addmovertoplayer(Commando, 0, 2); //remove commando from player roster and add to allied team
   addmovertoplayer(Commando, 0, 0); //add commando to player roster

27.
(the same as addnewpilot but can be used for players units only - sets pilot icon correctly)
addnewpilottoplayer(MechID, "pilotFileName", "brainFileName");
MechID - part id for mover (getunitmates(squadID)) from squad ID.
pilotFileName - name of the pilot file (pmwlynx).
brainFileName - name of the brain file (pbrain, dredattack01,...)

Effect: Create new pilot from file and add to selected mech. It also sets the brain file.
If the pilot exists it will overwrite the pilot. DO NOT add pilots that are used in SP campaign before, it will erase
all accumulated experience. Use only to add new pilots. Allied team must exist in mission and must have at least one unit.

These functions handles adding a pilot existing in the game files to a mech or add it to an existing campaign. What I would like to do is to create a new pilot from scratch and add it to the game.

I have looked at the pmwlynx.fit file for Lynx (IIRC the PMW files are for singleplayer and the PMP files are for multiplayer) in the data/missions/warriors folder. It is directly editable with notepad++ and I think I can use it as a base to make my own new pilot. However, there are a few parameters that I don't understand or am unsure of:

Code: [Select]
[General]
st Brain = "pbrain"
st Name =                                                  "Lynx"
l Rank =                                                    1  <--- I suppose 0=Rookie 1=Regular 2=Veteran 3=Elite 4=Ace?
st Callsign =                                              "LYNX"
ul ID =                                                     228   <--- I suppose this has to be an unique ID? How do I know what numbers have been taken?
l NameIndex =                                               29   <--- I think this links to another file somewhere but I don't know which
l DescIndex =     42028 42003   <---  Same as above, but does pilot descriptions even show up in MC2/MCO?
ul HeadIcon =                                               0  <--- Seems to be 0 no matter what
l paintScheme =                                             31  <--- Seems to be 31 no matter what, but does this imply individual pilots can be given a custom paint scheme?
st pilotAudio =                                            "Lynx"   <--- Please help: I found Lynx.pak in the data/sound folder but I have absolutely no idea how to open this file
st pilotVideo =                                            "Lynx"   <--- I found Lynx1.bik-Lynx4.bik in the data/movies folder and it seems only MCG pilots have them, MC2 pilots who does not have movies uses "PILOT29" instead
l PictureIndex = 28   <--- I think this is the portrait for the pilot. The portraits are stored in the pilots_med, pilots_L2 and pilots_high.tga files in the data/art folder and Lynx's portrait is at the 29th if counted from left to right, top to bottom, implying that the "first" portrait has a PictureIndex of 0. However, for MCG pilots, they have another MCL_PR_(callsign).TGA files that has a bigger portrait and for Lynx's case, his description.


[PersonalityTraits]    <--- These four parameters are 50 for everyone. Do they actually do anything?
c Professionalism =                                         50
c Decorum =                                                 50
c Aggressiveness =                                          50
c Courage =                                                 50

[Skills]
c Piloting =                                               50
c Sensors =                                                50
c Gunnery =                                                55
c Jumping =                                                45

[Weapons] <--- What do these parameters do? MCG pilots have them but not the MC2 ones. Are they optional?
l Balistic_miss = 98
l Balistic_hit = 98
l Energy_miss = 242
l Energy_hit = 216
l Missile_miss = 0
l Missile_hit = 0
l lightMech_specialist = 2
l mediumMech_specialist = 1
l heavyMech_specialist = 1
l assaultMech_specialist = 0

[SpecialtySkills]
c LightMechSpecialist= 0
c MediumMechSpecialist= 0
c LaserSpecialist= 0
c LightACSpecialist= 0
c MediumACSpecialist= 0
c SRMSpecialist= 0
c SmallArmsSpecialist= 0
c ReconSpecialist= 0
c ToughnessSpecialist= 0
c HevayMechSpecialist= 0
c PulseLaserSpecialist= 0
c ERLaserSpecialist= 0
c LRMSpecialist= 0
c PPCSpecialist= 0
c Scout= 0
c LongJump= 0
c AssaultMechSpecialist= 0
c GaussSpecialist= 0
c HeavyACSpecialist= 0
c ShortRangeSpecialist= 0
c MediumRangeSpecialist= 0
c LongRangeSpecialist= 0
c Deadeye= 0
c SharpShooter = 0

[Awards]
c CampaignRibbon1 = 0
c CampaignRibbon1WithHonors = 0
c CampaignRibbon2 = 0
c CampaignRibbon2WithHonors = 0
c CampaignRibbon3 = 0
c CampaignRibbon3WithHonors = 0
c PurpleHeart = 0
c Valor = 0
c UncommonValor = 0

[Affinities]     <--- These parameters are 0 for everyone. Do they actually do anything?
c MechClass =                                               0
c MechType =                                                0
c WeaponClass =                                             0
uc[2] WeaponTypes =                                        0,0

[Status]
c Wounds =                                                  0


EDIT: Found this guide for MCG, don't know how relevant it is to MCO though the file structure look mostly similar http://www.nogutsnogalaxy.net/stuff/Files/Mechcommander/CMunsta/Creating%20Warriors%20for%20MCG.pdf

P.S. The biggest problem I am facing is that I don't know how to work with those audio .pak files. My search suggests I need something called xplist.exe but the links are down.

EDIT 2: Found this tool: http://www.nogutsnogalaxy.net/stuff/Files/Tools.rar from here: http://www.nogutsnogalaxy.net/forum/index.php?topic=694.msg12054#msg12054 and managed to extract a voice .pak into 40 .tmp files that can be directly edited with audacity.

EDIT 3: I am now stuck at another problem, I have no idea what the DescIndex links to in MCO. It is stopping the pilot callsign from showing up properly and the portrait from linking properly. Game crashes when it enters pilot hiring screen, citing my made-up DescIndex number.
« Last Edit: March 31, 2016, 05:27:36 am by Autohummer »

 
Re: Adding a Mechwarrior
The abl commands can be used to add a pilot to a mission by script. The pilot needs to exist in the game and that means it needs to have pictures, voices, a skilltable and several declarations inside the system files and the source code. The later can not be done by abl commands.

 
Re: Adding a Mechwarrior
The DescIndex links to the mc2rel.dll file in the omnitech main folder. I used a resource editor to open the .dll and fill in the necessary lines. The DescIndex can be made-up as long as it does not conflict with the numbers in the strings already present in the mc2rel.dll file. I entered my made-up DescIndex and filled out the name and the game now reads fine. Next order of business is to import the voice files and portrait I have already prepared beforehand.

EDIT: Mostly got it to work except the audio which I save for tomorrow. I would like to know if there is a set format for the audio files.
« Last Edit: March 31, 2016, 12:55:35 pm by Autohummer »

 

Offline Karl

  • 211
Re: Adding a Mechwarrior
How did you get on Autohummer? (Seems like you didnt need much help)

Possibly message ThorC, he helped magic with all the MC1 pilots

 

Offline magic

  • Moderator
  • 211
Re: Adding a Mechwarrior
I would like to know if there is a set format for the audio files.

Open one of the extracted files in any audio editor and you can see audio format.
After you make your own audio files pack them with the same tool in correct order and name it myPilot.pak.
Then open pmwMyPilot and add your pilot sound file name to the end of the correct line, replacing any other file name...

 
Re: Adding a Mechwarrior
Thanks for the help, everyone. I am still holding up on the audio side since the voices I have prepared beforehand don't seem to conform to the MC2 radio procedures very well, requiring some creative fiddling that I have yet to complete. I am using a placeholder for now and the rest worked out fine. I will report back once I have begun audio file importation. One thing that I would like to know is what situation each number of the 1-40 sequence refers to. So far I am figuring it out by listening to it, but is there a list somewhere that simply says voice# is for what situation? Also. I am getting .tmp files when I extract the .pak files, I can only trust Audacity knows what it is doing when I overwrite each file with my own audio and save it directly.

EDIT: I think I am in need of a pak-packer. The tool I have doesn't want to pack .pak files, only extract them.
« Last Edit: April 03, 2016, 04:02:17 pm by Autohummer »

 

Offline Karl

  • 211
Re: Adding a Mechwarrior
Re the pak creator, possibly check a MCG tool set?

Not confident on that but a suggestion

 
Re: Adding a Mechwarrior
I have found a pakmake.c from https://github.com/oseparovic/MCGExtract but I know nothing about compiling code. Apart from it I cannot find any kind of pak packing tool. It would be great if someone could put up a link for the pak packer they use on here.

 
Double posting here, I am still having trouble looking for a pak maker for MC2/MCG. Is there any alternative to make the game read files that are not put in a pak? Thanks in advance for any help.

 

Offline magic

  • Moderator
  • 211
Hey Autohummer,

any progress?

 
Sorry for the long leave, RL can be bad sometimes. I've just gotten the wavs packed and the 1st mission of Carver V starts normally, but then I got this error when I start moving my mechs, I suspect it's an issue with the format of the audio files. I made sure that I exported my wavs with Audacity in signed 16 bit, mono, 22050Hz (no idea how to set the bps) but still no luck. Any ideas?

This is the error I got:
Code: [Select]
STOP      : FAILED (0x80070057 - WINERR_The parameter is incorrect. ) - CreateSoundBuffer(0x2351730: DSBCAPS_CTRL3D | DSBCAPS_CTRLFREQUENCY | DSBCAPS_CTRLPAN | DSBCAPS_CTRLVOLUME | DSBCAPS_LOCSOFTWARE , (PCM 16-bit, 1 Channel, 22050Hz, 44100bps))


STOP      : FAILED (0x80070057 - WINERR_The parameter is incorrect. ) - CreateSoundBuffer(0x2351730: DSBCAPS_CTRL3D | DSBCAPS_CTRLFREQUENCY | DSBCAPS_CTRLPAN | DSBCAPS_CTRLVOLUME | DSBCAPS_LOCSOFTWARE , (PCM 16-bit, 1 Channel, 22050Hz, 44100bps))

Processor Registers EAX=0x00000000 EBX=0x00000000 ECX=0x00000000 EDX=0x00000000 Flags=0x00000000
=================== ESI=0x00000000 EDI=0x00000000 EBP=0x0018E3A8 ESP=0x0018DE58   EIP=0x00000000
EIP (0x00000000) ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ??
ESP (0x0018DE58) 0018DE98 80070057 02351730 046EDCF8 00000014 FFFFFFFE 76F500F8 76F4FDAF
                 00000001 0018E3B8 00000200 00000103 2C3D6008 00000100 000000F7 336F40E8
                 00010000 000002FA 30B9F008 4971AE44 00000000 0650B660 00000002 00000000

Machine details
===============
Executable name           : C:\Program Files (x86)\MechCommanderOmnitech\MCORel.exe
Executable time, date     : 20:12:30 Friday 10/30/2015
Command line              :
Current directory         : C:\Program Files (x86)\MechCommanderOmnitech
Current time, date        : 02:38:08 Sunday 3/26/2017
GameOS build version      : Version 1.1 11/2/2000
Software rasterizer       : c:\program files (x86)\mechcommanderomnitech\assets\binaries\blade.dll (Size 286,786 bytes)

I can force the game to continue, but it would crash with the following error:

Code: [Select]
EXCEPTION : Attempt to read from NULL in MCOREL! (+0x1FEF58)


EXCEPTION : Attempt to read from NULL in MCOREL! (+0x1FEF58)
Address   : 0x005FFF58
Location  : MCOREL! (+0x1FEF58)

Call Stack
==========
0x123C3B78                                 

Processor Registers EAX=0x00000000 EBX=0x00000000 ECX=0x0018E59C EDX=0x0018E594 Flags=0x00210202
=================== ESI=0x046EDC30 EDI=0x00000000 EBP=0x0018E598 ESP=0x0018E548   EIP=0x005FFF58
EIP (0x005FFF58) 8B 07 53 55 51 8B 4C 24 2C 52 8B 54 24 2C 51 8B 4C 24 2C 52 8B 50 2C 51 57 FF D2 8B F0 85 F6 7D
ESP (0x0018E548) 046EDCF8 046EDC30 046EDC88 00000000 005D1763 00000000 00000000 00000000
                 0018E5A4 0018E594 0018E59C 0018E598 00000000 0018E680 046EDC30 046EDC44
                 00000000 00000001 123C3B70 0018E5AC 00000000 123C3B78 00000000 00000000
ESI (0x046EDC30) 01 00 00 00 00 00 00 00 3A BF 16 1D 3A BF 16 1D 00 00 00 00 00 00 00 00 FF FF FF FF 00 00 00 00
                 A0 3C FD 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 FF FF FF FF 01 FF FF FF FF FF FF FF
ECX (0x0018E59C) 78 3B 3C 12 00 00 00 00 00 00 00 00 70 3B 3C 12 C0 E5 18 00 AD 14 47 76 00 00 35 02 00 00 00 00
EDX (0x0018E594) AC E5 18 00 00 00 00 00 78 3B 3C 12 00 00 00 00 00 00 00 00 70 3B 3C 12 C0 E5 18 00 AD 14 47 76

Machine details
===============
Executable name           : C:\Program Files (x86)\MechCommanderOmnitech\MCORel.exe
Executable time, date     : 20:12:30 Friday 10/30/2015
Command line              :
Current directory         : C:\Program Files (x86)\MechCommanderOmnitech
Current time, date        : 02:38:47 Sunday 3/26/2017
GameOS build version      : Version 1.1 11/2/2000
Software rasterizer       : c:\program files (x86)\mechcommanderomnitech\assets\binaries\blade.dll (Size 286,786 bytes)

 

Offline magic

  • Moderator
  • 211
Do you have any NULL sound packets in your pak file. You could have missed the spot.

Dont skip any (even if they are null in the originals) sound. 
Try this:

http://omnitech.hard-light.net/team/magic/Sounds/Pilot_transfer_from_MCG.rar

There is .BAT file prepared for making sound.pak.

 
I found out the hard and time-consuming way that one should never use completely empty sound files as a blank placeholder. Even a second of utter silence is good, but don't export files with precisely nothing in them.

EDIT: Ninja'd.

 

Offline magic

  • Moderator
  • 211
Or pack your pilot files and send me...

 
It's okay, I got it working now.

EDIT: I planned to add in Mechwarriors from the MW4 games but I couldn't find the voices, so I added my own OCs into the game, instead.

EDIT #2: After upgrading to the latest version of MCO, I keep getting this error when I finish a mission

Code: [Select]
EXCEPTION : Attempt to read from address 0x000000E0 in MCOREL! (+0x14C526)


EXCEPTION : Attempt to read from address 0x000000E0 in MCOREL! (+0x14C526)
Address   : 0x0054D526
Location  : MCOREL! (+0x14C526)

Call Stack
==========
0x004F25F1 MCOREL! (+0xF15F1)               
0x004EA71A MCOREL! (+0xE971A)               
0x00402D13 MCOREL! (+0x1D13)               
0x005C4F94 MCOREL! (+0x1C3F94)             

Processor Registers EAX=0x000000E0 EBX=0x000000E0 ECX=0x0C199A34 EDX=0x02020E09 Flags=0x00210202
=================== ESI=0x1AE60124 EDI=0x0C397EB0 EBP=0x0018E424 ESP=0x0018E424   EIP=0x0054D526
EIP (0x0054D526) 8B 00 83 78 08 00 75 10 8B 55 0C 33 C0 52 50 E8 26 F7 FF FF 5D C2 08 00 8B 55 0C 83 C0 0C 52 50
ESP (0x0018E424) 0018E510 004F25F1 000000E0 00000000 9CD101FF FFFFFFFF 02653D30 00000000
                 77903406 77903431 000011AE 000011B8 16F0FA38 02653D3C 0000117C 00000000
                 00000001 1292A908 00000078 00000000 12EA6C48 004AADDD 12EA6C48 00000000
EDI (0x0C397EB0) C0 7E 39 0C 00 00 00 00 54 99 19 0C 00 00 00 03 00 00 00 00 B0 7E 39 0C B0 9A 19 0C 00 00 00 00
                 00 00 00 00 00 00 00 00 98 86 FE 0F 00 00 00 00 00 00 00 00 D0 7E 39 0C 18 87 FE 0F 00 00 00 03
ESI (0x1AE60124) 24 C0 6A 00 02 00 00 00 05 00 00 00 03 08 00 00 13 00 00 00 2C 05 00 00 47 05 F5 43 B4 07 BE C3
                 A0 0C 89 43 9E 00 00 00 A1 00 00 00 85 14 00 00 37 00 30 00 00 00 00 FF 00 00 0C 42 69 3A 33 43
ECX (0x0C199A34) 90 28 E4 0D 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
EDX (0x02020E09) ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ??

Machine details
===============
Executable name           : C:\Program Files (x86)\MechCommanderOmnitech\MCORel.exe
Executable time, date     : 17:53:46 Tuesday 3/7/2017
Command line              :
Current directory         : C:\Program Files (x86)\MechCommanderOmnitech
Current time, date        : 22:50:11 Sunday 3/26/2017
GameOS build version      : Version 1.1 11/2/2000
Software rasterizer       : c:\program files (x86)\mechcommanderomnitech\assets\binaries\blade.dll (Size 286,786 bytes)
« Last Edit: March 26, 2017, 09:57:16 am by Autohummer »

 

Offline magic

  • Moderator
  • 211
Please send me your pilot files, I would like to test...

Have you added your pilot to pilots file?

 
Added the pilots to the pilots file and everything now works, thanks. Speaking of the pilot files, do you want just the fit files or the portraits/audio as well?

 

Offline magic

  • Moderator
  • 211
If it works, pack everything. I want to add your pilot(s) to MCO, with your permission?