This isn’t really in the right forum section, but this is where a lot of people are asking for a meter that records a drift score, so I’m putting it here rather than the LFSLapper forum.
Hopefully this may stop a lot of repeat posts for the same thing.
LFSLapper Version
This drift meter will work with LFSLapper V 5.714 or earlier.
If you make extremely small change to the coding script, you should get it to work with V 5.716 too.
(There was a slight change in LFSLapper 5.716, in that the Personal Best and Drift databases lost the .txt suffix (i.e. V5.714 drift database its $DriftDatabase = "./DriftPB.txt, but in V5.716, it’s $DriftDatabase = "./DriftPB. So if you remove the .txt in the coding you can get it to work).
The coding is in 2 parts.
If you want to know what the majority of the coding actually means, see the attached text file. If you’re au fait with programming Lapper, then you’ll know it by heart anyway. It’s all fairly simple and basic stuff – which is why I could do it!
Anyway, now for the coding…
First part goes in the "Sub OnConnectClose()" section, which starts something like " closePrivButton("welc&pos&clos...."
Code has to be put in after closePrivButton, but before the EndSub at the end of the section.
The next section should overwrite your complete ‘Drifting options’ lapper section.
I've also included the 2 parts of the lapper code in a text file, which i've attached, to make it easier to copy and paste.
Remember to save backup copy of your original lapper file before you go changing it.
I take no responsibility for anything. Ask my kids.
If it all works, then I hope you enjoy. Any problems, then revert back to your saved backup copy.
PS I realise I could have used origL and origD for left and down instead of the long winded way I did it, but my way makes it much easier to reverse engineer (learn).
EDIT
-----
And for those of you who're still struggling, I've added the drift master meter coding into a vanilla LFSLapper.lpr (version 5.714) configuration. (File zipped as can't upload .lpr file).
-----
Hopefully this may stop a lot of repeat posts for the same thing.
LFSLapper Version
This drift meter will work with LFSLapper V 5.714 or earlier.
If you make extremely small change to the coding script, you should get it to work with V 5.716 too.
(There was a slight change in LFSLapper 5.716, in that the Personal Best and Drift databases lost the .txt suffix (i.e. V5.714 drift database its $DriftDatabase = "./DriftPB.txt, but in V5.716, it’s $DriftDatabase = "./DriftPB. So if you remove the .txt in the coding you can get it to work).
The coding is in 2 parts.
If you want to know what the majority of the coding actually means, see the attached text file. If you’re au fait with programming Lapper, then you’ll know it by heart anyway. It’s all fairly simple and basic stuff – which is why I could do it!
Anyway, now for the coding…
First part goes in the "Sub OnConnectClose()" section, which starts something like " closePrivButton("welc&pos&clos...."
Code has to be put in after closePrivButton, but before the EndSub at the end of the section.
openGlobalButton( "sinrs_dm_logo",5,98,36,6,4,-1,16,"^1Put your name/team name in this space" ); # Put your name/teamname or server or anything else you want in between the quotes - this text (^1) will be in red (see attached text file if you want to learn how to change the text colour)
openGlobalButton( "sinrs_dm_track",5,113,36,5,5,-1,16,"^3Track: ^2" . $LongTrackName . " ^1[" . $ShortTrackName . "]" );
openGlobalButton( "sinrs_dm_caranddriver",5,118,36,5,8,-1,16,"^6Car: ^2". $Car . "^7 - ^6Driver: " . $Nickname . );
openGlobalButton( "sinrs_dm_criteria",5,146,36,4,4,-1,16,"^4Scoring Criteria: "
. "&^7Minimum Drift Speed: ^330MPH / 48kph"
. "&^7Drift Angles (degrees): ^215^3 min / ^1100 ^3max");
openGlobalButton( "sinrs_dm_back",4,97,38,48,4,-1,32," " ); # Blank backing
openGlobalButton( "sinrs_dm _text",5,105,36,8,4,-1,16,"^0DRIFT MASTER ^1(c)Sin'rs" ); # 'DRIFT MASTER is in Black text
openGlobalButton( "sinrs_dm_driftblank",5,124,36,6,4,-1,80,"This Drift Score: " );
openGlobalButton( "sinrs_dm_comboblank",5,131,36,6,4,-1,80,"Total Combo Score: " );
openGlobalButton( "sinrs_dm_angleblank",5,138,36,6,4,-1,80,"Drift Angle: " );
openPrivButton( "sinrs_dm_score",30,124,11,6,4,-1,128,"- - - " ); # Blank. Score will overlay once you start scoring drift points
openPrivButton( "sinrs_dm_combo",30,131,11,6,4,-1,128,"- - - " ); # Blank
openPrivButton( "sinrs_dm _angle",30,138,11,6,4,-1,128,"> - < " ); # Blank
openGlobalButton( "sinrs_dm_criteriablank",4,145,38,14,3,-1,32," " );
The next section should overwrite your complete ‘Drifting options’ lapper section.
#================#
#Drifting options #
#================#
$DriftDatabase = "./DriftPB.txt"; # This is the filepath for a file containing the collected data.
$MinimumDriftSpeed = 48; # Minimum speed in km/h to maintain. Driving below that speed will reset score (48kmph is approx 30MPH)
$MinimumDriftAngle = 15; # Minimum angel to maintain. When angle is below value, score is reset
$MaximumDriftAngle = 100; # Maximum angel to maintain. When angle is above value, score is reset
$GoodDriftScore = 2000; # Value to be reached to execute action on good drift score
$MinimumDriftScore = 250; # Minimum drift score required
Event OnDriftScore()
IF( $AngleVelocity < 0 )
THEN
$AngleVelocity_reverse=($AngleVelocity)*(-1);
openPrivButton( "sinrs_dm_score",30,124,11,6,4,-1,128," ^7" . $LastDriftScore ); # Gray text with white score
openPrivButton( "sinrs_dm_combo",30,131,11,6,4,-1,128," ^2" . $DriftScore ); # Gray text with green score
openPrivButton( "sinrs_dm_angle",30,138,11,6,4,-1,128," ^7" . $AngleVelocity_reverse . "^2 =>" ); # Gray text with white score and green arrow
ELSE
openPrivButton( "sinrs_dm_score",30,124,11,6,4,-1,128," ^7" . $LastDriftScore ); # Gray text with white score
openPrivButton( "sinrs_dm_combo",30,131,11,6,4,-1,128," ^3" . $DriftScore ); # Gray text with yellow score
openPrivButton( "sinrs_dm_angle",30,138,11,6,4,-1,128," ^1<= ^7" . $AngleVelocity . " " ); # Gray text with white score and red arrow
ENDIF
EndEvent
# Message that will be shown to all on a drivers new personal best drift lap.
Event DriftPBAction()
cmdLFS( "/rcm " . $Nickname . "^3 made new drift PB: ^7" . $DriftScore . " ^3pts!" );
cmdLFS( "/rcm_all" );
EndEvent
# Message that will be shown when total lap drift score is higher or equal to MinimumDriftScore.
Event DriftLapAction()
cmdLFS("/msg " . $Nickname . " ^3drifted to ^7" . $DriftScore . " ^3pts" );
EndEvent
# Message that will be shown to all when driver makes a good drift score
Event GoodDriftAction()
cmdLFS( "/rcm " . $Nickname . " ^3made excellent drift: ^7" . $LastDriftScore ." ^3pts" );
cmdLFS( "/rcm_all" );
EndEvent
# Message that will be shown to all if a driver fails to score a minimum amount
Event DriftTooLowAction()
cmdLFS( "/rcm " . $Nickname . " ^3was absolutely rubbish!" );
cmdLFS( "/rcm_all" );
EndEvent
I've also included the 2 parts of the lapper code in a text file, which i've attached, to make it easier to copy and paste.
Remember to save backup copy of your original lapper file before you go changing it.
I take no responsibility for anything. Ask my kids.
If it all works, then I hope you enjoy. Any problems, then revert back to your saved backup copy.
PS I realise I could have used origL and origD for left and down instead of the long winded way I did it, but my way makes it much easier to reverse engineer (learn).
EDIT
-----
And for those of you who're still struggling, I've added the drift master meter coding into a vanilla LFSLapper.lpr (version 5.714) configuration. (File zipped as can't upload .lpr file).
-----