Trying to get points ranking to order by points taken and points given.
For example: 12-0 should rank above 12-9.
Using the score system.
http://unveiledcodex.co.uk/leagues/hearthstone
How would I be able to do this?
Trying to get points ranking to order by points taken and points given.
For example: 12-0 should rank above 12-9.
Using the score system.
http://unveiledcodex.co.uk/leagues/hearthstone
How would I be able to do this?
Are you ranking by winning percentage? If so that's a fairly easy adjustment and could be accomplished by one of the other sports files. I think I had built that into baseball, so if we need to build a sport file for your particular need, we can do that.
The system is each match is a set of 3 games. First to 3 and each game one is 3 points.
Want to rank by the first set of points first and if they're equal then to rank by the second set so for example:
21 - 6
18 - 0
18 - 6
18 - 9
15 - 3
12 - 0
etc.
As a temporary solution, try this:
Go to your league's preference settings, in the 'Point Rule' setting select 'User defined'. You'll get five boxes that allow you to set how points are awarded for wins, wins in overtime, ties, losses, and losses in overtime. It looks like you are awarding three points for a win, so set the first box to 3, then set the fourth box to -0.01. This way the losses will be negative, but not so much as to drop an 18-9 team below a 15-3 team. On the standings page only integers are shown, but in the database the numbers are floating with two decimal points.
Thanks, found a more permanent solution. Your hint about sports files made me create a custom sport that had this as its rank team method:
function rankTeams( $teams )
{
foreach ( $teams AS $key => $row ) {
$plus[$key] = $row->points['plus'] + $row->add_points;
$minus[$key] = $row->points['minus'];
$done[$key] = $row->done_matches;
}
array_multisort($plus, SORT_DESC, $minus, SORT_ASC, $done, SORT_ASC, $teams);
return $teams;
}
Excellent, an even better solution that you can tweak if needed...
You must log in to post.