Page 1 of 1

Pilot Ratings

Posted: Sun 23 Feb 2014 8:19 am
by Riksen
Hi everyone,

I finally was able to get the photos to work in the statistics and thank u everyone who gave me a hand on that but it seen Riksen is always tweaking something in the databases lol...

My question now is how do i change the requirements to achieve each pilot rating rank in the statistics. Lets say to become an ace the pilot would, for example, require 20 kills or 10.000 points?

Thxs again

Riksen

Posted: Sun 23 Feb 2014 9:36 am
by IV/JG7_4Shades
In stats_functions.php there is a function that calculates pilot ratings. You can edit it yourself as you see fit.

Here is the default code:

Code: Select all

//Algorithm for the pilot rating.
function Pilot_Rating($Sorties,$AK,$SK,$IK,$KIAMIA) {
	extract($GLOBALS);

	if ($Sorties < 3) {return LL($L->screen->PilotDetails->skill0);}

	//pre-Aces rating method
	//$simpleRating = Floor((3*$AK+$SK+$IK)/$Sorties - $KIAMIA);

	//Aces rating method
	//$simpleRating = Floor((3*$AK+$SK+$IK) - 8*$KIAMIA);
	$simpleRating = Floor((3*$AK+$SK+$IK) - 5*$KIAMIA);
	if ($Sorties < 5) {
		$simpleRating = Min(-1,$simpleRating);
	}
	else if ($simpleRating < 10) {
		$simpleRating = Max(0,$simpleRating);
	}
	else if ($simpleRating < 15) {
		$simpleRating = Max(1,$simpleRating);
	}

	if ($simpleRating < 0) {
		return LL($L->screen->PilotDetails->skill0);
	}
	else if ($simpleRating == 0) {
		return LL($L->screen->PilotDetails->skill1);
	}
	else if ($simpleRating == 1) {
		return LL($L->screen->PilotDetails->skill2);
	}
//	else if ($simpleRating >= 2 && ($AK > 5 || $SK+$IK > 15)) {
//		return LL($L->screen->PilotDetails->skill3);
//	}
	else if ($simpleRating >= 2 && $KIAMIA/$Sorties < 0.35 && ($AK/$Sorties > 0.75 || ($SK+$IK)/$Sorties > 2.25)) {
		return LL($L->screen->PilotDetails->skill3);
	}
	else {
		return LL($L->screen->PilotDetails->skill2);
	}
	return LL($L->screen->PilotDetails->skill0);
}
Cheers,
4S

Posted: Tue 25 Feb 2014 8:10 am
by Riksen
Thxs Shades!! Got it!