OOTP Baseball Card Templates

From StatsLab Wiki
Jump to: navigation, search

OOTP has the ability to generate baseball cards for players in your game. The game uses XML template files and player photos generated with FaceGen to create a card. BMW created a document that describes the process of creating baseball cards in detail which can be downloaded here: Creating Baseball Card Templates for OOTP 16 v1.0.pdf. The information below supplements this document with up to date information for OOTP15.

This page is still a work in progress, but will attempt to capture the basics of baseball card template creation.

Template Documentation

OOTP generates baseball cards for each of the following situations. The standard template name is indicated in parentheses.

  • Base cards (default.xml)
  • All-Stars (all_star.xml)
  • Hall of Famers (hof.xml)
  • Batter of the Year / Most Valuable Player (hitter_award.xml)
  • Pitcher of the Year (pitcher_award.xml)
  • Rookie of the Year (rookie_award.xml)
  • Gold Gloves (defense_award.xml)
  • Manager of the Year (manager_award.xml)

Many of the baseball card template mods do not include a version of all of these.

Tags

There are three primary tags that make up an OOTP baseball card template.

  • PICTURE - The picture tag must be defined with a height and width attribute. All other tags are contained inside the picture tag.
  • ELEMENTS - The elements tag is used simply to group elements.
  • ELEMENT - The elemet tag is where all the work is done, including inserting images and text. Each template will have a number of element tags.

Tag Attributes

General Attributes

  • type - Defines the nature of what is displayed. Possible values are image or text.
  • x - Integer value defining the x coordinate of where the element is displayed
  • y - Integer value defining the y coordinate of where the element is displayed
  • zorder - Integer value defining the order in which elements are rendered. Lower numbers are rendered first, with higher numbered elements overlayed on top of them.
  • height - Integer defining the vertical on-screen height of the element
  • width - Integer defining the horizontal on-screen width of the element
  • content - This is where what you want to display goes. It can consist of any combination of alphanumeric text and tokens.

Text Attributes

  • font - The name of the font with which to render text. See the #Fonts section below.
  • font_color - The hex code color in which to render the font
  • font_x_size - The pixel width of characters
  • font_y_size - The pixel height of characters
  • align - The horizontal alignment of text. Possible values are: left, center, right, shrink
    • shrink - The shrink alignment will center the text and make sure it fits, horizontally, inside the element. It will therefore adjust the font size if needed.
  • valign - The vertical alignment of text. Possible values are: top, middle, bottom

Image Attributes

Images are inserted using an ELEMENT tag of type image. Images are pulled from the bb_cards directory's images subfolder unless an image token is used to insert an OOTP image like a facegen or team logo. As long as the image exists in the images directory, you can simply enter the filename of the image in the element's content tag attribute. (e.g. content="1988_Score.png")

The tag attributes below can be used to modify the way in which an image is rendered, some of which are specific to the facegen PICTURE token.

  • trialpha_red - A hex color code with which to replace all red in the image. Usually one of the team or league color tokens will be used here.
  • trialpha_green - A hex color code with which to replace all green in the image. Usually one of the team or league color tokens will be used here.
  • trialpha_blue - A hex color code with which to replace all blue in the image. Usually one of the team or league color tokens will be used here.
  • facegen_zoom - The facegen zoom setting to use. Possible values are: in, out, normal, random. Default is random.
  • facegen_angle - The facegen angle setting to use. Possible values are: from_left, from_right, straight, random. Default is random.
  • add_background - A boolean setting to indicate if you want the player image generated with a background or not. Default is 1 (include background). Set it to 0 to turn the background off.

Fonts

OOTP provides several fonts which can be used when generating baseball cards. All of them are located in the game's install location in the data/fonts folder. Adding a font to this folder does not allow you to then use that font in your cards.

There are several versions of the default font, Vera, that can be used:

  • vera
  • bold
  • italic
  • light - a thinner version of the font
  • regular - the same as vera
  • medium - between regular and bold
  • condensed - letters are narrower and closer together

In addition there are other fonts that have significantly different typography:

  • l_college - an italicized all-caps font where lowercase letters are shorter versions of the upper case letters
  • l_emilio - a block letter font with a 3D aspect

There are some additional fonts in the OOTP fonts folder that only work with capital letters in baseball cards. These are commonly used by the game for game generated team and league logos:

  • l_averia
  • l_ball - script capital letters
  • l_black - sans serif
  • l_college2 - think of college football jersey numbers
  • l_font - similar to college2, but more modern blocky
  • l_staubach - similar to college2, but with serif style additions to numbers

Here is a test sample of how the various fonts render in OOTP15:

Ootp15 font test.png

The amaze font in the lower left was an attempt to install the old Amaze.ttf font file from previous OOTP versions into OOTP15 without success.

The right column of fonts is as follows from top to bottom: l_college, l_ball, l_averia, l_black, l_college2, l_emilio, l_font, l_staubach

Tokens

Tokens are used in the XML content tag as a place holder for OOTP to put something else in. It's like a variable that OOTP populates with information specific to the player in question when the card is generated. The two primary types of tokens are image tokens and textual tokens, which come in several flavors. Textual tokens are useful for diplaying text, but can also be useful for selecting player specific image files for composing the card.

Image Tokens

Note that image tokens, unlike most other tokens, do not have brackets around them.

  • PICTURE - A facegen picture for the player in question. Make sure the aspect ratio of any facegen elements are 90x135, just like a player picture. Not doing so can cause oddities in zoom and positioning.
  • TEAM_LOGO - The player's team's logo
  • TEAM_LOGO_n - The player's team's logo in a specific size, where n=size. Note that the size file must specifically exist, otherwise nothing will display. If you just want the default team logo, you can use the height and width attributes to scale it.
  • JERSEY_LOGO - The jersey logo for the player's team. This file often doesn't exist now that most jersey mod makers just make the compiled jersey.
  • CAP_LOGO - The cap logo for the player's team. This file often doesn't exist now that most cap mod makers just make the compiled cap.
  • LEAGUE_LOGO - The logo of the league in which the player plays.
  • LEAGUE_LOGO_n - The logo of the league in which the player plays in a specific size, where n=size. Note that the size file must specifically exist, otherwise nothing will display. If you just want the default league logo, you can use the height and width attributes to scale it.

League Tokens

  • [%LEAGUE_NAME] - The full name of the league in which the player plays (e.g. Major League Baseball)
  • [%LEAGUE_ABBR] - The abbreviation of the league in which the player plays (e.g. MLB)
  • [%SUB_LEAGUE_NAME] - The full name of the subleague in which the player plays (e.g. American League)
  • [%SUB_LEAGUE_ABBR] - The full name of the subleague in which the player plays (e.g. AL)

League colors as defined on the league's settings page. Each returns the 6 digit hex code (e.g. #A645D9):

  • [%LEAGUE_TEXT_COLOR]
  • [%LEAGUE_BG_COLOR]

League Award Names

  • [%LEAGUE_MVP_AWARD] - The league specific Most Valuable Player / Hitter of the Year award name
  • [%LEAGUE_CY_AWARD] - The league specific Cy Young / Pitcher of the Year award name
  • [%LEAGUE_ROOKIE_AWARD] - The league specific Rookie of the Year award name

Team Tokens

  • [%TEAM_ID] - The OOTP internal ID for the team
  • [%TEAM_NAME] - The full team name (e.g. New York Yankees)
  • [%TEAM_CITY] - The team's city (e.g. New York)
  • [%TEAM_NICK] - The team's nickname (e.g. Yankees)

Team colors as defined on the team's facegen settings page. Each returns the 6 digit hex code (e.g. #A645D9):

  • [%TEAM_TEXT_COLOR]
  • [%TEAM_BG_COLOR]
  • [%TEAM_JERSEY_MAIN_COLOR]
  • [%TEAM_JERSEY_SECONDARY_COLOR]
  • [%TEAM_JERSEY_PIN_STRIPES_COLOR]
  • [%TEAM_BALLCAPS_MAIN_COLOR]
  • [%TEAM_BALLCAPS_VISOR_COLOR]


Person Tokens

  • [%PERSON_NAME] - The person's full name (e.g. Ted Williams)
  • [%PERSON_FIRST_NAME] - The person's first name
  • [%PERSON_LAST_NAME] - The person's last name
  • [%PERSON_NICK_NAME] - The person's nick name (e.g. The Splendid Splinter)
  • [%PERSON_NAME_NICK] - The person's full name with nick name inserted (e.g. Ted The Splendid Splinter Williams)
  • [%POSITION] - The player's primary position, capitalized (e.g. Left Fielder). Pitchers will display simply as "Pitcher", rather than with their role defined.
  • [%POSITION_SHORT] - The player's primary position, abbreviated
  • [%UNIFORM_NUMBER]
  • [%AGE]
  • [%PERSON_THROWS] - Lowercase version of throwing handedness (e.g. left)
  • [%PERSON_THROWS_U] - Uppercase version of throwing handedness (e.g. Left)
  • [%PERSON_BATS] - Lowercase version of batting handedness (e.g. left). Switch hitters are listed as "switch".
  • [%PERSON_BATS_U] - Uppercase version of batting handedness (e.g. Left)
  • [%PERSON_DOB] - MM/DD/YYYY format
  • [%PERSON_CITY_OF_BIRTH] - The player's birth city
  • [%PERSON_HEIGHT] - Height in feet and inches (e.g. 6' 2")
  • [%PERSON_WEIGHT] - Weight displayed as pounds (e.g. 215 lbs)
  • [%PERSON_ID] - The OOTP internal ID for the person
  • [%CAREER_FIRST] - The first year of a player's career (No longer supported in OOTP17)
  • [%CAREER_LAST] - The final year of a player's career (No longer supported in OOTP17)
  • [%CAREER_TEAM] - The team the player spent most of their career with (Format: City Nickname)
  • [%AGE_RETIRE] - Age at retirement
  • [%PERSON_CITY_DESCR] - City, State
  • [%PERSON_HOF_DESCRIPTION] - A paragraph of text about the player's accomplishments and his election

Stats Tokens

Stats tokens are of the [%YEAR-CONTEXT_STAT] format with options for seasonal stats or career stats. Season stats can have a number appended to the word SEASON to indicate how many years in the past to look.

Batting stats tokens will not show up for pitchers and pitching stats tokens will not show up for non-pitchers, whether or not those players have accumulated stats in the alternate role. In fact, putting a batting stat token in a text string will prevent the entire text string from showing up for a pitcher (and vice versa). This is useful in tailoring stats to the different types of players without needing multiple templates.

Some token examples:

  • [%SEASON_AB] - Will show the batter's current season total for at bats.
  • [%SEASON1_ERA] - Will show the pitcher's ERA for last year.
  • [%SEASON5_RBI] - Will show the batter's RBI total for 5 seasons ago.
  • [%CAREER_W] - Will show the pitcher's career win total.

Season Tokens

Season tokens are used to give information about the season in which stats are compiled.

  • [%SEASON_YEAR] - The 4 digit year of the current season
  • [%SEASON_YEAR2] - The 2 digit year of the current season
  • [%SEASONn_YEAR] - The 4 digit year of the season n seasons ago.
  • [%SEASONn_YEAR2] - The 2 digit year of the season n seasons ago.
  • [%SEASON_TEAM] - The abbreviation of the team for which the player played in the current season. If the player played for multiple teams, then all team abbreviations are listed, separated by commas.
  • [%SEASONn_TEAM] - The abbreviation of the team for which the player played in the season n seasons ago. If the player played for multiple teams, then all team abbreviations are listed, separated by commas.

Note that for past seasons, there is an upper limit on n of 20. This means you can get, at most, 21 seasons worth of data on the card.

Batting Stats

Of the format [%SEASON_stat]

  • G - Games played by batter
  • AB - At bats
  • H - Hits
  • 2B - Doubles
  • 3B - Triples
  • HR - Home runs
  • R - Runs
  • RBI - Runs batted in
  • SB - Stolen bases
  • HITTER_K - Batting strikeouts
  • HITTER_BB - Batting walks
  • AVG - Batting average
  • OBP - On-base percentage
  • SLG - Slugging percentage
  • OPS - On-base plus slugging percentage

Tags that do not work: PA, SF, SH, TB, VORP, WAR

Pitching Stats

Of the format [%SEASON_stat]

  • GP - Games pitched
  • GS - Games started
  • W - Wins
  • L - Losses
  • SV - Saves
  • IP - Innings pitched (formatted as ###.#)
  • HA - Hits allowed
  • HRA - Home runs allowed
  • BB - Walks allowed
  • K - Strikeouts
  • ERA - Earned run average
  • WHIP - Walks plus hits per inning pitched

Tags that do not work: CG, SHO, HLD, BK, WP, BF, 2BA, 3BA, ER, RA, PCT, WINPCT, VORP, WAR

Fielding Stats

At the moment, no tokens are available for fielding stats.

Special Tokens

  • \n - will insert a line break into text. Consecutive line breaks may need a space between them to render as multiple line breaks.
  • [%RANDOM_NUMBER] - will generate a random digit from 0 to 9
  • [%DATE] - the current date in MM/DD/YYYY format (this is the in game date on which the card is generated)
  • [%YEAR] - the 4 digit current year
  • [%YEAR2] - the 2 digit current year
  • [%INDUCTION_PCT] - Percentage of Hall of Fame vote earned upon induction