The online racing simulator
Quote from Nadeo4441 :thanks , but i got it now ...
(Direction / Heading) * 182 = angle

That doesn't work for me... Sometimes it shows 0 and sometimes 182 and sometimes more
InSim's MCI packets contain both Heading and Direction values. If you are within the limits of grip, both should be the same (+/- 2 degrees or so). But when you drift, they go further apart, as your heading doesn't change (heading = direction of travel), but your direction changes (direction = where you are pointing). Therefore, by getting the difference between those 2 values, you find how much you're drifting by. But in LFS, the heading and direction units are not degrees, so divide by 180 to get them into degrees.

When I try to get it in messages like this:

InSim.Send_MST_Message("/msg ^1Angle: ^6" + (MCI.Info[0].Direction / MCI.Info[0].Heading) * 180);

I only get angle = 0, 180 and some other random numbers. What's wrong, or is it just not possible to show it in msg?
Well, I suck at maths too so I can't help on whether the formula is correct, but two things I notice in your code. First of all it should be 182 and not 180. Second of all you're inadvertently casting the result of that sum into an integer, when it should really be a float, which in my experience can cause issues when values get rounded in a way you don't expect. Someone with more maths skill can comment on the basis of what you're doing, but from a C# perspective I would try:


float angle = (MCI.Info[0].Heading / MCI.Info[0].Direction) * 182f;
InSim.Send_MST_Message("/msg ^1Angle: ^6" + angle.ToString());

Quote from DarkTimes :Well, I suck at maths too so I can't help on whether the formula is correct, but two things I notice in your code. First of all it should be 182 and not 180. Second of all you're inadvertently casting the result of that sum into an integer, when it should really be a float, which in my experience can cause issues when values get rounded in a way you don't expect. Someone with more maths skill can comment on the basis of what you're doing, but from a C# perspective I would try:


float angle = (MCI.Info[0].Heading / MCI.Info[0].Direction) * 182f;
InSim.Send_MST_Message("/msg ^1Angle: ^6" + angle;


Thanks for trying to help, but I got the same problem with this code :/

*waiting for some math experts to comment, while im trying to find it out by my self*


Edit: Found something that maybe needs to be braided into the code:

word Direction; // direction of car's motion : 0 = world y direction, 32768 = 180 deg

word Heading; // direction of forward axis : 0 = world y direction, 32768 = 180 deg

As I understand it the direction and heading should only get divided or multiplied with 180 when the x or y axis contains 32768?
Sorry ! its my fault
its
(Direction - Heading) / 182 = angle
Quote from Nadeo4441 :Sorry ! its my fault
its
(Direction - Heading) / 182 = angle

I've just said that 2 times
Then it's impossible to show it in messages, because what I can see out of that code ((direction - heading) / 182 = angle) is 0, 180 and other random numbers
-
(JasonJ) DELETED by JasonJ
anyone know how to make a button with text like messages and rules in, and a "ok" button when they join server?
easy, but i still havn't figured out the angle because it is doing that weird
Quote from Bose321 :easy, but i still havn't figured out the angle because it is doing that weird

Tell me how then. I havn't found out of the angle either.
well, i could help you out if you add me on msn, or pm me. maybe we could work together
Quote from Bose321 :well, i could help you out if you add me on msn, or pm me. maybe we could work together

I've sent you a pm. Have you added me to msn?
i see nothing
You can do driftmeter (what I've called DriftMaster) in LFSLapper.

To see it in action, go to the Sin'rs server, then click the DriftMaster button at top of screen and follow very very simple command/question.
Attached images
DriftMaster.bmp
Massive bump.

loat angle = (MCI.Info[0].Heading / MCI.Info[0].Direction) * 182f;

Doesn't work. I am trying to re-try it because I am a bit bored. Could anyone help me? because this code just gives 'random' stuff, not actual angle, I've looked in lapper, but couldn't really find it
-
(JasonJ) DELETED by JasonJ
2

FGED GREDG RDFGDR GSFDG