Wiki Team Hub
Introduction
Welcome to BTA Wiki Team. Here you'll find guides to how to edit various bits, as well as Feature Requests for wiki functionality. If you're new, don't worry about the latter and just familiarize yourself with the guides.
Rough Guide to Editing the Wiki
Preface
We've taken a few steps to try and ease the task before you, but there's still some tricky bits to understand. For the most part, following this page will see you through.
Depending on the work in front of the team, you might have a spreadsheet to avoid people stepping on each others toes - 3+ people working on the same table can be a headache. Follow the process on that and we'll minimize collisions.
Now, lets get one thing straight - you almost NEVER want to be adding stuff via the editor. It's a relatively small box. Get a separate text editor, copy in the template you're using or otherwise do your work in there. Then paste it back in at the appropriate spot. Bonus points if your editor has tabs, so you can keep track of multiple files on the go. If you're stuck trying to do something, ask in #wiki-work or if you trust your technical skill and patience, go digging through the MediaWiki docs.
Creating Screenshots
BD provides icons, but we provide loadouts. I just use Steam's screenshot manager because it's the lowest impact on the game and you are going to be moving between skirmish mech bay entries a lot. Either way, rename them as per their variant (i.e. THM-4M.jpg) and upload them using the Upload Wizard. You may want to do it in batches, alongside the mechs you're editing, because there are several steps that require some repetitive work. (Note: Amid, at some point, will try to provide a CLI batch uploader to take the repeat effort out of using the Wizard). You'll need to swear its your work and provide a description.
At that point, they're submitted and available. The Wizard will spit out some helpful data about using them in the wiki that we're gonna ignore because 90% of the work is in templates. Now you can get to editing!
Actually Editing
Some generalities. Tabs and table entries are entered alphabetically, with gladiators appended at the end. For tables, Community Content get their own tables, but are appended in the tabs behind gladiators.
For tables, the length of an entry shouldn't matter, but if you find yourself making looooong columns, ask BD for how he wants it to look.
Creating Mech Pages
If you open an existing mech page, you'll find that it is actually incredibly short. That's because the vast majority of pages are created with templates. Below is really all you need.
<tabs> <tab name="ABS-2L"> {{AutoInfoboxVariant|ABS-2L}} ===Description=== {{MechDetails|ABS-2L}} ===Bonuses=== {{QuirkEasyToMaintain}} {{AffinityAgile}} ===Factions=== {{MechFactions|ABS-2L}} {{LoadoutImage|image=ABS-2L.png}} </tab> </tabs> [[Category:30 Ton Mechs]] [[Category:Inner Sphere BattleMechs]] [[Category:Inner Sphere Mechs]]
The "<tabs>" line initializes the tabbing system and is only needed once. Closing it is done at the bottom of a doc and closes out tabbed information.
Each tab is captured within a "<tab>" block.
Everything in a "{{ }}" block is a template and its in here that you'll do most of the work. For a new page, copy the above, change the mech name and variant id. For updating pages, copy a "<tab>" block and change the variant id.
The gotchas here are the images - you may need to change the .png to a .jpg for the loadout. And the AutoInfoboxVariant template goes looking for a .png with the name of the title of the page, which can get hairy. If you need to do some digging, see the section below about #Finding Mech Images.
If you're uploading new images, say, for loadouts please keep the image size relatively sane. The vast majority of the world is still on 1080p. No 4k and no ultrawide images please.
Editing List of Mechs
This... is a little bit more involved. And by a little, I mean a lot. You're going to want the Skirmish Bay open for some of this information, unless you're do maths gud in yer noggin.
Below is a complete entry within a table. Creating a whole new table is rare and beyond the scope of this quick intro.
|rowspan="4"| [[File:Anubis.png|125px|border|center]] '''[[Anubis|ANUBIS]]''' '''Mech Quirk:''' Easy To Maintain (Fast refits) [[Pilot Affinities|'''Pilot Affinity:''']] Agile (Gains 1 bonus evasion on movement) |ABS-2L |30t |Fire Support |0 |0 |2 |4 |0 |XL |240 |DHS |Endo |Ferro |None |16.5t |25.5t |8 |12 |0 |- |ABS-3D |30t |Fire Support |0 |4 |0 |0 |0 |XL |240 |DHS |Endo |Stealth |None |16.5t |25.5t |8 |12 |0 |- |ABS-3L |30t |Fire Support |0 |0 |4 |2 |0 |XL |240 |DHS |Endo |Stealth |None |16.5t |25.5t |8 |12 |0 |- |ABS-TZ |30t |Gladiator |0 |4 |0 |4 |0 |XL |240 |DHS |Endo |Stealth |None |16.5t |25.5t |8 |12 |0 |-
See that "rowspan="4"" bit? That is the single most important bit to get right, because it maps to the number of variants each mech will have per "Chassis" column and if its not exact, the table gets real wonky. Increment it by 1 for every variant you add or just make sure it matches the number of variants. Above, the Anubis has 4 variant entries, hence "rowspan="4"".
Where you see "Anubis|ANUBIS" the all caps is the displayed text and the "Anubis" is a dynamically created link
The remaining columns are fairly self-explanatory, but some bear some calling out:
Column | Description |
---|---|
Role | The big grey striped box in the top-right of loadout pics. Maintain its exact wording is key, particularly for anything comedic. |
Hardpoints | Do yourself a favour and memorize "BEMSO" and remember that "B" comes after the Role descriptor. |
Core Gear | With the exception of the engine, core, e-cooling and gyro (i.e. anything in the CT core gear), all non-fixed equipment and armor is stripped to give a free tonnage value. This is the default free tonnage measurement for OmniMechs with locked gear. |
Bare | All components and armor are stripped. This shows the weight taken up by structure and gives a broader idea of total free tonnage on BattleMechs |
Speed | Use the values in the mechbay UI, don't bother calculating supercharger/TSM/MASC |
Now you just need to learn to map the columns as they appear on the List to how they appear in edit mode. Welcome to Wiki Hell! You're here forever. ☺
Note that the final line ends with "|-", which indicates a new section coming up. The very final section of a table ends in "|}", closing out a block waaayyy at the top that you ideally shouldn't need to worry about.
Finding Mech Images
For cases where an image is just not resolving, you're going to have to go digging. You can do this one of two ways, by going to the File list page or searching via the bar with the prefix "File:". 99% of the time, a file has been misnamed on accident while uploading, which is a quick fix in 99OKFINE 90% of cases - save the image, delete the file and re-upload with a correct name (ignoring the bit about the file already existing or having been uploaded before).
The search bar is helpful for finding, say, a file that has been slightly misnamed or finding the page of a questionable file. On that page you can find its details, and file history, which might point to why its busted.
The File List page is useful for finding a file that's wildly misnamed because you can go through looking for the right picture. You're probably working with newer uploads, so it should be pretty close to the first page. Otherwise, prepare to go back a while.
Miscellaneous Gotchas
- Gladiators use a special faction line on their mech page, go find it and use that instead of the above. Actually, any mech that is ONLY found as a reward or through an event gets that treatment.
- On the List of Mechs page, the picture has a px (pixel) value. This is basically resizing it on the fly. 95% of the time, you won't need to touch this, but occasionally something just doesn't play well. The only real fix here is to play with the value until it looks more or less like the others.
- Community content mechs get their own table, but exist as tabs in the mech's main page.
- RAWDATA editing: here there be dragons, ask Amid or Wulf, if only so the latter can make a backup of the DB.
Creating Faction Pages (WIP)
Faction pages are made from several categories: Infobox Description Enemy Factions Faction Store Inventory
Since all the factions are new, we make BD deal with the Infobox and Description because new factions are probably going to be homebrew. Enemy Factions currently have to be filled out by hand, consult the code at (AMID SUPPLY THIS INFO)
The Faction Store Inventory section is the single most complicated bit: in order to get it to work, you need to update the -- Module:Factions handles translating faction tags to their full names
local p = {}
local mechs = require('Module:Mech').core local getArgs = require('Module:Arguments').getArgs
-- Dictionary of faction tags translated to how we want them rendered in the mech list. Also used as an indicator of being a "major" parent faction p.factionTags = {
["331stDivision"] = 'The 331st Royal BattleMech Division', AuriganDirectorate = 'Aurigan Directorate', AuriganPirates = 'Pirates', AuriganRestoration = 'Aurigan Restoration (Arano)', Cameron = 'Terran Hegemony (Cameron)', CalderonProtectorate = 'Calderon Protectorate ', Chainelane = 'Chainelane Isles', Circinus = 'Circinus Federation', ClanDiamondShark = 'Clan Diamond Shark', ClanFireMandrill = 'Clan Fire Mandrill', ClanGhostBear = 'Clan Ghost Bear', ClanGoliathScorpion = 'Clan Goliath Scorpion', ClanJadeFalcon = 'Clan Jade Falcon', ClanNovaCat = 'Clan Nova Cat', ClanSnowRaven = 'Clan Snow Raven', ClanWolf = 'Clan Wolf', ComStar = 'ComStar', DaneSacellum = 'Dane Sacellum', Davion = 'Federated Suns (Davion)', DarkCaste = 'Dark Caste', Delphi = 'New Delphi Compact', FroncReaches = 'Fronc Reaches', Hanse = 'Hanseatic League', Illyrian = 'Illyrian Palatinate', Ives = 'St. Ives Compact', JacobsonHaven = 'Jacobson Haven', JarnFolk = 'JàrnFòlk', Kurita = 'Draconis Combine (Kurita)', Liao = 'Capellan Confederation (Liao)', Locals = 'Local Government', Lothian= 'Lothian League', MagistracyOfCanopus = 'Magistracy of Canopus', MallardRepublic = 'Mallard Republic', Marian = 'Marian Hegemony', Marik = 'Free Worlds League (Marik)', Mercenaries = 'Mercenaries', Outworld = 'Outworlds Alliance', Rasalhague = 'Free Rasalhague Republic', RimWorldsRepublic = 'Rim Worlds Republic', SanctuaryAlliance = 'Sanctuary Alliance', ScorpionEmpire = 'Scorpion Empire', Steiner = 'Lyran Commonwealth (Steiner)', TaurianConcordat = 'Taurian Concordat', Tortuga = 'Tortuga Dominions', WordOfBlake = 'Word of Blake'
}
-- Translates all faction IDs to names. Excludes factions we don't care about, like anything translating to "Darius" or the Mercenary Review Board. Blacklist is maintained in external C# export tool. p.factionIdsToNames = {
["10thLyranGuards"] = "10th Lyran Guards", ["11thArmyVEta"] = "11th Army V-Eta", ["11thAvalonHussars"] = "11th Avalon Hussars", ["12thVeganRangers"] = "12th Vegan Rangers", ["15thLyranRegulars"] = "15th Lyran Regulars", ["1stAllianceAirWing"] = "1st Alliance Air Wing", ["1stHeliusLegionnaires"] = "1st Helius Legionnaires", ["1stKitteryBorderers"] = "1st Kittery Borderers", ["1stKnightsOfTheInnerSphere"] = "1st Knights of the Inner Sphere", ["1stMcCarronsArmoredCavalry"] = "1st McCarron's Armored Cavalry", ["1stSwordOfLight"] = "1st Sword Of Light", ["1stTyr"] = "1st Tyr", ["21stCentauriLancers"] = "21st Centauri Lancers", ["2ndArmyVMu"] = "2nd Army V-Mu", ["2ndCanopianFusiliers"] = "2nd Canopian Fusiliers", ["2ndCrucisLancers"] = "2nd Crucis Lancers", ["2ndFreemen"] = "2nd Freemen", ["2ndFreeWorldsGuards"] = "2nd Free Worlds Guards", ["2ndLegionOfVega"] = "2nd Legion Of Vega", ["30thMarikMilitia"] = "30th Marik Militia", ["331stDivision"] = "The 331st Royal BattleMech Division", ["3rdAllianceAirWing"] = "3rd Alliance Air Wing", ["3rdNightStalkers"] = "3rd Night Stalkers", ["3rdTaurianLancers"] = "3rd Taurian Lancers", ["40thShadowDivision"] = "40th Shadow Division", ["4thAllianceAirWing"] = "4th Alliance Air Wing", ["4thKavalleri"] = "4th Kavalleri", ["51stDarkPanzerJaegers"] = "51st Dark Panzer Jaegers", ["5thDonegalGuards"] = "5th Donegal Guards", ["6thConfederationReserveCavalry"] = "6th Confederation Reserve Cavalry", ["6thLyranGuards"] = "6th Lyran Guards", ["7thArmyVIota"] = "7th Army V-Iota", ["8thHeliusFusiliers"] = "8th Helius Fusiliers", ["9thDivisionWoB"] = "9th Division III-Gamma", ["AlwaysFaithful"] = "Always Faithful", ["AntianLanciarii"] = "Antian Lanciarii", ["AuriganDirectorate"] = "Aurigan Directorate", ["AuriganPirates"] = "Pirates", ["AuriganRestoration"] = "Aurigan Restoration (Arano)", ["AvantisAngels"] = "Avanti's Angels", ["Axumite"] = "Axumite Providence", ["BandOfTheDamned"] = "Band of the Damned", ["BannockburnsBandits"] = "Bannockburn's Bandits", ["BarrettsFusiliers"] = "Barrett's Fusiliers", ["Betrayers"] = "Arano Betrayers", ["BlackCaravel"] = "Black Caravel", ["Blackhearts"] = "The Blackhearts", ["BlackOutlaws"] = "The Black Outlaws", ["BlueStarIrregulars"] = "Blue Star Irregulars", ["BroadswordLegion"] = "Broadsword Legion", ["BronsonsHorde"] = "Bronson's Horde", ["BullardsArmoredCavalry"] = "Bullard's Armored Cavalry", ["BurrsBlackCobras"] = "Burr's Black Cobras", ["CaesarsCohorts"] = "Caesar's Cohorts", ["CamachosCaballeros"] = "Camacho's Caballeros", ["Cameron"] = "Terran Hegemony (Cameron)", ["CanopianHighlanders"] = "Canopian Highlanders", ["Castile"] = "Nueva Castile", ["CGBThetaGalaxy"] = "CGB Theta Galaxy", ["CGSOmegaGalaxy"] = "CGS Omega Galaxy", ["Chainelane"] = "Chainelane Isles", ["Circinus"] = "Circinus Federation", ["CJFIotaGalaxy"] = "CJF Iota Galaxy", ["ClanBurrock"] = "Clan Burrock", ["ClanCloudCobra"] = "Clan Cloud Cobra", ["ClanCoyote"] = "Clan Coyote", ["ClanDiamondShark"] = "Clan Diamond Shark", ["ClanFireMandrill"] = "Clan Fire Mandrill", ["ClanGhostBear"] = "Clan Ghost Bear", ["ClanGoliathScorpion"] = "Clan Goliath Scorpion", ["ClanHellsHorses"] = "Clan Hell's Horses", ["ClanIceHellion"] = "Clan Ice Hellion", ["ClanJadeFalcon"] = "Clan Jade Falcon", ["ClanNovaCat"] = "Clan Nova Cat", ["ClansGeneric"] = "Clans", ["ClanSmokeJaguar"] = "Clan Smoke Jaguar", ["ClanSnowRaven"] = "Clan Snow Raven", ["ClanStarAdder"] = "Clan Star Adder", ["ClanSteelViper"] = "Clan Steel Viper", ["ClanWolf"] = "Clan Wolf", ["ClanWolfInExile"] = "Clan Wolf-in-Exile", ["CleanKill"] = "Clean Kill", ["CNCOmicronGalaxy"] = "CNC Omicron Galaxy", ["CohorsMorituri"] = "Cohors Morituri", ["ComStar"] = "ComStar", ["CSRDeltaGalaxy"] = "CSR Delta Galaxy", ["CWEpsilonGalaxy"] = "CW Epsilon Galaxy", ["DaneSacellum"] = "Dane Sacellum", ["DarkCaste"] = "The Dark Caste", ["Davion"] = "Federated Suns (Davion)", ["DavionAssaultGuards"] = "Davion Assault Guards", ["DeathCommandos"] = "Death Commandos", ["DeathsConsorts"] = "Death's Consorts", ["Delphi"] = "New Delphi Compact", ["Dioscuri"] = "Dioscuri", ["DismalDisinherited"] = "Dismal Disinherited", ["Dragonslayers"] = "Dragonslayers", ["Elysia"] = "Elysian Fields", ["EridaniLightHorse"] = "Eridani Light Horse", ["FederatedFreemen"] = "Federated Freemen", ["FistOfMokal"] = "Fist Of Mokal", ["GrayDeathLegion"] = "Gray Death Legion", ["GraysGhosts"] = "Gray's Ghosts", ["GreenburgsGodzillas"] = "Greenburg's Godzillas", ["GrimDetermination"] = "Grim Determination", ["Hanse"] = "Hanseatic League", ["HarcourtsDestructors"] = "Harcourt's Destructors", ["HarlocksWarriors"] = "Harlock's Warriors", ["HsienHotheads"] = "Hsien Hotheads", ["ILegioMartiaVictrix"] = "I Legio Martia Victrix", ["Illyrian"] = "Illyrian Palatinate", ["IrukjandiCompany"] = "Irukjandi Company", ["Ives"] = "St. Ives Compact", ["JacobsJuggernauts"] = "Jacob's Juggernauts", ["JacobsonHaven"] = "Jacobson Haven", ["JarnFolk"] = "JarnFolk", ["KellHounds"] = "Kell Hounds", ["KhorsakovsCossacks"] = "Khorsakov's Cossacks", ["KindraaSainze"] = "Kindraa Sainze", ["KindraaFaradayTanaga"] = "Kindraa Faraday-Tanaga", ["KindraaMickKreese"] = "Kindraa Mick-Kreese", ["KnightsOfCaerbannog"] = "Knights of Caerbannog", ["KnightsOfStCameron"] = "Knights Of St. Cameron", ["Kurita"] = "Draconis Combine (Kurita)", ["LangendorfLancers"] = "Langendorf Lancers", ["LethalInjection"] = "Lethal Injection", ["Liao"] = "Capellan Confederation (Liao)", ["LindonsBattalion"] = "Lindon's Battalion", ["Locals"] = "Planetary Government", ["LoneStarRegiment"] = "Lone Star Regiment", ["LongwoodsBluecoats"] = "Longwood's Bluecoats", ["Lothian"] = "Lothian League", ["MagistracyCavaliers"] = "Magistracy Cavaliers", ["MagistracyCentrella"] = "Magistracy of Centrella", ["MagistracyOfCanopus"] = "Magistracy of Canopus", ["MajestyMetals"] = "Majesty Metals & Manufacturing", ["MallardRepublic"] = "Mallard Republic", ["Marian"] = "Marian Hegemony", ["Marik"] = "Free Worlds League (Marik)", ["Mercenaries"] = "Mercenaries", ["MobileFire"] = "Mobile Fire", ["MorrisonsExtractors"] = "Morrison's Extractors", ["NarhalsRaiders"] = "Narhal's Raiders", ["Nautilus"] = "Nautilus Base Defenses", ["NewBeltPirates"] = "New Belt Pirates", ["NoFaction"] = "Abandoned", ["NorthwindHighlanders"] = "Northwind Highlanders", ["Oberon"] = "Oberon Confederation", ["OlsonsRangers"] = "Olson's Rangers", ["Outworld"] = "Outworld Alliance", ["PleiadesHussars"] = "Pleiades Hussars", ["QuintsOlympianGroundpounders"] = "Quint's Olympian Groundpounders", ["RamiliesRaiders"] = "Ramilie's Raiders", ["Rasalhague"] = "Free Rasalhague Republic", ["RaventhirsIronHand"] = "Raventhir's Iron Hand", ["RepublicanGuard"] = "Republican Guard", ["RimWorldsRepublic"] = "Rim Worlds Republic", ["RomanovsCrusaders"] = "Romanov's Crusaders", ["RubinskysLightHorse"] = "Rubinsky's Light Horse", ["SaiphTriumvirate"] = "Saiph Triumvirate", ["SanctuaryAlliance"] = "Sanctuary Alliance", ["ScorpionEmpire"] = "Scorpion Empire", ["SarnaSupremacy"] = "Sarna Supremacy", ["ScreamingEagles"] = "Screaming Eagles", ["ShenSeTian"] = "Shen-Se Tian", ["SimonsonsCutthroats"] = "Simonson's Cutthroats", ["SmithsonsChineseBandits"] = "Smithson's Chinese Bandits", ["SnordsIrregulars"] = "Snord's Irregulars", ["SolarisVIIMercLeague"] = "Solaris VII Mercenary League", ["Steiner"] = "Lyran Commonwealth (Steiner)", ["StykCommonality"] = "Styk Commonality", ["TaurianConcordat"] = "Taurian Concordat", ["TaurianGuard"] = "Taurian Guard", ["TerracapConfederation"] = "Terracap Confederation", ["TheArcadians"] = "The Arcadians", ["TheKrushers"] = "The Krushers", ["ThermoPolice"] = "Thermo Police", ["ToothOfYmir"] = "Tooth of Ymir", ["Tortuga"] = "Tortuga Dominions", ["TortugaFusiliers"] = "Tortuga Fusiliers", ["Valkyrate"] = "Greater Valkyrate", ["VanguardLegion"] = "Vanguard Legion", ["VLegioRipariensis"] = "V Legio Ripariensis", ["WarriorHouseImarra"] = "Warrior House Imarra", ["WinfieldsRegiment"] = "Winfield's Regiment", ["WoBProtectorateMilitia"] = "WoB Protectorate Militia", ["Wolfs_Dragoons"] = "Wolf's Dragoons", ["WordOfBlake"] = "Word of Blake"
}
-- Translates SPAM sub-faction IDs to their parent faciton IDs. Translates all Mercenary companies to "Mercenaries" p.spamFactionsToParents = {
["Cameron"] = "Cameron", ["StarGuardCorps"] = "Cameron", ["ICorps"] = "Cameron", ["IVCorps"] = "Cameron", ["ClanWolf"] = "ClanWolf", ["CWEpsilonGalaxy"] = "ClanWolf", ["ClanNovaCat"] = "ClanNovaCat", ["CNCOmicronGalaxy"] = "ClanNovaCat", ["ClanJadeFalcon"] = "ClanJadeFalcon", ["CJFIotaGalaxy"] = "ClanJadeFalcon", ["ClanGhostBear"] = "ClanGhostBear", ["CGBThetaGalaxy"] = "ClanGhostBear", ["ClanGoliathScorpion"] = "ClanGoliathScorpion", ["CGSOmegaGalaxy"] = "ClanGoliathScorpion", ["ClanFireMandrill"] = "ClanFireMandrill", ["KindraaSainze"] = "ClanFireMandrill", ["KindraaFaradayTanaga"] = "ClanFireMandrill", ["KindraaMickKreese"] = "ClanFireMandrill", ["ClanSnowRaven"] = "ClanSnowRaven", ["CSRDeltaGalaxy"] = "ClanSnowRaven", ["WordOfBlake"] = "WordOfBlake", ["40thShadowDivision"] = "WordOfBlake", ["9thDivisionWoB"] = "WordOfBlake", ["WoBProtectorateMilitia"] = "WordOfBlake", ["Liao"] = "Liao", ["DeathCommandos"] = "Liao", ["1stMcCarronsArmoredCavalry"] = "Liao", ["WarriorHouseImarra"] = "Liao", ["6thConfederationReserveCavalry"] = "Liao", ["Kurita"] = "Kurita", ["1stSwordOfLight"] = "Kurita", ["3rdNightStalkers"] = "Kurita", ["2ndLegionOfVega"] = "Kurita", ["Davion"] = "Davion", ["DavionAssaultGuards"] = "Davion", ["2ndCrucisLancers"] = "Davion", ["1stKitteryBorderers"] = "Davion", ["10thLyranGuards"] = "Davion", ["Steiner"] = "Steiner", ["6thLyranGuards"] = "Steiner", ["5thDonegalGuards"] = "Steiner", ["15thLyranRegulars"] = "Steiner", ["11thAvalonHussars"] = "Steiner", ["Marik"] = "Marik", ["1stKnightsOfTheInnerSphere"] = "Marik", ["2ndFreeWorldsGuards"] = "Marik", ["30thMarikMilitia"] = "Marik", ["ComStar"] = "ComStar", ["2ndArmyVMu"] = "ComStar", ["11thArmyVEta"] = "ComStar", ["7thArmyVIota"] = "ComStar", ["Rasalhague"] = "Rasalhague", ["1stTyr"] = "Rasalhague", ["2ndFreemen"] = "Rasalhague", ["4thKavalleri"] = "Rasalhague", ["RimWorldsRepublic"] = "RimWorldsRepublic", ["1stHeliusLegionnaires"] = "RimWorldsRepublic", ["8thHeliusFusiliers"] = "RimWorldsRepublic", ["RepublicanGuard"] = "RimWorldsRepublic", ["TaurianConcordat"] = "TaurianConcordat", ["TaurianGuard"] = "TaurianConcordat", ["PleiadesHussars"] = "TaurianConcordat", ["3rdTaurianLancers"] = "TaurianConcordat", ["MagistracyOfCanopus"] = "MagistracyOfCanopus", ["RaventhirsIronHand"] = "MagistracyOfCanopus", ["2ndCanopianFusiliers"] = "MagistracyOfCanopus", ["MagistracyCavaliers"] = "MagistracyOfCanopus", ["Outworld"] = "Outworld", ["1stAllianceAirWing"] = "Outworld", ["3rdAllianceAirWing"] = "Outworld", ["4thAllianceAirWing"] = "Outworld", ["Marian"] = "Marian", ["ILegioMartiaVictrix"] = "Marian", ["VLegioRipariensis"] = "Marian", ["CohorsMorituri"] = "Marian", ["Mercenaries"] = 'Mercenaries', ["BroadswordLegion"] = 'Mercenaries', ["BurrsBlackCobras"] = 'Mercenaries', ["51stDarkPanzerJaegers"] = 'Mercenaries', ["FistOfMokal"] = 'Mercenaries', ["HsienHotheads"] = 'Mercenaries', ["SimonsonsCutthroats"] = 'Mercenaries', ["AlwaysFaithful"] = 'Mercenaries', ["LangendorfLancers"] = 'Mercenaries', ["LethalInjection"] = 'Mercenaries', ["OlsonsRangers"] = 'Mercenaries', ["TheArcadians"] = 'Mercenaries', ["BlueStarIrregulars"] = 'Mercenaries', ["12thVeganRangers"] = 'Mercenaries', ["Dioscuri"] = 'Mercenaries', ["FederatedFreemen"] = 'Mercenaries', ["HarlocksWarriors"] = 'Mercenaries', ["ScreamingEagles"] = 'Mercenaries', ["SmithsonsChineseBandits"] = 'Mercenaries', ["VanguardLegion"] = 'Mercenaries', ["AvantisAngels"] = 'Mercenaries', ["KellHounds"] = 'Mercenaries', ["KnightsOfStCameron"] = 'Mercenaries', ["MobileFire"] = 'Mercenaries', ["SnordsIrregulars"] = 'Mercenaries', ["CamachosCaballeros"] = 'Mercenaries', ["GreenburgsGodzillas"] = 'Mercenaries', ["NarhalsRaiders"] = 'Mercenaries', ["NorthwindHighlanders"] = 'Mercenaries', ["Wolfs_Dragoons"] = 'Mercenaries', ["BarrettsFusiliers"] = 'Mercenaries', ["Blackhearts"] = 'Mercenaries', ["TheKrushers"] = 'Mercenaries', ["RomanovsCrusaders"] = 'Mercenaries', ["BannockburnsBandits"] = 'Mercenaries', ["CleanKill"] = 'Mercenaries', ["LoneStarRegiment"] = 'Mercenaries', ["LongwoodsBluecoats"] = 'Mercenaries', ["CaesarsCohorts"] = 'Mercenaries', ["CanopianHighlanders"] = 'Mercenaries', ["DismalDisinherited"] = 'Mercenaries', ["Dragonslayers"] = 'Mercenaries', ["HarcourtsDestructors"] = 'Mercenaries', ["RamiliesRaiders"] = 'Mercenaries', ["ThermoPolice"] = 'Mercenaries', ["BronsonsHorde"] = 'Mercenaries', ["BullardsArmoredCavalry"] = 'Mercenaries', ["QuintsOlympianGroundpounders"] = 'Mercenaries', ["GraysGhosts"] = 'Mercenaries', ["BlackOutlaws"] = 'Mercenaries', ["21stCentauriLancers"] = 'Mercenaries', ["RubinskysLightHorse"] = 'Mercenaries', ["KhorsakovsCossacks"] = 'Mercenaries', ["EridaniLightHorse"] = 'Mercenaries', ["IrukjandiCompany"] = 'Mercenaries', ["AntianLanciarii"] = 'Mercenaries', ["BlackCaravel"] = 'Mercenaries', ["KnightsOfCaerbannog"] = 'Mercenaries', ["WinfieldsRegiment"] = 'Mercenaries', ["ToothOfYmir"] = 'Mercenaries', ["JacobsJuggernauts"] = 'Mercenaries', ["LindonsBattalion"] = 'Mercenaries', ["GrimDetermination"] = 'Mercenaries', ["SolarisVIIMercLeague"] = 'Mercenaries', ["BandOfTheDamned"] = 'Mercenaries', ["DeathsConsorts"] = 'Mercenaries', ["MorrisonsExtractors"] = 'Mercenaries', ["NewBeltPirates"] = 'Mercenaries', ["TortugaFusiliers"] = 'Mercenaries', ["ShenSeTian"] = 'Mercenaries'
}
-- Outputs a list of the mechs a faction can field. function p.factionMechs(frame)
local tpl_args = getArgs(frame, {parentFirst=true})
local faction = tpl_args[1] local where = string.format('Mech.MechTags HOLDS "%s"', faction)
-- some mechs share the same name but have different tonnages and therefore -- different pages to be linked to local function MakeMechLink(name, variant, tonnage) if (name == "Blackjack" and tonnage ~= "45") or (name == "Centurion" and tonnage ~= "50") or (name == "Corsair" and tonnage ~= "95") or (name == "Stalker" and tonnage ~= "85") or (name == "Mad Cat MK II" and tonnage ~= "90") then return string.format('%s (%sT) %s', name, tonnage, variant, name, tonnage, variant) elseif string.find(variant, "ZEU-X", 1, true) then return string.format('Zeus X %s', variant, variant) else return string.format('%s %s', name, variant, name, variant) end end
-- when querying for mechs, set the limit to 4000. this is arbitrarily high -- (larger than the total number of mechs). without this, factions with lots -- of mechs would not show all of them. local factionMechData = mw.ext.cargo.query( 'Mech,Chassis','Chassis.Name=Name,Chassis.VariantName=VariantName,Chassis.Tonnage=Tonnage', { join = 'Mech.ChassisID=Chassis.Id', where=where, limit=4000 } )
-- Attribute with style def for section titles, used at the end of this section. local weightClassStyle = { style="font-size:16px;font-weight:bold;line-height:1.6;" }
-- Set up separate unordered lists under a central div element local mechsList = mw.html.create('div') local lightList = mw.html.create('ul') lightList:cssText('column-count: 3;-moz-column-count: 3;-webkit-column-count: 3') local mediumList = mw.html.create('ul') mediumList:cssText('column-count: 3;-moz-column-count: 3;-webkit-column-count: 3') local heavyList = mw.html.create('ul') heavyList:cssText('column-count: 3;-moz-column-count: 3;-webkit-column-count: 3') local assaultList = mw.html.create('ul') assaultList:cssText('column-count: 3;-moz-column-count: 3;-webkit-column-count: 3')
-- Sort mechs by tonnage category and assign them to the appropriate list. Since we go in order of decreasing tonnage we only need one if statement per group. for _, mech in ipairs(factionMechData) do if tonumber(mech.Tonnage) >= 80 then assaultList:tag('li'):wikitext(MakeMechLink(mech.Name, mech.VariantName, tostring(mech.Tonnage))) elseif tonumber(mech.Tonnage) >= 60 then heavyList:tag('li'):wikitext(MakeMechLink(mech.Name, mech.VariantName, tostring(mech.Tonnage))) elseif tonumber(mech.Tonnage) >= 40 then mediumList:tag('li'):wikitext(MakeMechLink(mech.Name, mech.VariantName, tostring(mech.Tonnage))) else lightList:tag('li'):wikitext(MakeMechLink(mech.Name, mech.VariantName, tostring(mech.Tonnage))) end end -- Create a div to hold each list, create a div for the title section, apply attributes, and then escape the div before inserting the pre-populated list for that section. mechsList:tag('div'):tag('div'):wikitext("Assault Mechs"):attr(weightClassStyle):done():node(assaultList) mechsList:tag('div'):tag('div'):wikitext("Heavy Mechs"):attr(weightClassStyle):done():node(heavyList) mechsList:tag('div'):tag('div'):wikitext("Medium Mechs"):attr(weightClassStyle):done():node(mediumList) mechsList:tag('div'):tag('div'):wikitext("Light Mechs"):attr(weightClassStyle):done():node(lightList) return mechsList
end
function p.mechFactions(frame)
-- Get the mech variant from args that we're working with here. local tpl_args = getArgs(frame, {parentFirst=true}) variant = tpl_args[1]
local mech = mechs.mech.byVariant(variant)
-- If mech isn't found, return null if mech == nil then return mw.html.create('div').wikitext("Mech not found") end
local spamDict = {} local tags = {} local factionIdSortedKeys = {}
-- loops through the tags from the mech entry for _, tag in ipairs(mech.tags) do -- If the tag corresponds to a faction name that we care about then we want to sort it into our spamDict faction dictionary, by parent if it has one. if p.factionIdsToNames[tag] ~= nil then -- If it has a parent entry AND we don't already have an entry in the spamDict then create a new empty sub-array for it. Also insert the parent faction into our list of keys to be sorted later. if p.spamFactionsToParents[tag] ~= nil and spamDict[p.spamFactionsToParents[tag]] == nil then spamDict[p.spamFactionsToParents[tag]] = {} table.insert(factionIdSortedKeys, p.spamFactionsToParents[tag]) -- If it's NOT in the Parent Faction dictionary AND it's in the faction names list, AND it doesn't already have an entry in the spamDict, then create one, and add the faction to our keys list for sorting. elseif p.spamFactionsToParents[tag] == nil and (p.factionIdsToNames[tag] ~= nil and spamDict[tag] == nil) then spamDict[tag] = {} table.insert(spamDict[tag], tag) table.insert(factionIdSortedKeys, tag) end -- If we don't need to create a new entry then just add the faction tag to the appropriate parent-faction sub-array -- First make sure it has a parent tag. Serves as a duplicates check. if (p.spamFactionsToParents[tag] ~= nil) then table.insert(spamDict[(p.spamFactionsToParents[tag])], tag) end end end
if table.getn(factionIdSortedKeys) == 0 then return mw.html.create('div').wikitext("Mech not found with any factions, it's probably obtained from Game World contracts or an event!'") end
-- sort the list of parent faction keys so we can put them into the html in the right order. Use the raw names so we don't get all the unlinked names going at the top. local function sortByNamesFromIds(first, second) if (p.factionIdsToNames[first] or "a") == (p.factionIdsToNames[second] or "b") then return false else return (p.factionIdsToNames[first] or "a") < (p.factionIdsToNames[second] or "b") end end
table.sort(factionIdSortedKeys, sortByNamesFromIds)
-- Also sort the sub-faction lists, with any parent factions going at the top local function sortSubFactions(first, second) if first == nil or p.factionTags[first] == nil then return false elseif second == nil or p.factionTags[second] == nil then return true else return (p.factionIdsToNames[first] or "a") < (p.factionIdsToNames[second] or "b") end end
for key, subList in pairs(spamDict) do table.sort(subList, sortSubFactions) end
-- Set up our HTML bits, we'll use these in a moment... local factionList = mw.html.create('ul') local collapsibleTagAttributes = { class = 'mw-collapsible mw-collapsed' } local collapsibleContentTagAttributes = { class = 'mw-collapsible-content' }
-- Loop through the sorted list of keys. We're doing it this way so the factions come out sorted in roughly alphabetical order for _, factionId in ipairs(factionIdSortedKeys) do -- If there's only one faction entry and it's not 'nil' then we create a simpler HTML list item if table.getn(spamDict[factionId]) == 1 and factionId == spamDict[factionId][1] then if p.factionTags[factionId] ~= nil then factionList:tag('li'):wikitext(p.factionTags[factionId]) elseif p.factionIdsToNames[factionId] ~= nil then factionList:tag('li'):wikitext(p.factionIdsToNames[factionId]) end -- If there's more than one item then we need to create a collapsible list item element with sub-entries else -- Create a collapsible div to start tempTagConstruct = mw.html.create('div'):attr(collapsibleTagAttributes) -- Do a 'nil' check and then create the list item with the parent faction's readible name out of the factionTags list. The fallback to the larger names list shouldn't be necessary but it's there just in case. if p.factionTags[p.spamFactionsToParents[factionId]] ~= nil then tempTagConstruct:tag('li'):wikitext((p.factionTags[p.spamFactionsToParents[factionId]]) or (p.factionIdsToNames[p.spamFactionsToParents[factionId]])) end -- Create the sub-list element for the inner list of sub-factions, and assign it to a temp variable. -- This is so we can add the whole list back onto the tag construct so it doesn't get confused about where tags should go. tempSubConstruct = mw.html.create('ul') -- Itterate through the list of sub-factions and add each to the inner list, tranlated to its proper name, as a list item for __, subFactionId in ipairs(spamDict[factionId]) do tempSubConstruct:tag('li'):wikitext(p.factionIdsToNames[subFactionId]) end -- Add a collapsible content div so the parent faction name will stay visible. Then add the sub-list all in one go. tempTagConstruct:tag('div'):attr(collapsibleContentTagAttributes):node(tempSubConstruct) -- Add the whole list item element to the large list factionList:node(tempTagConstruct) end end -- Return our mostrous HTML construct to be rendered on the page return factionList
end
return p page, the
Faction | Gear | |||||||
---|---|---|---|---|---|---|---|---|
Weapons | Ammunition | Equipment | Full Mechs | Mech Parts | Vehicles | Battle Armor | Contracts |
, and then you need to generate a !
Free Rasalhague Republic
| LBX/10
UAC/5
Snub-Nose PPC
Streak SRM2
Medium Recoilless Rifle
| Ammo - LBX/10 Cluster
Ammo - LBX/10 Slug
Ammo - UAC/5
Ammo - Streak SRM
| None
| VKG-2F
VON-4RH-5
VON-4RH-6
BMB-12D
WSP-100A
STG-A1
PHX-HK1
UM-LAM
| None
| Red Kite VTOL
Unnsvin
Unnsvin (Ballistic)
Unnsvin (Missile)
| Krupp
| Gunslinger Airdrop
Krupp BA Airdrop
|- for that table.
Feature Requests
Factory World Improvements
Users report the current setup for searching for what factory worlds have what is sub-optimal and takes quite a bit of time to do. The options before us are:
Option | Description | Notes |
---|---|---|
Make the Factory Worlds page sortable | This would make the whole page a table and sortable: https://www.mediawiki.org/wiki/Extension:FilterableTables | A LOT of manual work and wikitable fuckery. |
Basically not doable in a single session. | ||
Would have to be developed separately and pasted in | ||
Create a Found On Factory Worlds template | Make a new module and template that would be inserted everywhere and link back to Faction Worlds pages | See this? https://www.bta3062.com/index.php?title=Template:EquipmentMechs |
Do that, except for Factory Worlds. Requires learning how to write a wiki Module + permissions to do so | ||
Ask Wulfbanes/BD for the permissions and Amid for guidance if you need it |
Vehicle Entry Improvements
Add ammo to vehicle entries in the vehicles table. This could be nice to have, but doing it manually would be a massive pain.
Tips
- Save frequently. This allows for granular rollbacks, a wiki function found in the View history tab at the top right. This is especially useful if you accidentally broke something.
- Templates update on a successful save of the
gamepage, so even if you've, say, changed an image name, a page with a link to that image won't necessarily show it until the page is edited and saved again. No changes need be made, just trigger the save button. You would not believe how many things can be solved by this. If a page or tab is giving an error, try that first.