|
||||
|
|
|
Thread Tools |
09-02-2022, 12:00 PM | #1 |
OOTP Developments
Join Date: Aug 2021
Posts: 174
|
Creating/changing (alternate) uniform details using XML file & texture file naming conventions
Hi everyone,
we have a new feature in OOTP23 (starting with build 23.7.86) that allows to load a XML file which contains information of the uniforms, including alternates, and that will update the values in-game or create new uniforms if they are missing. You can use this through the "Modify Colors & Uniforms" dialog. There is a new button on the bottom: "Load colors XML file". The description how it works is in the /data/colors/_readme.txt and at the bottom of this post. Currently you need to load an XML file for each team manually, but we will add an automatic function to load these files at the start of a new game and then yearly-in-game in the future. There is also the possibility to specify alternate uniform options in the texture filenames for ballcaps, jerseys and pants that will be used when manually loading a texture file through the dialog. The readme files for the uniform items were updated including this feature. You can find the description for ballcaps from /data/ballcaps/_readme.txt below. Feel free to test this and report bugs and suggestions how to improve the usability. Alex ================================================== Taken from /data/colors/_readme.txt: Uniforms colors XML file -------------------- Starting with OOTP23 it is now possible to create alternate uniforms for specific days. The uniforms can be created individually through the uniforms dialog or automatically loading an XML file. In the XML file following properties can be specified: - team colors - uniform properties (home-away switches, weekdays) - uniform item (ballcap, jersey, pants, ...) colors and design ids - time period when to use the properties above - notes Entries are written with a tag followed by the options and their values. Everything should be wrapped by a COLORS block. TEAMCOLORS tag followed by time period and 'color1' and 'color2' will change the team colors. UNIFORM tag followed by time period, 'name', 'ha' (home-away switches) and 'weekdays' will change uniform properties. CAP tag followed by 'color1', 'color2', 'color3' and 'id' will change ballcap colors and design id. JERSEY tag followed by 'color1', 'color2', 'color3' and 'id' will change jersey colors and design id. PANTS tag followed by 'color1', 'color2', 'color3' and 'id' will change pants colors and design id. Time period is specified by 'from' and 'to' (inclusively). NOTES tag will be ignored by the parser. - all tags and options are optional. For UNIFORM the 'name' option should be specified, otherwise the following options will not be attached to any uniform. - up to 3 colors can be specified per uniform item in HEX (6 characters, 3x 00-FF) or RGB (9 characters, 3x 000-255) color codes. No prefixes are needed that are used in logo filename (C1H etc.). First color will change the main color, second the second (visor/belt) color and third the pin stripes color. - up to 2 team colors can be specified in HEX or RGB. First color will change team background color, second the team text color. - for 'weekdays' use 3 letter per day (Mon, Tue, Wed, Thu, Fri, Sat, Sun), can be specified individually: MonSun, in a range: Mon-Fri, Sun-Tue, or both: Wed-SatMon. The order does not matter. - for home-away switches ('ha') set "h" to use the selected uniform for home games, "a" for away games, both "ha" for home and away games, leave it out to not change the existing options or set blank (ha="") to unset both switches. - for time periods ('from' and 'to') years should be used (from="2000" to="2022"). Wrong or missing year will result in using the uniform for all games before/after the other option, e.g. from="" to="2022": uniform will be used for all years until 2022 - uniform names should be unique. In case several uniforms with the same name are found the values of the latest one will be used. - several TEAMCOLORS can be set to cover different time periods. For "Home" and "Away" uniforms (standard ones) home-away switches ('ha') and 'weekdays' options will be ignored. When a uniform is found in the XML file there are four possible outcomes: 1. If the uniform also exists in-game for the currently selected team, and the name and time period both match, then the game will change the values for the existing uniform to match those defined in the XML. 2. If there is no corresponding uniform in-game for the currently selected team in the dialog, a new uniform will be created in-game that matches the conditions defined in the XML, as long as the current year in-game is part of the time period defined for this uniform. 3. If the year in-game is not part of the specified time period for a uniform found in the xml file, and the currently selected team does not already have a uniform with a name that matches the defined name, the uniform will be ignored. 4. If a uniform with a matching name exists for the currently selected team, but the year in-game is not part of the specified time period for a uniform found in the xml file, then the existing uniform will be deactivated by clearing the home-away options for this uniform. Uniforms deactivated in this manner will not be deleted. When creating a new uniform, the game will first search for uniform item textures in the folders for alternate uniform item textures (/data/ballcap/alternates, /data/jersey/alternates, /data/pants/alternates, …). If matching textures are found, these will be used (other options in the texture filenames will be ignored). The filename are: Ballcap caps_TEAMNAME_TEAMNICKNAME_ALTERNATEUNIFORMNAME_ev erything_else.png Jersey jerseys_TEAMNAME_TEAMNICKNAME_ALTERNATEUNIFORMNAME _everything_else.png Pants pants_TEAMNAME_TEAMNICKNAME_ALTERNATEUNIFORMNAME_e verything_else.png TEAMNAME is the name of the team. TEAMNICKNAME is the nickname of the team. ALTERNATEUNIFORMNAME is the name of the alternate uniform. everything_else is ignored The names can contain several words. The uniform ALTERNATEUNIFORMNAME should match the one in the xml file. Example: jerseys_boston_red_sox_holyday_special_uniform_ign ored_text.png When no texture for an item was found one from a template will be created using the colors and design id (or random one if not set). If the colors and/or ids are changed and the uniform item texture was created from an template before it will be recreated using updated values. XML example in the attachment. Loading the XML file example above will change the team colors to the 'Early colors' if the in-game year is between 1999 and 2021 or to 'Current colors' for all years after 2022. For the "Home" uniform only the colors and the design ids will be changed. "Test1" uniform will be used for away games (ha="a") on Wednesday, Saturday, Sunday and Monday for a the years 1999 to 2002, for other years the home and away switches for this uniform will be unset if the team has a uniform with this name. ================================================== Taken from /data/ballcaps/_readme.txt: Alternate uniforms properties ------------------- Besides colors for home and away ballcaps it is now also possible to specify colors codes and other properties in the filenames of alternate uniform textures. The scheme is: caps_TEAMNAME_TEAMNICKNAME_ALTERNATEUNIFORMNAME__W EEKDAYS_HA-SWITCHES_COLOR1_COLOR2_COLOR3.png where TEAMNAME is the name of the team. TEAMNICKNAME is the nickname of the team. ALTERNATEUNIFORMNAME is the name of the alternate uniform. WEEKDAYS are the weekdays the selected uniform will be used. 3 letter per day (Mon, Tue, Wed, Thu, Fri, Sat, Sun), can be specified individually: MonSun, in a range: Mon-Fri, Sun-Tue, or both: Wed-SatMon. The order does not matter. HA-SWITCHES set "h" to use the selected uniform for home games, "a" for away games, both "ha" for home and away games, or leave it blank to not change the existing options. COLOR1-3 are the max. 3 colors of the ballcap in HEX (6 characters, 3x 00-FF) or RGB (9 characters, 3x 000-255) color codes. No prefixes are needed that are used in logo filename (C1H etc.). First color will change ballcap main color, second the visor color and third the pin stripes color in that order. Note the double underscore ("__") after the name of the alternate uniform. This is needed as both the team name and uniform name can consist of several words. As the home-away switches and weekdays are a uniform (contains ballcap, jersey, pants ...) property, changing these values when loading a ballcap texture will change it also for other items (jersey, pants ...) of this uniform. All codes and names are optional. The codes will be parsed and used while loading a texture through the uniforms dialog in the game only when a double underscore ("__") is found in the filename. Examples: - caps_city_nickname_alt_123__Fri-MonSun_h_ff4422_007755.png when loading this texture the selected uniform will be changed to be worn on Friday, Saturday, Sunday and Monday for home games. Ballcap main color will be changed to ff4422 and visor color to 007755, pin stripes color will remain the same. - something__TueThu.png when loading this texture the selected uniform will be changed to be worn on Tuesday and Thursday, home-away options will remain the same, colors stay unchanged. - caps_city_alt__Wed_ha_123123123.png when loading this texture the selected uniform will be changed to be worn on Wednesday for home and away games. Ballcap main color will be changed to 123123123. Note that theses codes will not be parsed when automatically load/update uniforms through an XML file, see /data/colors/_readme.txt for more details. |
Bookmarks |
|
|