The online racing simulator
Quote from sinanju :Would it be possible for lapper to have some sort of lapper or player time variables?

Maybe a StartTime and an EndTime, both outputting to at least 1/100th of a second?

There's already a getLapperVar( "LongTime" );, which is the server time in long format, but that only gives you hh:mm:ss.

Currently in the player vars RaceTotalTime tells you the elapsed time of the current race LapTime and the Split vars will tell you the lap time at each split so there is no real time accounting of the time on your current lap.

All these times are in milliseconds and can be converted to short time strings using numtoms or numtomsh
Hi, does anyone know how i can delete !drf scores ingame?
Im new and hope thats the correct category sorry
Quote from rolli7 :Hi, does anyone know how i can delete !drf scores ingame?

Assuming you still want drift scores recorded in the future, you can't.

However, if you don't mind deleting everyone's scores, then (assuming you run the server), if you delete the Drift database entries (DriftPB.dbs and DriftPB.elp) then that will delete all the drift scores.

Lapper will then make a new database when the next drift score is made.

If you only want to delete selected drift scores, then (if you use Firefox), there is an add-on called SQLite Manager, that can be used to edit the DriftPB.elp database). Use with caution.
Will it ever implemented collision check?

// IS_CON reports contact between two cars (if ISF_CON is set)
// IS_OBH reports information about any object hit (if ISF_OBH is set)
Quote from Lexanom :Will it ever implemented collision check?

// IS_CON reports contact between two cars (if ISF_CON is set)
// IS_OBH reports information about any object hit (if ISF_OBH is set)

I had started to implement collision checking into lapper but it is a difficult task. One of the main reason is that Lapper doesn't differentiate between UCIDs and PLIDs, which affects a number of things which is why using AIs with lapper is not recommended, so until we do some rewrites to separate those IDs, it's just not practical.

That being said, I do have most of the code done to support collision detection in a test build which may be released in the future. No promises though
Well, it will wait

//By the way. Why can not I use the mathematical extraction of the square root of floating point numbers? For example, the Pythagorean theorem:
$dist=($x*$x+$y*$y)^(1/2);
and the like not working..(
Quote from Krayy :Lapper doesn't differentiate between UCIDs and PLIDs

Eek! Considering the contexts that they are used in, that was an interesting design choice. Why did you guy go this route?
Quote from Lexanom :Well, it will wait

//By the way. Why can not I use the mathematical extraction of the square root of floating point numbers? For example, the Pythagorean theorem:
$dist=($x*$x+$y*$y)^(1/2);
and the like not working..(

It may be that you need to explicitly cast the variables to a numeric using the ToNum function as by default, Lapper variables are untyped and sometimes this causes issues when using them in expressions. Do some searching through the LPRs to see how to use ToNum
Quote from Dygear :Eek! Considering the contexts that they are used in, that was an interesting design choice. Why did you guy go this route?

I believe that this was a holdover from the first iteration of Lapper way before Gai took over. I had a couple of attempts at extricating them but it broke a few things further down the chain. It'll take a huge rewrite to get them separated, although it may happen one day.

<?php 
$X1
=10;
$Y1=10;
$X2=GetPlayerVar"lexanom""X" );
$Y2=GetPlayerVar"lexanom""Y" );
$distX ToNum$X1 $X2 );
$distY ToNum$Y1 $Y2 );
$dist = (($distX*$distX) + ($distY*$distY))^(1/2) ;

openGlobalButton"dst_",75,0,50,10,1,-1,0,strFormat"^0distance: {0:F3} m"$dist ) );
?>

distance: 171925


<?php 
$X1
=10;
$Y1=10;
$X2=GetPlayerVar"lexanom""X" );
$Y2=GetPlayerVar"lexanom""Y" );
$distX ToNum$X1 $X2 );
$distY ToNum$Y1 $Y2 );
$dist = (($distX*$distX) + ($distY*$distY)) ;

openGlobalButton"dst_",75,0,50,10,1,-1,0,strFormat"^0distance: {0:F3} m"$dist ) );
?>

distance: 171925


<?php 
$X1
=10;
$Y1=10;
$X2=GetPlayerVar"lexanom""X" );
$Y2=GetPlayerVar"lexanom""Y" );
$distX $X1 $X2 ;
$distY $Y1 $Y2 ;
$dist = (($distX*$distX) + ($distY*$distY))^(0.5) ;

openGlobalButton"dst_",75,0,50,10,1,-1,0,strFormat"^0distance: {0:F3} m"$dist ) );
?>

distance: 171925


<?php 
$X1
=10;
$Y1=10;
$X2=20;
$Y2=20;
$distX $X1 $X2 ;
$distY $Y1 $Y2 ;
$dist = (($distX*$distX) + ($distY*$distY))^(1/2) ;

openGlobalButton"dst_",75,0,50,10,1,-1,0,strFormat"^0distance: {0:F3} m"$dist ) );
?>

distance: 200

:something
Quote from Lexanom :

<?php 
$X1
=10;
$Y1=10;
$X2=GetPlayerVar"lexanom""X" );
$Y2=GetPlayerVar"lexanom""Y" );
$distX ToNum$X1 $X2 );
$distY ToNum$Y1 $Y2 );
$dist = (($distX*$distX) + ($distY*$distY))^(1/2) ;

openGlobalButton"dst_",75,0,50,10,1,-1,0,strFormat"^0distance: {0:F3} m"$dist ) );
?>

distance: 171925

I've added a sqrt function to Lapper which will appear in the 6.0.1.4 release.

e.g.

<?php 
            $X1
=10;
            
$Y1=10;
            
$X2=20;
            
$Y2=20;
            
$distX $X1 $X2 ;
            
$distY $Y1 $Y2 ;
            
$dist = ($distX*$distX) + ($distY*$distY);
            
privmsg "dist = " $dist " and sqrt is " sqrt ($dist) );
?>

= 14.14213
Now I use 6,012
Quote :sqrt ($dist)

Hooray!)
tnx


//Which file should be replaced, that the "sqrt" to work? After replacing LFSLapper.exe stopped working $distToDo=1
I used it for a quick update driftmeter. What should I do now? DelayedCommand (1 , ...) for far too long.
Quote from Lexanom :Now I use 6,012

Hooray!)
tnx


//Which file should be replaced, that the "sqrt" to work? After replacing LFSLapper.exe stopped working $distToDo=1
I used it for a quick update driftmeter. What should I do now? DelayedCommand (1 , ...) for far too long.

The sqrt function is built in to the Lapper.exe file, so you will need to update your installed Lapper to 6.014. Have a look at the readme in the docs directory and also check the error logs in your Lappers instance directory e.g. c:\Lapper\default\logs\127-0-0-1_39399_error.log
No errors, everything is working properly.
But min $distToDo=100, and I need =1
Or need another way to update driftmeter more often than once per second...
Quote from Lexanom :No errors, everything is working properly.
But min $distToDo=100, and I need =1
Or need another way to update driftmeter more often than once per second...

So your script is using the DistDone event to do something every meter a racer travels?
Yes! It's perverted, but I have not found another way to driftmeter update quickly.
Quote from Lexanom :Yes! It's perverted, but I have not found another way to driftmeter update quickly.

Okay, makes sort of sense, even though I think your Lapper server will get hammered. I've updated LFSLapper 6.014 to allow for any positive number to be allowed, so it won't reset it to 100. This code:

<?php 
            privMsg 
("distToDo = " getConfigVar("distToDo") );
            
setConfigVar("distToDo"10);
            
privMsg ("distToDo = " getConfigVar("distToDo") );
?>

Shows the results in the attachment
Attached images
lfs_00000001.jpg
Hello again!
Lapper can handle flags? I mean, yellow and blue flags during the race.

Could not find a suitable event or sub(
for example, send to chat "the player N is under blue flag"
Quote from Lexanom :Hello again!
Lapper can handle flags? I mean, yellow and blue flags during the race.

Could not find a suitable event or sub(
for example, send to chat "the player N is under blue flag"

Currently not. The handler is there but it's empty. i suppose we could add flag handlers to raise an OnBlueFlag or OnYellowFlag if hey would be useful.
I think it would not be superfluous

I need it for statistics on emergency situations, especially blue flag.
Quote from Lexanom :I think it would not be superfluous

I need it for statistics on emergency situations, especially blue flag.

So what kind of information would you need form the function? e.g:

OnBlueFlag( $player, $carbehind, $time)
OnYellowFlag ($player, $carbehind, $flagsthisrace)

or something similar so you get the player name and how long they have had a blue flag showing or a total of how many yellows they had this race.

What woudl be useful here?
I believe that the first
but I need to know what kind of car was the flag, on what lap it happened or what time of the circle
Quote from Lexanom :I believe that the first
but I need to know what kind of car was the flag, on what lap it happened or what time of the circle

You can get all of that information from the getPlayerInfo function (search the Lapper.lpr file for examples)
hello, several questions:
1. Is it possible to write to the file and can read a file?

For example
а) a third-party program saves some data to a txt file, and the lapper goes to the file and displays the data on the screen.
b) each passing lap lapper writes nickname and lap time to txt file, as "writeLine" command.

2. In the upper right corner of the game shows penalty, they are highlighted in red. Lapper can they be considered for further change? How do I get them?
What you need to do is use the 'Storedvalue.dbs' database, which is included in lapper.

You can put your own data in this database using SetStoredValue / GetStoredValue and SetCurrentPlayerVar / GetCurrentPlayerVar.

Bit hard to explain here how to use it, but have a look at Krayy's explanation HERE.

For real life examples, you could look at Yisc[NL]'s pitboard.lpr file (included with lapper), or, my dskill.lpr file HERE.

If you have Mozilla Firefox, you can get am add-on called SQLite Manager, that allows you to look (via firefox) into the Storedvalue.dbs database to see how data is collected, and the fields the data is collected in.

Requests
(342 posts, started )
FGED GREDG RDFGDR GSFDG