Difference between revisions of "OOTP Baseball Card Templates"

From StatsLab Wiki
Jump to navigation Jump to search
(Created page with "OOTP has the ability to generate baseball cards for players in your game. This page is still a work in progress, but will attempt to capture the basics of baseball card templ...")
 
Line 2: Line 2:
  
 
=== Template Documentation ===
 
=== Template Documentation ===
 +
== Tags ==
 
==== Tag Attributes ====
 
==== Tag Attributes ====
 
=== Fonts ===
 
=== Fonts ===
Line 28: Line 29:
  
  
 +
== 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.
 +
* 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)
 +
 +
Team 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]
 +
 +
=== 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
  
 
=== Stats Tokens ===
 
=== Stats Tokens ===
Stats tokens are of the [%TOKEN_NAME] 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.
+
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.
 
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.
Line 39: Line 97:
 
* [%SEASON5_RBI] - Will show the batter's RBI total for 5 seasons ago.
 
* [%SEASON5_RBI] - Will show the batter's RBI total for 5 seasons ago.
 
* [%CAREER_W] - Will show the pitcher's career win total.
 
* [%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.
  
 
==== Batting Stats ====
 
==== Batting Stats ====
 +
Of the format [%SEASON_stat]
 
* G - Games played by batter
 
* G - Games played by batter
 
* AB - At bats
 
* AB - At bats
Line 58: Line 128:
  
 
==== Pitching Stats ====
 
==== Pitching Stats ====
 +
Of the format [%SEASON_stat]
 
* GP - Games pitched
 
* GP - Games pitched
 
* GS - Games started
 
* GS - Games started
Line 75: Line 146:
 
==== Fielding Stats ====
 
==== Fielding Stats ====
 
At the moment, no tokens are available for 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

Revision as of 12:33, 5 June 2014

OOTP has the ability to generate baseball cards for players in your game. This page is still a work in progress, but will attempt to capture the basics of baseball card template creation.

Template Documentation

Tags

Tag Attributes

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


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.
  • 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)

Team 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]

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

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.

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
  • AVG - Batting average
  • OBP - On-base percentage
  • SLG - Slugging percentage
  • OPS - On-base plus slugging percentage

Tags that do not work: PA, BB, K, 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: 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