Author Topic: Vehicles .blk Files - WTF?  (Read 3331 times)

OmniscientQ

  • Corporal
  • *
  • Posts: 60
    • MegaMek / BattleTech IRC Channel
Vehicles .blk Files - WTF?
« on: 17 February 2011, 21:15:45 »
So I've finally gotten around to building myself some custom vees. A sniping helicopter with C3i. Heavily armored SRM boats. A 15-ton chopper with no weapons but every scouting asset you could ever want.

I'm building more, but it's a pain to open up some of the canon .blk files and try to replace the various fields as necessary. What I'd really like is a blank template, or even just a guide, on the .blk format. Can anyone point me in the right direction?

I'd use MegaMekLab, but it doesn't do aircraft and it's still pretty twitchy. So far, it's been easier to build them by hand than with MML.
Q v2.0, Cluster Violet-6
End Transmission

Cyttorak

  • CamoSpecs
  • Sergeant
  • *
  • Posts: 161
  • CPLT-K2, now with more beef!
Re: Vehicles .blk Files - WTF?
« Reply #1 on: 18 February 2011, 12:39:53 »
I always modded all MML files by hand, like for pre-existing damage.
When I know I'm going to be doing multiple examples of the same base type, I'll just open the proper MML and erase all unit-specific items. Then I save the file under a name like "TDR Template Bare".

OmniscientQ

  • Corporal
  • *
  • Posts: 60
    • MegaMek / BattleTech IRC Channel
Re: Vehicles .blk Files - WTF?
« Reply #2 on: 18 February 2011, 20:04:32 »
Editing an existing .blk saves some time, I'll admit. Searching through all the established canon units for something close to what I want to build is annoying. What's needed is a list of all the valid code sections, and a list of acceptable items in each section. The equipment list that appears in the MegaMek "docs" directory is a good start, but I had to guess randomly until I figured out which number would set the <armortype> to Heavy Ferro-Fibrous. Same for XXL engines.
Q v2.0, Cluster Violet-6
End Transmission

BeeRockxs

  • BattleTech Volunteer
  • Warrant Officer
  • *
  • Posts: 459
Re: Vehicles .blk Files - WTF?
« Reply #3 on: 19 February 2011, 06:45:58 »
The first few lines are always the same:

#building block data file
<BlockVersion>
1
</BlockVersion>
#Write the version number just in case...
<Version>
MAM0
</Version>

The next few lines are pretty self explanatory:

<UnitType>
Tank
</UnitType>
<Name>
LRM Carrier
</Name>
<Model>
(3055)
</Model>
<Tonnage>
60
</Tonnage>
<cruiseMP>
2
</cruiseMP>
<Armor>
14
14
14
12
</Armor>

UnitType needs to be "VTOL" for VTOLs, "Tank" for normal vehicles,
"SupportTank" for Support Vehicles, "SupportVTOL" for Support VTOLs,
"LargeSupportTank" for large support vehicle.
Name, Model, Tonnage and cruise MP are self explanatory.
The armor values are each location's armor values, in this order:
For Tanks: Front, Left, Right, Rear, and if the unit has a Turret, Turret.
For VTOLs: Front, Left, Right, Rear, Rotor
For Large Support Tanks: Front, Front Right, Front Left, Rear Right, Rear Left,
Rear, and if the unit has a Turret, Turret.
Then you have an entry for each location that mounts equipment.

<Front Equipment>
ISLRM20
ISArtemisIV
ISLRM20
ISArtemisIV
ISLRM20
ISArtemisIV
</Front Equipment>
<Body Equipment>
ISLRM20 Ammo Artemis-capable
ISLRM20 Ammo Artemis-capable
ISLRM20 Ammo Artemis-capable
ISLRM20 Ammo Artemis-capable
ISLRM20 Ammo Artemis-capable
ISLRM20 Ammo Artemis-capable
ISC3SlaveUnit
</Body Equipment>

"<Front Equipment>" for equipment mounted in the front, "<Rear Equipment>" for
rear, "<Body Equipment>" for the body, etc.
For large support tank, the side ones become "Front Left Equipment" etc.
Then comes the <type> entry:

<type>
IS Level 2
</type>

The entry depends on the unit't techlevel, the following values are what needs
to be used:
"IS Level 1"
intro box set
"IS Level 2"
IS TW
"IS Level 3"
advanced tech
"IS Level 4"
experimental tech
"IS Level 5"
IS unofficial/old tech (you probably won't need this.
"Clan Level 2"
Clan TW
"Clan Level 3"
clan advanced
"Clan Level 4"
clan experimental
"Clan Level 5"
clan unofficial/old tech (you probably won't need this.

For mixed tech, these are used:
Mixed (IS Chassis)
Mixed (IS Chassis) Experimental
Mixed (IS Chassis) Unofficial
Mixed (Clan Chassis)
Mixed (Clan Chassis) Experimental
Mixed (Clan Chassis) Unofficial

next is the entry for the year this unit originated in:
<year>
3055
</year>

then we set the internal structure, armor and engine type:

<internal_type>
0
</internal_type>
<armor_type>
1
</armor_type>
<engine_type>
1
</engine_type>

For Internal Structure, 0 means standard, 1 means endo steel, 2 means endo-steel
prototype, 3 means reinforced, 4 means composite.
The armor values are 0 standard, 1 ferro-fib, 2 reactive, 3 reflective, 4
hardened, 5 light ferro, 6 heavy ferro, 8 stealth, 9 ferro-fib prototype, 10
commercial, 14 industrial, 15 heavy industrial (some of these might not apply
for tanks, but i'm not sure which right now)
For the engine types, the following codes apply:
Fusion: 0
ICE: 1
XL: 2
XXL: 3
LIGHT: 4
COMPACT: 5
Fuel Cell: 6
Fission: 7

For support Tanks, you'll also need an entry named "barrating" to set the BAR
rating, we do not yet automatically set that based on the armor type set earlier.
So you'll need something like this:
<barrating>
5
</barrating>
on those units.

Next up is the motion type of the tank:

<motion_type>
Tracked
</motion_type>
The values are
Tracked
Wheeled
Hover
VTOL
Naval
Hydrofoil
Submarine
WiGE

For OmniTanks, you'll need to add these lines:
<omni>
1
</omni>

For tanks that have infantry bays, you'll need an entry along these lines:
<transporters>
TroopSpace:3
</transporters>
This example would give the unit a 3 ton infantry bay.

OmniscientQ

  • Corporal
  • *
  • Posts: 60
    • MegaMek / BattleTech IRC Channel
Re: Vehicles .blk Files - WTF?
« Reply #4 on: 19 February 2011, 13:20:23 »
Many, many, many thanks Beerockxs. That was exactly what was needed. In fact, I'm just going to copy-and-paste your reply to make that my blank template for future vehicles, after commenting out the explanatory lines.

You just made my day.
Q v2.0, Cluster Violet-6
End Transmission