List of Simhub shared data values?

Discussion in 'Automobilista 2 - General Discussion' started by Full Pace, Mar 19, 2023.

  1. Full Pace

    Full Pace Full Pace Simracing AMS2 Club Member

    Joined:
    Jul 18, 2022
    Messages:
    48
    Likes Received:
    9
    Hey guys,
    I like creating Simhub dashboards and I want to optimize them more for AMS2.
    Is there complete list of available values?
    Especially for
    • mCarFlag
    • mcrashstate
    • msessionstate
    • mdrsstate

    mCarFlag alone combines so many functions and I don't know where to look them up.

    Thank you!
     
    • Informative Informative x 1
  2. Full Pace

    Full Pace Full Pace Simracing AMS2 Club Member

    Joined:
    Jul 18, 2022
    Messages:
    48
    Likes Received:
    9
    anybody? pretty please...
     
  3. IssaP

    IssaP New Member AMS2 Club Member

    Joined:
    Nov 19, 2022
    Messages:
    11
    Likes Received:
    10
    Have a look inside the game folder, there is an example Visual Studio project for the SharedMemory in Steam\steamapps\common\Automobilista 2\Support\SharedMemory\AMS2_SharedMemoryExampleApp. You can find an explanation for the enums you listed (and many more) in the SharedMemory.h
     
  4. Full Pace

    Full Pace Full Pace Simracing AMS2 Club Member

    Joined:
    Jul 18, 2022
    Messages:
    48
    Likes Received:
    9
    thanks for the info but I don't get how to translate this to Simhub. In the file you mention I see for example

    // (Type#9) Car Flags (to be used with 'mCarFlags')
    enum CarFlags
    {
    CAR_HEADLIGHT = (1<<0),
    CAR_ENGINE_ACTIVE = (1<<1),
    CAR_ENGINE_WARNING = (1<<2),
    CAR_SPEED_LIMITER = (1<<3),
    CAR_ABS = (1<<4),
    CAR_HANDBRAKE = (1<<5),
    CAR_TCS = (1<<6),
    CAR_SCS = (1<<7),
    };

    In Simhub I see "[GameRawData.mCarFlags] & 1" to indicate an activated light. When using mcarflags==11 means light + limiter is on. I don't get how the numbers are meant to be used... any more information is appreciated.
     
  5. IssaP

    IssaP New Member AMS2 Club Member

    Joined:
    Nov 19, 2022
    Messages:
    11
    Likes Received:
    10
    If I remember correctly, usually with enums you don't use the specific numbers but use the names instead, e.g. GameRawData.mCarFlags == CAR_HEADLIGHT checks if headlights are on. You don't need to worry about the specific values (in this case they're powers of 2 because of the bit-shift operator). I don't know if there are other hurdles when using these variables inside Simhub as I don't have experience with creating Simhub overlays.
     

Share This Page