The online racing simulator
Searching in All forums
(81 results)
tumes925semut
S3 licensed
I think maybe from lfspro
tumes925semut
S3 licensed
Here is my full code... sure shocking but come on.

<?php 
Event OnCrossingChecker
($userName,$Flags,$Time,$Object,$UserSpeed,$CircleIndex)  # Player event
    
$Heading GetCurrentPlayerVar"Heading" );      # Direction of forward axis : 0 = world y direction
    
$Direction GetCurrentPlayerVar"Direction" );    # Car's motion if Speed > 0 : 0 = world y direction
    
SetCurrentPlayerVar("RealAngle",getcurrentplayervar("Heading")-getcurrentplayervar("Direction"));
IF ( 
$Flags == )
    
THEN
    
#globalmsg("^7head ".getcurrentplayervar("Heading")." dir ".getcurrentplayervar("Direction"));    

    
IF ((( $Heading 0) && ( $Heading 90 )) && ( $Direction 225 ))  #Oange

        
THEN
        
        
IF( $Heading >  $Direction )
            
THEN
                SetCurrentPlayerVar
("RealAngle",getcurrentplayervar("Heading")-getcurrentplayervar("Direction"));            
                
globalmsg(.getplayervar($userName,"NickName")." ^2Angle:^3 ".Round(getcurrentplayervar("RealAngle"),0)."°");
            ELSE
                
SetCurrentPlayerVar("RealAngle",getcurrentplayervar("Heading")-getcurrentplayervar("Direction")-360);    
                
globalmsg(.getplayervar($userName,"NickName")." ^2Angle:^3 ".Round(getcurrentplayervar("RealAngle"),0)."°");
        ENDIF
    ENDIF    
    IF ((( 
$Heading 0) && ( $Heading 90 )) && ( $Direction 225 ))  #Oange2
        
THEN
        
IF( $Heading >  $Direction )
            
THEN
                SetCurrentPlayerVar
("RealAngle",getcurrentplayervar("Heading")-getcurrentplayervar("Direction"));            
                
globalmsg(.getplayervar($userName,"NickName")." ^2Angle:^3 ".Round(getcurrentplayervar("RealAngle"),0)."°");
            ELSE
                
SetCurrentPlayerVar("RealAngle",getcurrentplayervar("Direction")-getcurrentplayervar("Heading"));    
                
globalmsg(.getplayervar($userName,"NickName")." ^2Angle:^3 ".Round(getcurrentplayervar("RealAngle"),0)."°");
        ENDIF
    ENDIF
    
    IF ((( 
$Heading 90) && ( $Heading 180 )) && ( $Direction 315 )) #yellow
        
THEN
        
IF( $Heading >  $Direction )
            
THEN
                SetCurrentPlayerVar
("RealAngle",getcurrentplayervar("Heading")-getcurrentplayervar("Direction"));            
                
globalmsg(.getplayervar($userName,"NickName")." ^2Angle:^3 ".Round(getcurrentplayervar("RealAngle"),0)."°");
            ELSE
                
SetCurrentPlayerVar("RealAngle",getcurrentplayervar("Direction")-getcurrentplayervar("Heading"));    
                
globalmsg(.getplayervar($userName,"NickName")." ^2Angle:^3 ".Round(getcurrentplayervar("RealAngle"),0)."°");
        ENDIF
    ENDIF
    IF ((( 
$Heading 90) && ( $Heading 180 )) && ( $Direction 315 )) #yellow2
        
THEN
        
IF( $Heading $Direction )
            
THEN
                SetCurrentPlayerVar
("RealAngle",getcurrentplayervar("Heading")-getcurrentplayervar("Direction"));            
                
globalmsg(.getplayervar($userName,"NickName")." ^2Angle:^3 ".Round(getcurrentplayervar("RealAngle"),0)."°");
            ELSE
                
SetCurrentPlayerVar("RealAngle",getcurrentplayervar("Direction")-getcurrentplayervar("Heading"));    
                
globalmsg(.getplayervar($userName,"NickName")." ^2Angle:^3 ".Round(getcurrentplayervar("RealAngle"),0)."°");
        ENDIF
    ENDIF
ENDIF
IF ( 
$Flags == )
    
THEN
    
#globalmsg("^7head ".getcurrentplayervar("Heading")." dir ".getcurrentplayervar("Direction"));    
    
    
IF ((( $Heading 0) && ( $Heading > -90 )) && ( $Direction 135 ))
        
THEN
    
#globalmsg("^1test1");    
                
SetCurrentPlayerVar("RealAngle",-getcurrentplayervar("Heading")-getcurrentplayervar("Direction")-360);
                IF ( 
GetCurrentPlayerVar("RealAngle") < )
                
THEN
            
#    globalmsg("^2then");
                
SetCurrentPlayerVar("RealAnglerev",-getcurrentplayervar("RealAngle"));
                
globalmsg(.getplayervar($userName,"NickName")." ^2Anglerev:^3 ".Round(getcurrentplayervar("RealAnglerev"),0)."°");
            ELSE
                
#globalmsg("^3else");    
                
globalmsg(.getplayervar($userName,"NickName")." ^2Angle:^3 ".Round(getcurrentplayervar("RealAngle"),0)."°");
            ENDIF
    ENDIF    
    IF ((( 
$Heading 0) && ( $Heading > -90 )) && ( $Direction 135 ))
        
THEN
#    globalmsg("^2test2");    
                
SetCurrentPlayerVar("RealAngle",-getcurrentplayervar("Heading")-getcurrentplayervar("Direction"));            
                IF ( 
GetCurrentPlayerVar("RealAngle") < )
                
THEN
            
#    globalmsg("^2then");
                
SetCurrentPlayerVar("RealAnglerev",-getcurrentplayervar("RealAngle"));
                
globalmsg(.getplayervar($userName,"NickName")." ^2Anglerev:^3 ".Round(getcurrentplayervar("RealAnglerev"),0)."°");
            ELSE
                
#globalmsg("^3else"));
                
globalmsg(.getplayervar($userName,"NickName")." ^2Angle:^3 ".Round(getcurrentplayervar("RealAngle"),0)."°");
            ENDIF
    ENDIF
    
    IF ((( 
$Heading < -90) && ( $Heading > -180 )) && ( $Direction 45 ))
        
THEN
#    globalmsg("^3test3");    
                
SetCurrentPlayerVar("RealAngle",-getcurrentplayervar("Heading")-getcurrentplayervar("Direction"));
            IF ( 
GetCurrentPlayerVar("RealAngle") < )
                
THEN
            
#    globalmsg("^2then");
                
SetCurrentPlayerVar("RealAnglerev",-getcurrentplayervar("RealAngle"));
                
globalmsg(.getplayervar($userName,"NickName")." ^2Anglerev:^3 ".Round(getcurrentplayervar("RealAnglerev"),0)."°");
                
            ELSE
            
#    globalmsg("^3else");
                
globalmsg(.getplayervar($userName,"NickName")." ^2Angle:^3 ".Round(getcurrentplayervar("RealAngle"),0)."°");
            ENDIF
    ENDIF
    
    IF ((( 
$Heading < -90) && ( $Heading > -180 )) && ( $Direction 45 ))
        
THEN
    
#globalmsg("^4test4");    
                
SetCurrentPlayerVar("RealAngle",-getcurrentplayervar("Heading")-getcurrentplayervar("Direction")-360);
            IF ( 
GetCurrentPlayerVar("RealAngle") < )
                
THEN
            
#    globalmsg("^2then");
                
SetCurrentPlayerVar("RealAnglerev",-getcurrentplayervar("RealAngle"));
                
globalmsg(.getplayervar($userName,"NickName")." ^2Anglerev:^3 ".Round(getcurrentplayervar("RealAnglerev"),0)."°");
                
            ELSE
            
#    globalmsg("^3else");
                
globalmsg(.getplayervar($userName,"NickName")." ^2Angle:^3 ".Round(getcurrentplayervar("RealAngle"),0)."°");
            ENDIF
    ENDIF
ENDIF
    
EndEvent
?>


tumes925semut
S3 licensed
Quote from rane_nbg :This code is extremely confusing.

First make sure that you know the range for each of variables heading and direction. Then you can start doing the math with them. Why are you doing -360? It makes no sense, rotating by full circle in any direction gets you to the same point.

If you are intereated in value of heading-direction, then put that into the if statement and ask if it is less then zero. For me it is intuitive to have the zero where car direction matches its heading, and if you drift left to show negative and drift to right to show positive angle.

OK but my point was that if formula and why it not work?
tumes925semut
S3 licensed
Quote from MizzMaster :If there is any abs() function, use it. (abs = absolute, if $a < 0 then $a = -$a endif)

I am not sure about the values and ranges in your code, but I can tell that you are actually measuring the angle of the car compared to its Direction instead of comparing it to the measurement line's Angle which probably what you wanted in the first place. Although this approach would give you the actual drifting angle of the car, there is no guarantee you will get 90 degrees just because you past the line like in the image. If you want that, calculate the difference between the Heading and Angle of the line instead of Direction.

Here what i got.

It picks every time ELSE...


<?php 
#    globalmsg("^4test4");    
                
SetCurrentPlayerVar("RealAngle",-getcurrentplayervar("Heading")-getcurrentplayervar("Direction")-360);
            IF ( 
GetCurrentPlayerVar("RealAngle") < )
                
THEN
            
#    globalmsg("^2then");
                
SetCurrentPlayerVar("RealAnglerev",-getcurrentplayervar("RealAngle"));
                
globalmsg(.getplayervar($userName,"NickName")." ^2Anglerev:^3 ".Round(getcurrentplayervar("RealAnglerev"),0)."°");
                
            ELSE
            
#    globalmsg("^3else");
                
globalmsg(.getplayervar($userName,"NickName")." ^2Angle:^3 ".Round(getcurrentplayervar("RealAngle"),0)."°");
            ENDIF
?>

tumes925semut
S3 licensed

<?php 
IF   
THEN    
SetCurrentPlayerVar
("RealAngle",getcurrentplayervar("Heading")-getcurrentplayervar("Direction")+360);
?>

I need there formula what convert negative to positive...

IF ( RealAngle == negative )
Then
Convert to positive.
ELSE


<?php 
globalmsg
("^2Oange   ".getcurrentplayervar("RealAngle"));    
ENDIF
?>

The brain is tired tonight. I've gotten a lot done with the code.
tumes925semut
S3 licensed
Quote from MizzMaster :In "Player Vars.txt", there are two variables that you need to use:

Heading, // Direction of forward axis : 0 = world y direction
Direction, // Car's motion if Speed > 0 : 0 = world y direction

First, convert them to the appropriate format.
- They might be in a byte range instead of degrees [0-255]. Simply multiply them by 360 and divide them by 255. (x * 360 / 255)
- If both of them aren't clockwise or anti-clockwise, convert one to other's. (360 - x)
- Both of them start from the same axis (+y), so you dont need to adjust it in this case.
Final format: Both of them (C +y) or (AC +y), range [0, 360].

Then all you need to do is:
- Calculate the difference between them to get the angle. Angle = abs(Heading - Direction) [0 - 360]
- If it is greater than 180, substract from 360. Angle = 360 - Angle [0 - 180]
(In case of something like Heading is 350 and Direction is 10, Angle should be 20, not 340)

Keep us updated if it works or not.

Now is made this code. I think it works, but when you drive from other direction angle show negative


<?php 
Event OnCrossingChecker
($userName,$Flags,$Time,$Object,$UserSpeed,$CircleIndex)  # Player event
    
$GetAngleInDegrees GetAngle($userName,"-387:-635");
    
$Heading GetCurrentPlayerVar"Heading" );      # Direction of forward axis : 0 = world y direction
    
$Direction GetCurrentPlayerVar"Direction" );    # Car's motion if Speed > 0 : 0 = world y direction
    
SetCurrentPlayerVar("Angle",$GetAngleInDegrees);
    
SetCurrentPlayerVar("RealAngle",getcurrentplayervar("Heading")-getcurrentplayervar("Direction"));    
    
globalmsg("^8head".getcurrentplayervar("Heading"));    
    
globalmsg("^8dir".getcurrentplayervar("Direction"));
  IF ( 
$Heading )
    
THEN
    SetCurrentPlayerVar
("RealAngle",getcurrentplayervar("Heading")-getcurrentplayervar("Direction"));
    
globalmsg("^1ANGLE    ".getcurrentplayervar("RealAngle"));
    ENDIF    
    
  IF ( 
$Heading 
    
THEN
    SetCurrentPlayerVar
("RealAngle",getcurrentplayervar("Heading")-getcurrentplayervar("Direction")+360);
    
globalmsg("^2ANGLE+360    ".getcurrentplayervar("RealAngle"));    
    ENDIF
ENDEvent    
?>


I found this and direction is 0-360 scaled already. Headin -179-180

Quote :+---------------------------------------------------------------+
|Changes from 7.0.7.1 to 7.0.7.2 | fixes/changes
+---------------------------------------------------------------+
=================================================
New:
=================================================

Nothing

=================================================
Changed:
=================================================

1: PlayerVar($userName,"Z"): Z-axis has now 2 decimals xx.yy
2: PlayerVar($userName,"Heading"); Heading values changed ((0 - 180 degrees) & (0 - -179) degrees) instead of 0-359 degrees
3: Message ingame when LFSLapper has been connected after (re)loading.
Handy when your LFSlapper instance is running like a service instead of an app for hosting services.

=================================================

tumes925semut
S3 licensed
Quote from sinanju :Not quite sure exactly how you could do it with that code without trial and error, but you might be able to round the angle decimals down, such as (for 2 decimal places)

$GetAngleInDegrees = GetAngle($userName,round("-387:-635"),2);

Maybe?

I Got it thanks.
globalmsg(.getplayervar($userName,"NickName").Round(getplayervar($userName,"Angle"),2));

tumes925semut
S3 licensed
I tested this and this works but every time you have to enter the coordinates that are a fixed point in relation to the measurement point. And if i use "$GetAngleInDegree" it gives lots of decimals.

<?php 
Event OnCrossingChecker
($userName,$Flags,$Time,$Object,$UserSpeed,$CircleIndex)  # Player event
    
$GetAngleInDegrees GetAngle($userName,"-387:-635");
    
SetCurrentPlayerVar("Angle",$GetAngleInDegrees);
    IF ((
$Object == "1st checkpoint") && ($Flags == 2))
        
THEN
              globalmsg
(.getplayervar($userName,"NickName").GetCurrentPlayerVar("Angle"));
    ENDIF    
EndEvent
?>


I try do code what use direction and heading.
tumes925semut
S3 licensed
Quote from Scawen :I have no idea what that really means, what lapper does to make LFS do a 10 minute race. Timed races in LFS, using the default system, are 1 hour minimum. So at this point I have not a clue how to reproduce the issue you describe.

EDIT: The only thing I can imagine, is, a possible scenario like this: lapper starts the race, as e.g. 5 laps, then increases the number of laps after the start of the race. Then the AI will have started the race with too little fuel. So then this is a 'bug' in lapper rather than LFS (maybe not a bug, maybe it wasn't designed for AI). Lapper should start with higher estimated number of laps then reduce them. But as I say, I just made this up, I don't know how lapper works.

When you setup 10min race in lapper, it does in game 48h maximum length. Lapper probably counts 10 minutes from the start of the race, or maybe takes the insim directly from the game? I don't know,
but in any case, when the 10-minute time limit is full, the Lapper changes the elapsed laps of the race + 1 lap when the leading car crosses the finish line.maybe the lapper's debug function on can find out what it actually does... and at what point the cars go to the pit could also help to solve this question.
the actual angle of the car in relation to the direction of travel
tumes925semut
S3 licensed
I use default driftmeter code which tells the angle, but that's not even close. As you can see, the car is at an angle of almost 90 degrees and the meter only reads 55 degrees. I would need help to get the meters to show the right angle.
Here is my code:

<?php 
Event OnCrossingChecker
($userName,$Flags,$Time,$Object,$UserSpeed,$CircleIndex)  # Player event
    
$AngleVelocity GetCurrentPlayerVar"AngleVelocity" );

    IF ((
$Object == "1st checkpoint") && ($Flags == 2))
        
THEN
              globalmsg
(.getplayervar($userName,"NickName")."^1Entry:^3".getplayervar($userName,"InstantSpeed")." ^3km/h");
    ENDIF
    IF ((
$Flags == 0) || ($Flags == 2))
    
THEN
    
IF  ($AngleVelocity 0)
    
THEN
        $AngleVelocity 
= -$AngleVelocity ;
        
SetCurrentPlayerVar("Angle_Reverse",$AngleVelocity);
              
globalmsg(.getplayervar($userName,"NickName")." ^1Angle: ^3".GetCurrentPlayerVar"Angle_Reverse")."°");
    ELSE
              
globalmsg(.getplayervar($userName,"NickName")." ^1Angle: ^3".$AngleVelocity."°");    
    ENDIF
    ENDIF
            
EndEvent
?>


Last edited by tumes925semut, .
tumes925semut
S3 licensed
Quote :You will see that the botstatus goes to: Playing: <numofplayers> Players

Is it possible change status "Playing:" something else or empty? Like live streaming, for example.
Maybe offtopic, maybe general LFS Talk, maybe both,
tumes925semut
S3 licensed
When will LFS stop supporting windows 7? Steam and all other applications are already moving to newer windows. I personally wouldn't want to move yet. Funding, if because of that you have to buy new computer parts etc. shit.

What is the oldest windows that lfs runs on?
tumes925semut
S3 licensed
Related to this topic, it would also be nice if you could specify which tire to drive to the checkpoint.

Like now:
UCO_CIRCLE_ENTER, // entered a circle
UCO_CIRCLE_LEAVE, // left a circle
UCO_CP_FWD, // crossed cp in forward direction
UCO_CP_REV, // crossed cp in reverse direction

These may be useful to programmers. Like Drifting clipping points.
// crossed/entered FL tyre
// crossed/entered FR tyre
// crossed/entered RL tyre
// crossed/entered RR tyre
InSim checkpoint
tumes925semut
S3 licensed
Simply:
Editor needs InSim checkpoint with index.... like that circle.
tumes925semut
S3 licensed
Try google gta sa model to fbx and with gimplender you can make fbx to obj.
tumes925semut
S3 licensed
Quote from tumes925semut :ver 7A can't change setup on multiplayer when watching.

Scawen fix that button "automatic clutch" "yes" "no" without on track only to new patch.
Tweak to mod
tumes925semut
S3 licensed
Is it possible make tweaked car in editor? I mean like engine with vtec and can it be saved and upload? Or something else tweks what editor dont support now.
tumes925semut
S3 licensed
Russians can do everything i like that
tumes925semut
S3 licensed
We tested lapper with other computer and other internet connection and discordbot works.... If i get answer why it doesn't work on this PC i tell it here
tumes925semut
S3 licensed
Can it be token token lenght? Old token was 59 mark and new 70.
tumes925semut
S3 licensed
Quote from Bass-Driver :Uhm i have no clue. My connection with discord is still fine. What if you create a new Bot and see what that does.

Dont work...
Discordbot unauthorized
tumes925semut
S3 licensed
I dont have any idea why. I didin't change nothing and it goes right this. I try update token without any result.
tumes925semut
S3 licensed
and wedge with angled up/down
tumes925semut
S3 licensed
Nice simulator... I think better than mouse.
https://vm.tiktok.com/ZMLsxNjLA/
tumes925semut
S3 licensed
server is hidden
FGED GREDG RDFGDR GSFDG