New base calculation for PilotStatistics

For bug reports and fixes, installation issues, and new ideas for technical features.

Moderator: SEOW Developers

Post Reply
Riksen
Posts: 125
Joined: Thu 17 Jan 2013 2:35 am
Location: Florida, USA
Contact:

New base calculation for PilotStatistics

Post by Riksen »

Hi again Shades,

I have a question if you dont mind. I'm trying to adjust the base calculation for the Gross Combat Score value seen in the pilot statistics.

I would like the normal Air+Surface+Casualty value to be multiplied by the survival rate in order to give a more fair score (in my opnion players have to value their virtual lives more than the number of kills per se) so i tried to add to the following code into line 298 of the MP - PilotDetails.php:

$CasualtyValue = -$KIAValue - $MIAValue;
print '<span class="small" style="color: '.SSkinText().';" title="Total Production Cost of Kills">'.LL($L->screen->PilotDetails->grossscore).':<br>&nbsp;&nbsp;&nbsp;<b> '.$AV.' ('.LL($L->screen->PilotDetails->air).') + '.$SV.' ('.LL($L->screen->PilotDetails->surface).') - '.$CasualtyValue.' ('.LL($L->screen->PilotDetails->casualty).') * '.sprint(($AK + $MIA)/$NMissions).' ('.LL($L->screen->PilotDetails->sortiesurvival).') = '.($AV+$SV-$CasualtyValue*($AK+$MIA)/$Missions*).'</b></span><br>';

but I keep getting a syntax error. What am I doing wrong?

Thxs for ur patience ...

Riksen
Riksen
Posts: 125
Joined: Thu 17 Jan 2013 2:35 am
Location: Florida, USA
Contact:

Post by Riksen »

Someone?
II/JG77Hawk_5
Posts: 162
Joined: Wed 10 Jan 2007 1:13 am
Location: Sydney, Australia

Post by II/JG77Hawk_5 »

As you noted in your OP it'll require some patience as this really is a very specific question that requires 4Shades analysis. Its out of my area of expertise thats for sure.
IV/JG7_4Shades
Posts: 2211
Joined: Mon 08 Jan 2007 11:10 pm
Location: Perth, Western Australia

Post by IV/JG7_4Shades »

Hi Riksen,

Here are some quotes to help you:
In coding, as in space, no-one can hear you scream.
The loneliness of the long-distance coder
etc etc. :)

There is an essential rule in coding. If you start with something that works, make a change and it doesn't work any more, then your change added a bug and it is your responsibility to fix it (because you are alone in "code space" and any question you ask will not be answered by anyone else for hours/days, if ever). To fix it, roll back your change(s) one by one and examine the results in turn. Laborious, I know, but a great way of learning.

In your case, the problem is here. Can anyone see it?

Code: Select all

($AV+$SV-$CasualtyValue*($AK+$MIA)/$Missions*)
It is the second *. It shouldn't be there, a simple typo. There may be other bugs besides.

Another hint, if you have error reporting enabled in your php.ini file, then any syntax errors will be reported to your web server error log file. Very handy when all else is lost.

Cheers,
4S

PS: Welcome to the coders' club!
IV/JG7_4Shades
SEOW Developer

Image
Riksen
Posts: 125
Joined: Thu 17 Jan 2013 2:35 am
Location: Florida, USA
Contact:

Maybe I shouldnt have....

Post by Riksen »

Perhaps Shades I shouldnt've gotten into it lol....

I fix the typo and check where it leads me. Anyway any chance u got the other code to work? The one related to the Pilot photos I sent u as a private message?

Regards
Post Reply