The online racing simulator
Searching in All forums
(5 results)
MizzMaster
S3 licensed
Quote from tumes925semut :I need there formula what convert negative to positive...

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.
MizzMaster
S3 licensed
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.
MizzMaster
S3 licensed
"Can't add : invalid position"

Even if you don't select any objects and press O, lfs interprets it as a message anyways. (PMO_POSITION, see InSim.txt PMOAction enum). People can use this information in their InSim's to teleport people into the pointed location, for example. So, it is completely normal for this message to appear even if you haven't selected an object because you don't have to select one.
MizzMaster
S3 licensed
bruh
IS_OBH Zbyte is always zero
MizzMaster
S3 licensed
IS_OBH Zbyte is always zero even if the 'OBH_LAYOUT' is set in the 'OBHFlags'. The Zbyte inside the CarContOBJ does reflect the actual approximate altitude of the car.

(InSimDotNet library was skipping the Zbyte in the CarContOBJ but was actually reading the Zbyte in the IS_OBH. So, it is not a library related problem.)

InSim version: 9, Server version: 0.7D, Game version: 0.7D
FGED GREDG RDFGDR GSFDG