First, you have to understand the difference between DriftScore and LastDriftScore.
As you drive around picking up points for drifting, points collect for each individual drift as your LastDriftScore.
The score you have at end of lap/circuit is the DriftScore.
On your first drift, you will have collected points under LastDriftScore,and these points will also show under DriftScore. If you were to finish the lap (or circuit), it's this DriftScore which is saved as your high score.
If you do combo drifts (meaning you do a drift, slight gap between this drift and next but still keeping above minimum drift speed) then do another drift, then your LastDriftScore will change (based on your current drift) to whatever your new score is (might be higher or lower than your previous drift), but your DriftScore will show the total of both scores (LastDriftScore + LastDriftScore = DriftScore). Assuming you can keep above minimum speed till you finish lap, this DriftScore is saved as your high score.
Of course, if between one drift and another you happened to drop speed below minimum (or crash), your DriftScore would reset to zero.
I know this all looks complicated, but if you had the drift meter working, the above would make sense!
Or to put it another way, it's the LastDriftScore that would have to show under your splits, and DriftScore as final split/lap end.
I've got the splits working showing the DriftScore at that point.
I've got the DriftScore and LastDriftScore showing up at the right time in the right place.
The message on leaving the pits works.
So, onwards
How do I get the welcome screen (where it says friendly rank -/-) to use drift scores to rank instead of laptimes?
Now that I have got !drf working, is there a way of getting the top scores that are saved by the users Nickname - NOT their username? So that 2 people sharing a controller can sort their high scores by their nicknames.
Thank you
/me goes off in search of a new "command actions" section...
That means when the driver reaches a specific node or zone, then the speed will display.
BL1 is Blackwood
140 is the specific node on Blackwood
-78,200 is the specific zone on Blackwood, with 5 as how long message lasts
You need to go to racetrack and location where you want speed to display, and record the !zone or !node of your location.
I mainly use !node for speed on track, and !zone for messages about entering or leaving pits.
Once you have the !zone or !node co-ordinates, add an entry to your lapper config file.
Say you wanted speed to show on start/finish on Kyoto Oval (KY1), you would add ;
RegisterNodeAction( "KY1" , 4 , DisplaySpeed );
Thing is, you have to do this for every track configuration, and you may want to do more than 1 speedtrap if it's a big track.
On the plus side, if you change coding slightly, instead of speedtrap, you can put text, such as corner name, street name, warnings about specific corners, warnings about watching out for people leaving pits, your server name, etc, etc, etc.
For instance;
First register your node location on whichever track, along with sub-routine:
I think AngleVelocity just means that your car is moving (velocity) at an angle when car should be moving in a straight line. This also happens in a corner, where the back end is not following the front.
Instead of using "DriftAngle", try "AngleVelocity".
You may want to think about differentiating between car drifting one way or another (facing left or right). Especially if you don't want a negative angle showing up on your drift score meter.
PS You've got a full stop after the comma that follows the 32 (32=background colour of button), which is then followed by text field - don't think this will work.
To have all player var available take a look at file playerVars.txt in doc folder. i don't know if this file exist in your release. But in 5.9 you can refer to it to know all player var
You can copy and paste that is inside events, not the line Event yourEvent ( ), because in 5.9 Player Event have a new parameter $userName ( you don't have to use it if you want ).
Also take a look at your code because var are case sensitive now
GetCurrentPlayerVar( "username" ) not same as GetCurrentPlayerVar( "UserName" )
Take a look at varslapper.txt in doc folder for complete list of builtin var for player
5.9 it's very similar to 5.8, the big difference is that player event receive the username of the player who triggered this event, that's all. the rest catchevent and catchsub are a new feature, not obligation to use it, but recommended to have clean script.
Event OnNewPlayerJoin( $userName ) # Player event
openPrivButton( "drewpitleave",50,5,100,10,8,3,32, "^1! ^7R E M E M B E R^1 !"
. "&^7First lap after pits ^1may not ^7count!" );
EndEvent
This is the one that I want to make a new mwessage whenever someone leaves the pits.
I see your previous post about this feature. I try to put in LFSLapper but there is a problem to do that. In fact LFS send packet every 1/10 of second, but the distance that vehicle have done is wrong for this unit of time and by extension the speed is wrong. But near to true for 5 time unit (average speed).
In fact this is due to packet latency or lag
If i use this 1/10 of second unit, speed can climb up to 200km/h in one packet and 20km/h in next. The real speed is near 110 when i use more then 4 packet.
The GPS value can be correct every second, no under this value
there is a possibility if i make average of the 5 previous dist making a glissando for one step unit.
Example
avg of packets ( 1 2 3 4 5 )
then avg of packets ( 2 3 4 5 6 )
then avg of packets ( 3 4 5 6 7 )
i try if i can do that , if this can be done, the GPS speed is late about 500 millisecond relative to real speed
drew_welc2 = "^7Your best drift score: {0} &Don't act the fool&Respect your fellow drifters";
langEngine("%{drew_welc2}%",$bestDriftScore )
replace {0} with content of$bestDriftScore
Another example with 2 argument to langEngine
drew_welc3 = = "^7Hello {0} Welcome on {1}";
langEngine("%{drew_welc3 }%",$uname,"My Server Name" )
replace {0} with content of $uname
replace {1}with "My Server Name" ( without quote )
All identifier precede wth $ is variable
$uname is a variable that can contains text or numeric value
To set it use this syntax
$uname = "My var contain this text";
in this case $uname contains "My var contain this text";
$uname = GetCurrentPlayerVar( "UserName");
in this case $uname contains the player userName, "Gai-Luron" if it's me who connect to your server and trigger the event onConnect.
Gai-Luron
PS : For now you haven't access to the driftPb, i put it in next release