The online racing simulator
!drf and driftscore question
Hi fellow racers!

I just started to study the LFS lapper and find it a great tool. I intend to run a driftserver.

I have searched the forums for a specific question (studied the "Lfs lapper help (drift points) " thread) but failed to find a solution.

I use LFS Lapper 5.9.2.5.

QUESTION: How do I make !drf display drivers driftpoints? (or is that table even for drift scores?)

Is it something simple or do I need to make an ftp server to make the results available? As it is now, I record the scores in ./Default/DriftPB.ELP (and ..DriftDB.DBS I guess?). I can see the drift PB's in DriftPB.ELP along with the driver names etc - on my harddrive (default path for Lapper). The driftmeter and scoring works ok during the race, but when typing !drf, there is nothing there (see attatched picture).

I suspect I need to do some editing in the drift options section for various events?
This is what my code looks like at the moment (as you see there is nothing);

$DriftDatabase = "./DriftPB";
$MinimumDriftSpeed = 50; # Minimum speed in km/h to maintain. Driving below that speed will reset score
$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

# Actions to do on new personal best drift lap.
Event OnDriftPB( $userName ) # Player event

EndEvent

# Actions to do to when total lap drift score is higher or equal to MinimumDriftScore.
Event OnDriftLap( $userName ) # Player event

EndEvent
Event OnDriftScore( $userName ) # Player event

EndEvent

$GoodDriftScore = 4000; # Value to be reached to execute action on good drift score
Event OnGoodDrift( $userName ) # Player event

EndEvent

$MinimumDriftScore = 10; # Minimum drift score required

# Actions to do at end of lap if MinimumDriftScore is not achieved.
Event OnDriftTooLow( $userName ) # Player event

EndEvent

# Actions to do when drift score is resette to zero when to low speed.
Event OnDriftResetScore( $userName ) # Player event

EndEvent

Grateful for any help. Meanwhile, I will hunt for threads I might have missed. .

Cheers!
Attached images
drf_table.jpg
Looks like the driftmeter is working properly, otherwise you wouldn't have it displayed.

By the way, most of the drift coding in V5.925 no longer in the LFSLapper.lpr file. Instead, you should have a directory called includes (..Lapper\v 5 925\bin\default\includes). In this folder is a file called driftmeter.lpr. This is the file with all the drift config code.

In same folder is file called addonsused.lpr. I assume that you've already changed
Quote :#### Include for drifting infos ####
#include( "./driftdef.lpr");
# OR
#include( "./driftmeter.lpr");


to read
Quote :#### Include for drifting infos ####
#include( "./driftdef.lpr");
# OR
include( "./driftmeter.lpr");



Note that a hash (#) has been taken away at start of last line.

Likely that your problem relates to the default top car setting in the LFSLapper.lpr file.

You may have something like $DefaultTopCar = "XFG";

In which case, probably 2 choices.

When typing !drf, you can try specifying a particular car (preferably the one you just got your drift score with), e.g. !drf xrt, and see if that puts detail into the table.

Else, change the default top car to
$DefaultTopCar = "UFR+XFR+RB4+RAC+FZR+XRR+FXR+FBM+LX4+LX6+XFG+XRG+XRT+FZ5+FXO+VO8+FOX+MRT+UF1+BF1";

This will make all cars default, and should make your table display all the scores for any car.

See how you get on with this first, and if still having problems, let us know.

Good luck.
Solved!
Solved!
Haha, hit me with a chair! :chairs:

I just found out myself, that my default car(s) was set to "XFG" and I did all my trial & error in the XRT. And of course, l would have solved it with your help sinanju! Thanks for quick reply . I believed the default cars were "adjusted" with the !gui on the host. Easier to have it in the scrips tho.

Also, yes, I am experimenting with the "included" parts. Very nice tools.

There will be more questions coming up later on! Probably involving an automatic pop up of drifting scores at the end of the race.

I guess to reset the PB's - all I have to do is delete the recorded DriftPB ELP/DBS files?

Cheers for now!
Quote from Ingolf :automatic pop up of drifting scores at the end of the race.
I guess to reset the PB's - all I have to do is delete the recorded DriftPB ELP/DBS files?

Pop up - likely any coding would have to be added to the
Event OnResult( $userName,$flagConfirm ) # Player event
part of coding.

Reset PB's - Why do you want to reset PB's?
If you/others do same car/track combo, and increase your best score, then database automatically overwrites with better score.
sinanju,

Quote :Reset PB's - Why do you want to reset PB's?

Well, I've just done some trial & error with my scoring system, so I might want to reset the standings once I'm satisfied and rdy to launch.


About the driftscore calculation: where does this take place? I couldn't track down the actual calculation line. Is it done within the source code of Lapper or can it be done in the scripts you provided with LFS Lapper?

The reason I am asking is because I may want to experiment with a few more parameters like LapTime, average lap velocity etc. Where would I invoke the LapTime variable in order to make $DriftScore include such a parameter?

The driftscore itself would be the same as before, I just want to adjust the total driftscore everytime a player passes the finishline in such that the total driftscore also depend on the laptime. That final adjusted score would then go into the DriftPB records.

Again, thanks for a superb tool sinanju & Gai-Luron!

PS: I get a message after a "good" drift in upper left saying: (id main_ongooddrift notfound). What is wrong? DS
Quote :Well, I've just done some trial & error with my scoring system, so I might want to reset the standings once I'm satisfied and rdy to launch.

Better just to leave them, and give someone something to aim against. In fact, might be worth doing drifts in other cars too, so people can try beat your scores.

Quote :About the driftscore calculation: where does this take place? I couldn't track down the actual calculation line. Is it done within the source code of Lapper or can it be done in the scripts you provided with LFS Lapper?

Built into Lapper with the $DriftScore and $LastDriftScore variables (one of which gives you score for individual drifts, and other gives score at end of lap).

Quote :The reason I am asking is because I may want to experiment with a few more parameters like LapTime, average lap velocity etc. Where would I invoke the LapTime variable in order to make $DriftScore include such a parameter?

Probably under Event OnLap( $userName ) # Player event

But best to CatchEvent in the driftmeter.lpr file.

Look in the doc folder (bin folder holds all the config and lapper files) for player variables, changes (which gives lots of examples of how coding could be used), etc.

Quote :The driftscore itself would be the same as before, I just want to adjust the total driftscore everytime a player passes the finishline in such that the total driftscore also depend on the laptime. That final adjusted score would then go into the DriftPB records.

Likely that you'll need to experiment with IF..THEN..ELSE..ENDIF statements.

Good luck
Thanks alot!

I'll try to make some constructive lines within the driftmeter.lpr with your tips in mind.

I just noticed that I get a message saying (like I mentioned above): (id main_ongooddrift notfound). Appears in top left after a fairly good drift "event".

Some nickname confusion?

EDIT: I simply bypassed the line with #. But I am not sure how it affects the overall global messaging.

Cheers.
Part of the language file must be missing. Or is wrong.

Search in the driftmeter.lpr file for main_ongooddrift.

If you find it, change the word main to driftmeter.

I think it was a bug I pointed out a while ago, and thought had been changed in newer versions of lapper.
Problem With the !dstats
I'm using the latest version of Lapper. Read/Write access on the folder where PBdrift is located. !drf xrt works (a list with top drift scores pops up) !dstats username wont work at all?

FGED GREDG RDFGDR GSFDG