Author Topic: Automatic prizes - complex formula?  (Read 104 times)

CHJarzza

  • Newbie
  • *
  • Posts: 11
    • View Profile
Automatic prizes - complex formula?
« 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

Corey Cooper

  • Administrator
  • Hero Member
  • *****
  • Posts: 5402
    • View Profile
Re: Automatic prizes - complex formula?
« Reply #1 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".

CHJarzza

  • Newbie
  • *
  • Posts: 11
    • View Profile
Re: Automatic prizes - complex formula?
« Reply #2 on: June 07, 2017, 02:12:22 PM »
Where is the error?

Corey Cooper

  • Administrator
  • Hero Member
  • *****
  • Posts: 5402
    • View Profile
Re: Automatic prizes - complex formula?
« Reply #3 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>

CHJarzza

  • Newbie
  • *
  • Posts: 11
    • View Profile
Re: Automatic prizes - complex formula?
« Reply #4 on: June 08, 2017, 11:24:48 AM »
Thank you!