The online racing simulator
Need help with outgauge
(6 posts, started )
Need help with outgauge
Hi, im making a program the measures various things. Throttle, brake, clutch, rpm, speed, ect. i have progressbars setup to show the pressure being applied to each axis. Everything works fine except for the clutch bar. Im using vb6 by the way. When using my program, it works fine for a little while, but after a few seconds i get an error 380 "invalid property value" on my clutch progress bar. Its setup the same as the throttle and brake, but those work fine. Is lfs sending something to my program it cantunderstand, or is there a fault withen my code.
Private Sub theSocket_Received(lngSocket As Long, Data() As Byte)
If lngSocket = lngTheSocket Then
Dim Packet As OutGaugePacket

CopyMemory Packet, Data(0), LenB(Packet)

lblSpeed.Caption = Format(Packet.Speed * 3.6, "##0") & " KM/H @ " & _
Format(Packet.RPM, "####0") & " RPM"
lblturbopressure.Caption = Format(Packet.Turbo * 14.5037738, "##0") & " PSI"
lblfuel.Caption = Format(Packet.Fuel * 100, "##0") & "% Fuel"
pbthrottle.Value = Format(Packet.Throttle * 100)
pbbrake.Value = Format(Packet.Brake * 100)
pbclutch.Value = Format(Packet.Clutch * 100)

lblthrottle.Caption = Format(Packet.Throttle * 100, "##0") & "% throttle"
lblbrake.Caption = Format(Packet.Brake * 100, "##0") & "% brake"
lblclutch.Caption = Format(Packet.Clutch * 100, "##0") & "% clutch"
End If
End Sub

the error occurs on the "pbclutch.value = format(packet.clutch * 100)" line. but i have no idea what is wrong. I have only started experimenting with outgauge today.
I'd like to know how to use UDP sockets with VB.net, then I will be able to tell you what the problem is!
i made a way around it. The percentage of the clutch label workes fine, so i made the caption of the label the value of the progress bar, works perfect.
#4 - Stuff
Quote from stevewhite :

pbthrottle.Value = Format(Packet.Throttle * 100)
pbbrake.Value = Format(Packet.Brake * 100)
pbclutch.Value = Format(Packet.Clutch * 100)


The Format function returns a "Variant (String)" and I think the progress bar takes an integer.. Just replace Format with something like CLng. Like: pbClutch.Value = CLng(Packet.Clutch * 100)

Hope that helps
Ray, i hope you read this... I am using your outsim example, seeing how it works , but i cant get it to. It wont work! What do i have to do? I have outsim enabled in cfg.txt, set to port 55, when i "turn on" the program to listen to port 55, nothing happens... What do i do?
#6 - Stuff
Hmm, I dunno what to say. Just make sure that your cfg is right and that it only works on the currently viewed player in a race.. Here's my cfg.

OutGauge Mode 2
OutGauge Delay 1
OutGauge IP 127.0.0.1
OutGauge Port 55
OutGauge ID 0

In a few days I'm releasing a new open source VB6 project thats totally rewritten and includes working InSim, OutSim, OutGauge, Gateway and HTTP examples. PM me and I can send ya some stuff.

Need help with outgauge
(6 posts, started )
FGED GREDG RDFGDR GSFDG