Find in this manual | ||
Replace with |
Add-Ons Central doesn't bring a whole lot of benefit to our users unless the modders and hosts take advantage! Luckily, providing your data to your "customers" via Add-Ons Central is a simple matter of packaging your customization the right way, and maintaining a simple XML file on your server! This screen will walk you through the process of hosting an add-on.
Making Add-Ons Appear in OOTP (for modders and file hosts)
Add-Ons Central communicates with hosts through the use of a simple XML file that you create and host on your server. This XML file tells us information about your server, and about any files you wish to host for OOTP. To make one of your add-ons appear in OOTP, use the following steps:
- Create an XML file using the schema specified below, and place it on your server
- Make sure your add-on is packaged correctly as defined below, and place it on your server in the path you indicated in your XML file.
- Inform your potential customers of the path to your server XML file.
OOTP Add-Ons Host XML File Details
The OOTP add-ons host XML file is very simple. It can have any name, as long as the extension is .xml, and it must be hosted in a directory that OOTP users can access. Below is a sample of the XML schema of the file:
<?xml version="1.0" encoding="ISO-8859-1"?><ADDONS>
<SERVERS>
<SERVER unique_name="My Cool OOTP Hosting Site" host="www.mycoolsite.com" add_ons_info="ootp/addons/ootp10.xml"/>
</SERVERS>
<FILES>
<FILE title="My Cool Picture Pack" description="OOTP player photos using famous actors" host="www.mycoolsite.com" path="ootp" name="MyCoolPicturePack.tar.gz" target="$userdata" forumlink="http://www.ootpdevelopments.com/board/off-topic/166451-when-banana-best.html"/>
</FILES>
</ADDONS>
That's it! See below for some more details.
Server Node Attributes
The SERVER node has the following attributes:
Attribute | Description |
unique_name | A unique name for your site. Duplicate names are not allowed. |
host | The top-level address/domain of your hosting site. |
add_ons_info | The path to the OOTP add-ons host XML file on your server |
The combination of server and add_ons_info must be unique.
File Node Attributes
The FILE node has the following attributes:
Attribute | Description |
title | A title for your add-on, which will display in the list of Available Add-Ons. |
description | A description for your add-on, which will display on the right side of Add-Ons Central when your file is selected. |
host | The top-level address/domain of your hosting site. |
path | The path to the specific add-on on your server |
name | The file name of the add-on on your server |
target | The target defines the begin point for installing your add-on. See below for more information on acceptable targets. |
target2 | New in OOTP13. Only valid with target=$leagueimages. Valid values are $teamlogos and $leaguelogos. Files will be installed into league images if the client is OOTP 18, but into the team logos or league logos sub folder if the client is OOTP 19. |
forumlink | Defines a link to the forums, for example where you explain more details about your mod. |
For files, the combination of host, path, and name must be unique.
More about the Target Attribute
In order for OOTP to be able to automatically install your add-on, your add-on must be in either .tar.gz, .tar or .tgz format. If it is, OOTP can install it into an OOTP folder, defined by the "target" attribute. The following targets are allowed:
Target | Description |
$custdata | Files will be installed into the folder where custom user data is stored. By default, this is My Documents/OOTP Developments/OOTP Baseball. However, this could change if the user chooses to install custom data in a special directory. Custom data includes folders such as /ballcaps, /jerseys, and /logos. |
$userdata | Files will be installed into the folder where the user data is. By default, this is My Documents/OOTP Developments/OOTP Baseball. User data is basically the /saved_games directory. |
$basedata | Files will be installed into the base data folder. By default, this is Program Files/OOTP Developments/OOTP Baseball/data. |
$leaguedata | Files will be installed into the currently open league's saved_game directory. By default, this is My Documents/OOTP Developments/OOTP Baseball/data/saved_games/yourleague.lg. |
$leagueimages | Files will be installed into the currently open league's images directory. By default, this is My Documents/OOTP Developments/OOTP Baseball/data/saved_games/yourleague.lg/news/html/images. |
$leagueimages and target2=$teamlogos | Only valid in OOTP13. Files will be installed into the currently open league's team logos directory (/news/html/images/team_logos) |
$leagueimages and target2=$leaguelogos | Only valid in OOTP13. Files will be installed into the currently open league's league logos directory (/news/html/images/league_logos) |
Making Sure Your Add-On Installs Correctly
The key to success is making sure your archive saves relative path names. With a .tar.gz file, you have to select the folders from the base folder. For example: You want to create an add-on with player pictures. These pictures are in My Documents/OOTP Developments/OOTP Baseball/data/photos. You would open the base folder, which is My Documents/OOTP Developments/OOTP Baseball/data in this case, right click on /photos and select "Add to tar.gz file" if you have your TAR tool installed this way (and if you're a lucky user of MS Windows). Otherwise, you start your TAR tool, create a new archive and add the /photos folder to it. The TAR archive needs to save relative path names! You can easily check it out by opening the archive with the TAR tool: you should see the folders in it, like "photos" for this example.
If the target2 setting is $team_logos or $league_logos, OOTP will automatically delete the smaller logo files before installing the new logos. For example, it there's already a logo file some_team.png and the add on file contains the same logo. The league logo folder will certainly also contain files like some_team_16.png, some_team_25.png and so on. Before OOTP unpacks the new some_team.png, it will delete all files which start with some_team* from the logo folder.
Obviously, there is some trial and error involved in getting this set up, but once you do, it should be a breeze!
Getting Your Add-Ons to the Users
Once you've finished this setup, all that's left to do is to get this information to your users. The instructions for your customers should be simple. In fact, you can probably just cut and paste this text:
To download this mod, use the following steps:
- Open OOTP.
- Load any saved game.
- Select Game | Add-Ons Central.
- Click Add Server.
- Cut and paste this string into the dialog box, and hit Save: http://www.yourservername.com/path/xmlfile.xml
- The name of my server, "My Server Name," should appear in your list of Available Servers, and my add-on, "My Add-On Name," should appear in the list of Available Add-Ons.
- Click the Download button next to my add-on.
- When the download is complete, click on the Install button next to my add-on.
- Insert any further instructions for how to see the fruits of your labor!
OOTP stores a file in the data/addons directory called addons.xml, using the exact same XML schema as the one above. When a user adds your server to his list, your server's information is added to that user's local XML file, so that your server will be remembered until he manually removes it.
Testing Add-Ons
Start OOTP and open the add-ons central. Click on "Add Server" and add the following URL:
http://www.ootpdevelopments.com/ootp/addons/testfiles/ootptest.xml
This file contains a few test "add-ons" which you can download and install to see how it works. To open the file in your browser, click here.
As soon as you added the server, the add-on central will list the new files in the category "Test". Click "Download" to save a file on your hard disk drive. You'll find it in the folder /addons/downloads inside your OOTP data directory. To "uninstall" it, simple delete it from your disk and refresh the add-ons dialog.
To install it, click on "Install" in add-ons central. Once the test add-on is installed, you can find the new files in your OOTP data folder. For example if you downloaded the "Testfiles which will install in user data directory" (testuserdata.tar.gz) you'll find a file and a folder, each named "add-on_userdata_test" in your OOTP user data folder. Feel free to remove them again.
You can now use the file /addons/downloads/testuserdata.tar.gz to test your own add-on archive file. Just copy your file to /addons/downloads and name it testuserdata.tar.gz. Then the install button for this test file will install your archive and you can check if the files go to the proper folders.