MW buildtables
Build tables are weighted lists of units referenced by MekWars when a unit is produced randomly. There are 3 separate sets of build tables:
- Standard - referenced when a unit is pulled from a factory
- Reward - referenced Reward Points are spent to produce a unit
- Rare - referenced when the Black Market produces a random unit
Build tables are text files, located in the data/buildtables/[standard | rare | reward] folder.
NAMING
Each standard and reward table needs to be named as follows:
[faction name]_[unit weight][unit type, unless mech].txt
For instance:
- Davion_Light.txt
- Free Worlds League_HeavyVehicle.txt
- Comstar_AssaultAero.txt
Rare tables have a different format, being simply Rare_Light.txt, Rare_Medium.txt, Rare_Heavy.txt, and Rare_Assault.txt. Unlike the standard and reward tables, unit types are mixed on the rare tables, and you cannot have more than these 4.
FORMAT
Each unit or table entry is on a separate line, in the following format:
[numeric chance] [entry]
These entries can be either units, in the following format:
[file name, including extension, case-sensitive]
or tables, in the following format:
Table name, no extension, and no weight/class specification
So, for instance:15 Javelin JVN-10F.mtf
would indicate a unit entry. 25 Common
would be a table entry.
A complete build table might look something like:
695 Common 20 Commando COM-1D.mtf 60 Commando COM-2D.mtf 10 Hermes HER-1A.mtf 10 Hermes HER-1B.mtf 1 Hussar HSR-200-D.mtf 5 Jackrabbit JKR-8T.mtf 5 Jackrabbit JKR-9R.mtf 1 Mercury MCY-99.mtf 1 Mongoose MON-66.mtf 20 Mongoose MON-67.mtf 1 Night Hawk NTK-2Q.mtf 10 Ostscout OTT-7J.mtf 50 Panther PNT-8Z.mtf 10 Talon TLN-5V.mtf 6 Thorn THE-N.mtf 55 Toro TR-A-6.mtf 40 UrbanMech UM-R60.mtf 10 Lyran Commonwealth 10 Draconis Combine 10 Federated Suns 10 Capellan Confederation 10 Free Worlds League
When it comes time for a unit to be pulled from the table, the weights will be added up and a random number generated. If the selection is a table, MekWars will start the process over on the new table until a unit is selected.
COMMON PROBLEMS
There are a few common issues with build tables, resulting in errors or unexpected behavior:
- Wrong file name - this will result in the file never being consulted, and errors when the properly named table is not found
- Misspelled unit name - this will result in OMG units being produced
- Wrong capitalization in a unit entry - this will also result in OMGs
- .txt being left on a table name - the server will assume it is a file entry, as it has a file extension, resulting in an OMG