The Tournament Director Forums

Main => Help Me => Topic started by: CHJarzza on June 07, 2017, 08:36:39 AM

Title: Automatic prizes - complex formula?
Post by: CHJarzza on June 07, 2017, 08:36:39 AM
I need help with automatic prizes. I would like to make code that makes number of players in automatic prizes to be [number of buy-ins+(number of re-entries/2)]. How?

-J
Title: Re: Automatic prizes - complex formula?
Post by: Corey Cooper on June 07, 2017, 12:32:56 PM
You'll have to edit the file "autoPrizes.xml" yourself, using Notepad or any other text editor.  In it you'll see a section like this:

  <levelSelection method="predefined">
    <predefined countBuyins="true" countRebuys="false" countAddOns="false" />
    <formula text="buyins + (totaladdons * 2)" />
  </levelSelection>


Replace the formula text with your own:

  <levelSelection method="predefined">
    <predefined countBuyins="true" countRebuys="false" countAddOns="false" />
    <formula text="buyins + (totalrebuys / 2)" />
  </levelSelection>


Note that the TD app doesn't support re-entries at this time, so I've replaced it with rebuys.

To find the file, go to the Preferences tab and press the "Config Files" button.  Select "Prizes Files" and then press the Browse button under "Automatic Prizes Configuration".  That will open the folder to the autoPrizes file.  You can right-click the file and select "Edit".
Title: Re: Automatic prizes - complex formula?
Post by: CHJarzza on June 07, 2017, 02:12:22 PM
Where is the error?
Title: Re: Automatic prizes - complex formula?
Post by: Corey Cooper on June 07, 2017, 04:19:40 PM
It's missing the <prizeConfig> line at the top:

<?xml version="1.0" encoding="UTF-8"?>
<!--
  The Tournament Director
  Copyright (c) 2004 - 2010 Corey Cooper
  -->
<prizeConfig>
<prizeLevels>
  <prizeLevel minPlayers="1" maxPlayers="14">


Also (unrelated to the error) the "method" attribute needs to be changed:

<levelSelection method="formula">
    <predefined countBuyins="true" countRebuys="false" countAddOns="false" />
    <formula text="buyins + (totalrebuys / 2)" />
  </levelSelection>
Title: Re: Automatic prizes - complex formula?
Post by: CHJarzza on June 08, 2017, 11:24:48 AM
Thank you!