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> <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
New base calculation for PilotStatistics
Moderator: SEOW Developers
-
- Posts: 162
- Joined: Wed 10 Jan 2007 1:13 am
- Location: Sydney, Australia
-
- Posts: 2211
- Joined: Mon 08 Jan 2007 11:10 pm
- Location: Perth, Western Australia
Hi Riksen,
Here are some quotes to help you:
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?
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!
Here are some quotes to help you:
In coding, as in space, no-one can hear you scream.
etc etc.The loneliness of the long-distance coder
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*)
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
SEOW Developer
Maybe I shouldnt have....
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
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