The online racing simulator
Player Speed From Insim
(3 posts, started )
Player Speed From Insim
Hey How can I get my speed using Insim ??
like I want only my own speed (or who ever is using the program im making).... the users speed

Searching MCI but thats other players speed, so can I get my ID and then to find my own speed?
The InSim way is as you describe, OutGauge gives you the speedo-readout (which isn't necessarily the actual velocity of the vehicle) and OutSim a velocity vector (which is the actual velocity of the vehicle).
Downsides to OG and OS are
  • You cannot initialise them if they're configured in the cfg.txt (or in other words, if there already is an application using OG/OS).
  • They lack an identifier, it is not possible to associate OG/OS packets with one particular player based on the packets alone.
€: To clarify, you pick the local player's CompCar (via PLID) from MCI and extract the speed from that.
-
(DavidTiger) DELETED by DavidTiger
I've never actually coded a local InSim app, but my take on this would be:
  • Request a STA using TINY_SST
  • check whether ISS_MULTI flag is set in STA.Flags
  • If yes:
    • Request all NCNs via TINY_NCN
    • find NCN without remote flag set (Flags & 4)
    • store the corresponding UCID
    • request all NPLs via TINY_NPL
    • store PLID of NPL associated with previously stored UCID
    If no:
    • Local UCID is 0, AIs can be identified via (NPL.Flags & 2)
Now you've got the local UCID and PLID, but beware, this process must be repeated whenever a host is joined. I'd say listen for ISM packets and repeat the process whenver you receive one
-
(DavidTiger) DELETED by DavidTiger
-
(DavidTiger) DELETED by DavidTiger : Found what I was looking for..

Player Speed From Insim
(3 posts, started )
FGED GREDG RDFGDR GSFDG