Board Thread:General Discussion/@comment-15636815-20140122132804/@comment-15636815-20140127194419

I knew there was something else....

I could have left out all of the and  lines, because parameters default to those values, anyway. The primary reason I added them is because I expected to use each at least once, and I wanted to create a consistent look, but then I didn't use them anywhere.

The only place I used "default" was on the loco type. KmamK removed that, noting that the template already makes this adjustment. One idea would be to allow the TemplateData to force "Undefined" as a default value, giving the working part of the template one less thing to do. If we carried this forward to other parameters that act similarly, the effect would multiply. Or we can just leave it like it is. Just throwing it out there.

Do we want to make any parameters required? I left them all as false only so Template:Infobox train/doc wouldn't blow up, but I don't really know that it would. When people create new loco pages, I would prefer that we require the most basic information (power, dispatch, tax), but that's definitely something we should discuss first.

Updated version
{       "description": "This template is used to create or edit an infobox for a locomotive.", "params": { "name": { "label": "Name", "description": "LEAVE THIS BLANK!! Enter the name of the locomotive ONLY if another locomotive with an identical name already exists; when using this field, enter the locomotive's name exactly as it appears in the game.", "type": "string", "required": false, "default": "" },               "image": { "label": "Image", "description": "The name of the image file; example: Super Cool Locomotive.png", "inherits": "name" },		"type": { "label": "Type", "description": "The locomotive's type; CHOOSE ONE: s, steam, d, diesel, e, electric, m, maglev; if left blank, the infobox will show 'Undefined'.", "inherits": "name" },		"power": { "label": "Power", "description": "The number of wagons the locomotive can pull.", "type": "number", "required": false, "default": "" },		"tax": { "label": "Tax", "description": "The tax charged when dispatching a train with this locomotive; if tax is free, enter 0", "inherits": "power" },		"dispatch": { "label": "Dispatch XP", "description": "The amount of XP received when dispatching a train with this locomotive.", "inherits": "power" },		"set": { "label": "Set", "description": "The set, if any, that includes this locomotive; use  around the name to create a Wikilink.", "inherits": "name" },		"theme": { "label": "Theme", "description": "The theme, if any, that includes this locomotive.", "inherits": "name" },		"natflag": { "label": "National Flag", "description": "If this locomotive is a National Flag Engine, enter 'yes'; otherwise, leave blank.", "inherits": "name" },		"limit": { "label": "Limit (Gold or Award)", "description": "For a Special Offer or Vintage Offer, leave this blank and use 'offer' below; for a Shop locomotive purchased with gems, leave this blank and use 'limit_gem' below; for a Shop locomotive purchased with gold, enter the limit, if any, that may be purchased for gold; for an award locomotive, enter the limit that may be awarded; for a Shop locomotive available both for gems and for gold, if the gems limit is different from the gold limit, enter the gold limit here, and enter the gems limit in 'limit_gem" below.",			"inherits": "power"		},		"cost_gold": {			"label": "Cost (Gold)",			"description": "For a Special Offer or Vintage Offer, leave this blank and use 'offer' below; for a Shop locomotive purchased with gems, leave this blank and use 'cost_gem' below; for a Shop locomotive purchased with gold, enter the cost of the locomotive using digits only; example: 60000 or 50000000.", "inherits": "power" },		"xp_gold": { "label": "Buy XP (Gold)", "description": "For a Special Offer or Vintage Offer, leave this blank and use 'offer' below; for a Shop locomotive purchased with gems, leave this blank and use 'xp_gem' below; for a Shop locomotive purchased with gold, enter the amount of XP received when purchasing this locomotive using digits only; example: 60000 or 1000000.", "inherits": "power" },		"level_gold": { "label": "Level (Gold)", "description": "For a Special Offer or Vintage Offer, leave this blank and use 'offer' below; for a Shop locomotive purchased with gems, leave this blank and use 'level_gem' below; for a Shop locomotive purchased with gold, enter the minimum required level, if any, to purchase this locomotive using digits only; example: 150 or 1200.", "inherits": "power" },		"limit_gem": { "label": "Limit (Gems)", "description": "For a Special Offer or Vintage Offer, leave this blank and use 'offer' below; for a Shop locomotive purchased with gems, enter the limit, if any, that may be purchased for gems; for a Shop locomotive available both for gems and for gold, if the gems limit is different from the gold limit, enter the gems limit here, and enter the gold limit in 'limit" above.",			"inherits": "power"		},		"cost_gem": {			"label": "Cost (Gems)",			"description": "For a Special Offer or Vintage Offer, leave this blank and use 'offer' below; for a Shop locomotive purchased with gems, enter the cost of the locomotive using digits only; example: 350 or 1025.",			"inherits": "power"		},		"xp_gem": {			"label": "Buy XP (Gems)",			"description": "For a Special Offer or Vintage Offer, leave this blank and use 'offer' below; for a Shop locomotive purchased with gems, enter the amount of XP received when purchasing this locomotive using digits only; example: 60000 or 1000000.", "inherits": "power" },		"level_gem": { "label": "Level (Gems)", "description": "For a Special Offer or Vintage Offer, leave this blank and use 'offer' below; for a Shop locomotive purchased with gems, enter the minimum required level, if any, to purchase this locomotive using digits only; example: 150 or 1200.", "inherits": "power" },		"offer": { "label": "Special or Vintage Offer", "description": "For a Special Offer or Vintage Offer enter ; include the curly braces and everything between them; for type, CHOOSE ONE: s: special, v: vintage, u: under-90, l: limited; for date, enter the date the offer began; for cost, use the format  or  with the correct values; for buyxp, enter the amount of XP received when purchasing this locomotive using digits only; for level, enter the minimum required level; for limit, enter the limit that may be purchased; for a 2nd, 3rd, or later offer, add the information for the new offer below all previous offers.", "inherits": "name" },		"award": { "label": "Award", "description": "For an award locomotive, enter the source of the award; example for contractor: Mahatma #24; for an achievement, enter the name of the achievement; example for Mystery Depot: Mystery Depot - Unlabeled Crates; for multiple awards, enter between each award; DO NOT use the 'Enter' key to create a new line.", "inherits": "name" },		"cost_buyback": { "label": "Buyback Cost", "description": "If this locomotive is available in the Buyback Shop, enter the cost (always in gold) to repurchase this locomotive using digits only; example: 10000.", "inherits": "power" },		"level_buyback": { "label": "Buyback Level", "description": "If this locomotive is available in the Buyback Shop, enter the minimum required level to repurchase this locomotive using digits only; example: 150 or 1200.", "inherits": "power" },		"notes": { "label": "Notes", "description": "Enter any additional information about this locomotive which should appear in the infobox; in most cases, leave this field blank.", "inherits": "name" }       } }