The online racing simulator
Searching in All forums
(446 results)
Krayy
S2 licensed
Quote from paul88 :is it poss with lapper or race control manager to give a penalty lower than 30 secs or a grid drop (ie 5 places) after qualify and before race start ?

LFS allows for a REOrder packet to be sent to the server to reorder the grid any way that you want. We started to implement this code but ran out of steam before it got fully implemented. May get around to it if S3 comes out.
Krayy
S2 licensed
Quote from Bass-Driver :hi

My lapper is reacting very slowly sometimes.
it takes few seconds when Lapper detect that someone crossed the finishline. The finishline is very importent for my twinsystem.

is there a solution to fix it??

PC specs:
CPU: i3 3220 @ 3.30 Ghz
Ram: 4 GB
Network: 1Gb card
ISP Down/Up speed: 60mbit/6mbit

Lapper CPU Load: 1 a 3 % and 30 a 40 MB Ram

You shouldnt need to catch them as they come over the line as the finish position would be stored in the player vars:
$finishPos = GetCurrentPlayerVar("FinishedPos");
Krayy
S2 licensed
Hi guys,

I've been away from LFS for a while and at the behest of some others, I've finally updated the code to hopefully support the TCP queuing that was introduced in Insim 6, thanks to Gai's 6.0.1.3 release. I've alose removed the code that was planned to do contact detection as it is not compatible with Lapper internals.

My regular group has stopped racing LFS so I have been unable to test it with more than 2 connections which seemed fine, so could people running 6014 please update the binaries and let me know how you get on.

Regards,

Krayy
Krayy
S2 licensed
Hi all,

I've just noticed the threads about the issues with the new InSim packet queuing so have updated 6.0.1.4 with GL's code to hopefully fix the problems.

Hopefully I will have more time in the New Year to dedicate to Lapper as this year has been exceptionally busy work wise.

happy new Year all
Krayy
S2 licensed
One thing I can say is that with lapper scripts you really need to do a lot of bounds testing, such as when you do the GetPlayerVar(Pointsrun1), you need to be very sure that you test the output to make sure that it returned a valid Number, othersie the DBTotal additions will fail. You can use the IsNum function to test that.


<?php 
WHILE($PointsMax >= 1)
    
$Racers getListOfPlayers("N");
    FOREACH( 
$maVar IN $Racers )
        IF (
GetPlayerVar($maVar["value"],"JoinedDerby") == "1"THEN
        $thisPointsrun 
GetPlayerVar($maVar["value"],"Pointsrun1");
            IF ( 
IsNum($thisPointsrun) == TRUE THEN
                
IF ($thisPointsrun == $PointsMaxTHEN
                    $DBTotal 
GetUserStoredNum($maVar["value"], "DPTotal");
                    
$DBTotal $DBTotal+$PointsMax;
                    
SetUserStoredValue($maVar["value"], "DPTotal" $DBTotal);

                    
SetPlayerVar($maVar["value"], "JoinedDerby","0"  );
                    
openGlobalButton"name_" $maVar["value"],$point_L,$point_T+1,21,4,3,-1,96,"^7" GetPlayerVar($maVar["value"],"NickName") );
                    
openGlobalButton"ontrack_" $maVar["value"],$point_L+21,$point_T+1,6,4,3,-1,32,"^3" GetPlayerVar($maVar["value"],"Pointsrun1"));
                    
$point_T=$point_T+4;
                ENDIF
            ENDIF
        ENDIF
    ENDFOREACH
    
$PointsMax=$PointsMax-1;
ENDWHILE
?>

Krayy
S2 licensed
use getStoredNum (defaults to -1 if doesnt exists ) instead of getStoredvalue (returns a NULL) to ensure that you are returning a valid numeric. e.g.



<?php 
CASE "!dplist":
    
# Get default value if not already defined
    
$DPTotal GetStoredNum($userName"DPTotal");
    IF( 
$DPTotal == -THEN
        $DPTotal 
5;
    ENDIF
    
# Now set it in player
    
$DPTotal $DPTotal 5;

    
SetPlayerVar($userName "DerbyPoints" $DPTotal);     
    
SetStoredValue($userName "DPTotal" $DPTotal);
    
privmsg(GetPlayerVar($userName,"DerbyPoints") ."/".GetStoredNum($userName "DPTotal"));
    
topUser"DP System","DPTotal","DESC",argv );
BREAK;

?>

Krayy
S2 licensed
Timers are tricky in Lapper because the app is running indepedantly of the LFS server and also only displays information to you as buttons on the client.

This induces a certain period of lag, as any timer needs to first calculate the time to display then cycle through all connections one by one updating the button used to display that timer. Each client will have a particular response time (say 20ms to 200ms) that adds to the time each update takes.

This is why sometimes with you use the %cnt% variable in a text button it will count down but may skip a number...it is taking more than 1 second to cycle through all of the clients.

Technically a function to create a button and update it with a timer, time of day etc, but there is no guarantee that it would be smooth.

maybe in the next version of InSim they will add functions that can do a simultaneous write or button update to all connections, which would solve the problem, but until then i could have a look but it would not be 100% accurate or smooth.

BTW, what sort of time do you want to display, race time, time of day?
Krayy
S2 licensed
Quote from Yisc[NL] :Does Lapper need an update when the new LFS patch comes out, or shouldn't that cause any troubles?

The devs guarantee backwards compatibility (as far as I know anyway), so future point updates to LFS should not require Lapper to be updated.

That being said it does require updates to support InSim features that get modified or implemented.
Krayy
S2 licensed
Quote from Bass-Driver :Could someone explain me what this error means and how to fix it.

9/16/2012 1:43:46 PM -> Warning packet not catched (55)

thx

It means that Lapper received a packet from the LFS server via InSim that it does not understand, i.e. a handler has not been written for it yet

Things that were introduced in InSm 6 will do this like IS_CON (contact), IS_OBH (object hit) or IS_HLV (hotlap validation).

its informational rather than critical

P.S. Insim message 55 is ISP_ACR, // 55 - info : admin command report (someone tried to run an admin command when they do not have admin rights)
Krayy
S2 licensed
lapper does not support regular expressions like you are trying to do.

You could use the substr function to extract the first character and use IsNum to see if it is a numeric like this:


<?php 
$Char 
subStr$text,0,);
    IF ( 
IsNum($Char) == TRUE )
    
THEN
....
?>

or for your example:

$Char = subStr( $argv,0,1 );
IF ( $argv != "" && IsNum($Char) == TRUE && ToNum($argv) >= 1) THEN
...
I use ToNum as Lapper is not a typed language so this function explicitly casts it as a Numeric.
Krayy
S2 licensed
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)
Krayy
S2 licensed
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?
Krayy
S2 licensed
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.
Krayy
S2 licensed
Quote from Bass-Driver :i already did xd
also added code for reading the skinname
and its running perfect

edit: do u know something about this post??
http://www.lfsforum.net/showthread.php?p=1730662#post1730662

Hmmm...I have absolutely no idea.
Krayy
S2 licensed
Quote from Bass-Driver :i have tried that but nothing happends

ill go change the code later and also try to implement to set the users SkinName.

Idea to make a protection:
Protection for wearing someones teamskin if you are not in a team.

I've put the numberplate code into the latest realease of 6.014, so grab it from the thread and have a play.
Krayy
S2 licensed
New updates for v012...

Lapper crashed when the server pasword was wrong, so I have now change the default ini file to have a blank password and when lapper sees a lapper instance with a blank password it will show an error in the console. So when doing the initial install, run LFSLapper which will cerate the default directory, then you will need to close Lapper, edit the default_ini file with the server password and then restart.

Added the "NumberPlate" player var which is populated when a player joins a race or renames their Plate...use like this:


<?php 
        
CASE "!pl":
                
privMsg "^7Plate: " GetCurrentPlayerVar"NumberPlate" ) );
            BREAK;
?>

Krayy
S2 licensed
Quote from Bass-Driver :hi
...
in the LPR files itself i added the command:

CASE "!pl":
privMsg( "^7Plate: " . GetPlayerVar( $userName, "NumberPlate" )); BREAK;

did i forgot something?? i think its something small


the only text i see is : host: (Debug) Read NumberPlate


CASE "!pl":
privMsg( "^7Plate: " . GetCurrentPlayerVar( "NumberPlate" ));
BREAK;

Krayy
S2 licensed
Most obviously is that you are not assigning the value anywhere. If you have alook for the value Plate in the InSim5.txt file (which details all of the insim functions), you will see that the Plate variable exists in the NPL (New Player), RES (Result) and CPR (Connection player rename) so what you will need to do is set the Players Plate variable in the relevant function in the managepacket.cs file i.e.:


<?php 
        void managePacket
(InSim.Decoder.NPL newPlayer)
        {
...
            
currInfoPlayer.OnTrack true;
            
currInfoPlayer.Plate newPlayer.Plate;
...
?>

Now you have a value that you can use in your script. I might as well throw this into the codebase as it may come in useful.

P.S. Just put it in and tested it and it all works correctly. Note that the plate will not be valid until the player joins a race, as that's when the NPL InSim packet is sent, not when they connect which is NCN. I also treid renaming my plate (which returns a CPR packet) and that worked as well.

Will post it soon.
Last edited by Krayy, .
Krayy
S2 licensed
Quote from NovaK :I would like two permissons to have access to the same command code, but how much i've tried to make this, i've failed. I want normal admins AND eventusers to be able to execute this...

Original code snippet:
CASE "!clear":
IF ( UserIsAdmin( $userName ) == 1 )
THEN
cmdLFS( "/axclear" );
ELSE
privMsg("You don't have enough access to execute this command!");
ENDIF
BREAK;

Tried this: (But gives EVERYONE access)
UserGroupFromFile( "eventusers", "./eventusers.txt" );
IF( UserInGroup( "eventusers",$userName) OR ( UserIsAdmin( $userName ) == 1 ) )

What am i doing wrong? Help please.

You might want to check your error log and see if there is a message about using "OR" instead of ||. Try this:

UserGroupFromFile( "eventusers", "./eventusers.txt" );
IF ( UserInGroup( "eventusers",$userName) == 1 || UserIsAdmin( $userName ) == 1 )

failing taht, use the "!ma" command to load the member admin screen and raise the users rights to Admin
Last edited by Krayy, .
Krayy
S2 licensed
Quote from therbo :Yep i'm admin in the !ma screen and also in the txt files also using logging in with&without the admin password.
Even if i type !mins fsdafd (text not number) no error message appears as it looks as tho it should from the script

Well I found the problem...I had not included the code for the isNum function in the 6.014 binary. I have now rectified that so it will work if you download the updated zip file (v011)
Krayy
S2 licensed
Quote from therbo :Thanks Krayy.. I can't seem to get the !mins or !kms to work however.
If i type !mins 15 to start a 15min race it doesn't seem to change anything in the server(no on screen messages either). only if i type !mins do i get a response stating that the server is back to laps.

Am i missing something?

Are you logging in as an Administrator and if you type "!ma", if your username is not set as an admin use the + button to raise your permissions.
Krayy
S2 licensed
Quote from [Audi TT] :I this translations.

the true command?
SetCurrentPlayerVar( "IdLang","RU");


Yes. You could put that command in the OnConnect function to force the default language to Russian. This will override any configuration tha tteh user has done using the !myconfig command though, so only do that if you are certain it will only be people who speak Russian who log into the server.

Actually I can move all of the config options in !myconfig into a Lapper script and store it in the database, then you could do a "GetStoredValue("IdLang") and if its not set explicitly, then default to RU. I'll do that soon.
Krayy
S2 licensed
Quote from therbo :Here is the speedtrap i've been using... its still rough... and the faster/slower times don't seem to work in qualifying anyways here it is as promised.

Don't forget to add the line to addonsused.lpr and rename file back to .lpr

include ("./optional/radar_trap.lpr"); # SpeedTrap

I quite like this feature although I put it in optional as it isn't feature complete yet. A few suggested features would be to allow the speed traps to be set in game and stored in an .ini file for ease of transport to other servers.

Also seing what traps are there and removing them if needed, otherwise it might get very chatty.
Krayy
S2 licensed
Quote from [Audi TT] :How do default language to Russia in LFSLapper.lpr file?

Unfortunately at the moment it isn't. I can put the option in if you'd like as it would be a very simple thing to do. Then of course you would need to write the Russian translations of the messages.
Krayy
S2 licensed
Quote from Whiskey :A typo? Or am I missing something?

Typo...damn. Only the !mins command supports the extra parameter for the amount of extra laps. !kms is absolute as it uses the track length to determine the amount of laps to do to satisfy the required distance.
FGED GREDG RDFGDR GSFDG