Results 1 to 4 of 4

Thread: Separating values in sSector and sGearNumGears

  1. #1
    Rookie
    Join Date
    Jan 2019
    Posts
    2
    Platform
    PS4

    Separating values in sSector and sGearNumGears

    Hi all,

    I'm in C++ here, can someone tell me how can I read the following values:

    1. sSector: I need the sector value only, without the extra precision bits for x/z position.
    2. sGearNumGears: I need the current gear.

    How can I seperating the values?

    Thanks!
    Chris

  2. #2
    Superkart Pilot Maskmagog's Avatar
    Join Date
    Sep 2017
    Posts
    439
    Platform
    XBOX1 X
    I'm using C# so this might not work, but this is the code I use for sector: (UDP v1)
    byte Sector_ALL = binaryReader.ReadByte();
    var Sector_Extracted = Sector_ALL & 7;
    ParticipantInfo[i, 7] = Convert.ToDouble(Sector_Extracted); //sSector

    This gives you sector number as a double. Hope that helps.

    EDIT: afaik, the '& 7' means that you read the first 7 bits of the byte, but not the last.
    In c#, use '>>' to shift the position you read from. I might be wrong
    Last edited by Maskmagog; 25-01-2019 at 17:49.
    Thrustmaster TX, Italia 458 wheel, 2 pedals, Firmware 54, Xbox One X, public OS, 24" 1080 monitor
    Don't miss Yorkie065's excellent videos: Ep26-LiveTrack pt1. Ep 27-LiveTrack pt2.
    Project CALC - car/track leaderboards for consoles

  3. #3
    WMD Member Sampo's Avatar
    Join Date
    Jun 2012
    Location
    Finland
    Posts
    648
    Platform
    PC
    unsigned char curr_gear = ...sGearNumGears & 0xf;

    unsigned char curr_sector = ...sSector & 0x3;

    Those should work for PCars2 UDP.
    Last edited by Sampo; 25-01-2019 at 18:53.
    CPU Intel i7-9700K @ 4.8 GHz | Motherboard Gigabyte Z390 Aorus Pro | RAM 16GB DDR4 3200MHz | GPU nVidia GTX980 4GB (418.81) | Audio Realtek 5.1 on MB | Screen AOC U3477PQU | OS Windows 10 Pro 64-bit | Wheel Logitech G27
    In-game settings: 2560x1080 / 3440x1440 | Texture Resolution HIGH | AF 16x | VSync ON | AA None | Reflections MED | Envmap MED | Vehicle HIGH | World HIGH | Shadows MED | Motion Blur NO | Render Frames Ahead 1 | Particles MED/MED/MED

    PC2Info, a PC program that shows most stats the game provides over UDP
    The following user likes this Post: Maskmagog


  4. #4
    Rookie
    Join Date
    Jan 2019
    Posts
    2
    Platform
    PS4

    Thank you guys! The solution of Sampo works! THX!
    The following 2 users likes this Post: Maskmagog, Sampo


Similar Threads

  1. sGearNumGears - how to interpret?
    By Siege in forum Third-Party Apps & API Discussion
    Replies: 1
    Last Post: 14-03-2018, 22:12
  2. Replies: 5
    Last Post: 04-01-2018, 07:20
  3. Setup values from 1-2 and pit
    By Jever in forum Project CARS 2 on Playstation 4
    Replies: 9
    Last Post: 22-11-2017, 14:59
  4. AMG GT3 fresnel values?
    By Machinist90 in forum The Paint Shop - Car Painting & Designs
    Replies: 0
    Last Post: 14-11-2017, 01:10
  5. Low torque values
    By AVO in forum Technical Help & Support (PC)
    Replies: 4
    Last Post: 14-10-2017, 22:51

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •