intmCurrentSector;// the current sector (zero-based) with the pitlane stored in the sign bit (example: entering pits from third sector gives 0x80000002)
doublemPathLateral;// lateral position with respect to *very approximate* "center" path
doublemTrackEdge;// track edge (w.r.t. "center" path) on same side of track as vehicle
doublemBestSector1;// best sector 1
doublemBestSector2;// best sector 2 (plus sector 1)
doublemBestLapTime;// best lap time
doublemLastSector1;// last sector 1
doublemLastSector2;// last sector 2 (plus sector 1)
doublemLastLapTime;// last lap time
doublemCurSector1;// current sector 1 if valid
doublemCurSector2;// current sector 2 (plus sector 1) if valid
// no current laptime because it instantly becomes "last"
shortmNumPitstops;// number of pitstops made
shortmNumPenalties;// number of outstanding penalties
boolmIsPlayer;// is this the player's vehicle
signedcharmControl;// who's in control: -1=nobody (shouldn't get this), 0=local player, 1=local AI, 2=remote, 3=replay (shouldn't get this)
boolmInPits;// between pit entrance and pit exit (not always accurate for remote vehicles)
unsignedcharmPlace;// 1-based position
charmVehicleClass[32];// vehicle class
// Dash Indicators
doublemTimeBehindNext;// time behind vehicle in next higher place
longmLapsBehindNext;// laps behind vehicle in next higher place
doublemTimeBehindLeader;// time behind leader
longmLapsBehindLeader;// laps behind leader
doublemLapStartET;// time this lap was started
// Position and derivatives
TelemVect3mPos;// world position in meters
TelemVect3mLocalVel;// velocity (meters/sec) in local vehicle coordinates
TelemVect3mLocalAccel;// acceleration (meters/sec^2) in local vehicle coordinates
// Orientation and derivatives
TelemVect3mOri[3];// rows of orientation matrix (use TelemQuat conversions if desired), also converts local
// vehicle vectors into world X, Y, or Z using dot product of rows 0, 1, or 2 respectively
TelemVect3mLocalRot;// rotation (radians/sec) in local vehicle coordinates
TelemVect3mLocalRotAccel;// rotational acceleration (radians/sec^2) in local vehicle coordinates
// tag.2012.03.01 - stopped casting some of these so variables now have names and mExpansion has shrunk, overall size and old data locations should be same
unsignedcharmRepeatShifts;// accidental repeat shift prevention (0-5; see PLR file)
unsignedcharmHoldClutch;// for auto-shifters at start of race: 0 (off), 1 (on)
unsignedcharmAutoReverse;// 0 (off), 1 (on)
unsignedcharmAlternateNeutral;// Whether shifting up and down simultaneously equals neutral
// tag.2014.06.09 - yes these are new, but no they don't change the size of the structure nor the address of the other variables in it (because we're just using the existing padding)
unsignedcharmAIControl;// Whether player vehicle is currently under AI control
unsignedcharmUnused1;//
unsignedcharmUnused2;//
floatmManualShiftOverrideTime;// time before auto-shifting can resume after recent manual shift
floatmAutoShiftOverrideTime;// time before manual shifting can resume after recent auto shift
floatmSpeedSensitiveSteering;// 0.0 (off) - 1.0
floatmSteerRatioSpeed;// speed (m/s) under which lock gets expanded to full
};
structEnvironmentInfoV01
{
// TEMPORARY buffers (you should copy them if needed for later use) containing various paths that may be needed. Each of these
// could be relative ("UserData\") or full ("C:\BlahBlah\rFactorProduct\UserData\").
// mPath[ 0 ] points to the UserData directory.
// mPath[ 1 ] points to the CustomPluginOptions.JSON filename.
// mPath[ 2 ] points to the latest results file
// (in the future, we may add paths for the current garage setup, fully upgraded physics files, etc., any other requests?)
constchar*mPath[16];
unsignedcharmExpansion[256];// future use
};
structCustomControlInfoV01
{
// The name passed through CheckHWControl() will be the mUntranslatedName prepended with an underscore (e.g. "Track Map Toggle" -> "_Track Map Toggle")
charmUntranslatedName[64];// name of the control that will show up in UI (but translated if available)
longmRepeat;// 0=registers once per hit, 1=registers once, waits briefly, then starts repeating quickly, 2=registers as long as key is down
unsignedcharmExpansion[64];// future use
};
structWeatherControlInfoV01
{
// The current conditions are passed in with the API call. The following ET (Elapsed Time) value should typically be far
// enough in the future that it can be interpolated smoothly, and allow clouds time to roll in before rain starts. In
// other words you probably shouldn't have mCloudiness and mRaining suddenly change from 0.0 to 1.0 and expect that
// to happen in a few seconds without looking crazy.
doublemET;// when you want this weather to take effect
// mRaining[1][1] is at the origin (2013.12.19 - and currently the only implemented node), while the others
// are spaced at <trackNodeSize> meters where <trackNodeSize> is the maximum absolute value of a track vertex
// coordinate (and is passed into the API call).
doublemRaining[3][3];// rain (0.0-1.0) at different nodes
doublemCloudiness;// general cloudiness (0.0=clear to 1.0=dark), will be automatically overridden to help ensure clouds exist over rainy areas
doublemAmbientTempK;// ambient temperature (Kelvin)
doublemWindMaxSpeed;// maximum speed of wind (ground speed, but it affects how fast the clouds move, too)
boolmApplyCloudinessInstantly;// preferably we roll the new clouds in, but you can instantly change them now
boolmUnused1;//
boolmUnused2;//
boolmUnused3;//
unsignedcharmExpansion[508];// future use (humidity, pressure, air density, etc.)
charmCaption[128];// Name of variable. This will be used for storage. In the future, this may also be used in the UI (after attempting to translate).
longmNumSettings;// Number of available settings. The special value 0 should be used for types that have limitless possibilities, which will be treated as a string type.
longmCurrentSetting;// Current setting (also the default setting when returned in GetCustomVariable()). This is zero-based, so: ( 0 <= mCurrentSetting < mNumSettings )
// future expansion
unsignedcharmExpansion[256];
};
structCustomSettingV01
{
charmName[128];// Enumerated name of setting (only used if CustomVariableV01::mNumSettings > 0). This will be stored in the JSON file for informational purposes only. It may also possibly be used in the UI in the future.
};
structMultiSessionParticipantV01
{
// input only
longmID;// slot ID (if loaded) or -1 (if currently disconnected)
charmDriverName[32];// driver name
charmVehicleName[64];// vehicle name
unsignedcharmUpgradePack[16];// coded upgrades
floatmBestPracticeTime;// best practice time
longmQualParticipantIndex;// once qualifying begins, this becomes valid and ranks participants according to practice time if possible
floatmQualificationTime[4];// best qualification time in up to 4 qual sessions
floatmFinalRacePlace[4];// final race place in up to 4 race sessions
floatmFinalRaceTime[4];// final race time in up to 4 race sessions
// input/output
boolmServerScored;// whether vehicle is allowed to participate in current session
longmGridPosition;// 1-based grid position for current race session (or upcoming race session if it is currently warmup), or -1 if currently disconnected
// long mPitIndex;
// long mGarageIndex;
// future expansion
unsignedcharmExpansion[128];
};
structMultiSessionRulesV01
{
// input only
longmSession;// current session (0=testday 1-4=practice 5-8=qual 9=warmup 10-13=race)
longmSpecialSlotID;// slot ID of someone who just joined, or -2 requesting to update qual order, or -1 (default/general)
charmTrackType[32];// track type from GDB
longmNumParticipants;// number of participants (vehicles)
// input/output
MultiSessionParticipantV01*mParticipant;// array of partipants (vehicles)
longmNumQualSessions;// number of qualifying sessions configured
longmNumRaceSessions;// number of race sessions configured
longmMaxLaps;// maximum laps allowed in current session (LONG_MAX = unlimited) (note: cannot currently edit in *race* sessions)
longmMaxSeconds;// maximum time allowed in current session (LONG_MAX = unlimited) (note: cannot currently edit in *race* sessions)
charmName[32];// untranslated name override for session (please use mixed case here, it should get uppercased if necessary)
// future expansion
unsignedcharmExpansion[256];
};
enumTrackRulesCommandV01//
{
TRCMD_ADD_FROM_TRACK=0,// crossed s/f line for first time after full-course yellow was called
TRCMD_ADD_FROM_PIT,// exited pit during full-course yellow
TRCMD_ADD_FROM_UNDQ,// during a full-course yellow, the admin reversed a disqualification
TRCMD_REMOVE_TO_PIT,// entered pit during full-course yellow
TRCMD_REMOVE_TO_DNF,// vehicle DNF'd during full-course yellow
TRCMD_REMOVE_TO_DQ,// vehicle DQ'd during full-course yellow
TRCMD_REMOVE_TO_UNLOADED,// vehicle unloaded (possibly kicked out or banned) during full-course yellow
TRCMD_MOVE_TO_BACK,// misbehavior during full-course yellow, resulting in the penalty of being moved to the back of their current line
TRCMD_LONGEST_LINE,// misbehavior during full-course yellow, resulting in the penalty of being moved to the back of the longest line
doublemET;// elapsed time that event occurred, if applicable
};
enumTrackRulesColumnV01
{
TRCOL_LEFT_LANE=0,// left (inside)
TRCOL_MIDLEFT_LANE,// mid-left
TRCOL_MIDDLE_LANE,// middle
TRCOL_MIDRIGHT_LANE,// mid-right
TRCOL_RIGHT_LANE,// right (outside)
//------------------
TRCOL_MAX_LANES,// should be after the valid static lane choices
//------------------
TRCOL_INVALID=TRCOL_MAX_LANES,// currently invalid (hasn't crossed line or in pits/garage)
TRCOL_FREECHOICE,// free choice (dynamically chosen by driver)
TRCOL_PENDING,// depends on another participant's free choice (dynamically set after another driver chooses)
//------------------
TRCOL_MAXIMUM// should be last
};
structTrackRulesParticipantV01
{
// input only
longmID;// slot ID
shortmFrozenOrder;// 0-based place when caution came out (not valid for formation laps)
shortmPlace;// 1-based place (typically used for the initialization of the formation lap track order)
floatmYellowSeverity;// a rating of how much this vehicle is contributing to a yellow flag (the sum of all vehicles is compared to TrackRulesV01::mSafetyCarThreshold)
longmRelativeLaps;// current formation/caution laps relative to safety car (should generally be zero except when safety car crosses s/f line); this can be decremented to implement 'wave around' or 'beneficiary rule' (a.k.a. 'lucky dog' or 'free pass')
TrackRulesColumnV01mColumnAssignment;// which column (line/lane) that participant is supposed to be in
longmPositionAssignment;// 0-based position within column (line/lane) that participant is supposed to be located at (-1 is invalid)
boolmAllowedToPit;// whether the rules allow this particular vehicle to enter pits right now
boolmUnused[3];//
doublemGoalRelativeDistance;// calculated based on where the leader is, and adjusted by the desired column spacing and the column/position assignments
charmMessage[96];// a message for this participant to explain what is going on (untranslated; it will get run through translator on client machines)
// future expansion
unsignedcharmExpansion[192];
};
enumTrackRulesStageV01//
{
TRSTAGE_FORMATION_INIT=0,// initialization of the formation lap
TRSTAGE_FORMATION_UPDATE,// update of the formation lap
TRSTAGE_NORMAL,// normal (non-yellow) update
TRSTAGE_CAUTION_INIT,// initialization of a full-course yellow
TRSTAGE_CAUTION_UPDATE,// update of a full-course yellow
//------------------
TRSTAGE_MAXIMUM// should be last
};
structTrackRulesV01
{
// input only
doublemCurrentET;// current time
TrackRulesStageV01mStage;// current stage
TrackRulesColumnV01mPoleColumn;// column assignment where pole position seems to be located
longmNumActions;// number of recent actions
TrackRulesActionV01*mAction;// array of recent actions
longmNumParticipants;// number of participants (vehicles)
boolmYellowFlagDetected;// whether yellow flag was requested or sum of participant mYellowSeverity's exceeds mSafetyCarThreshold
boolmYellowFlagLapsWasOverridden;// whether mYellowFlagLaps (below) is an admin request
boolmSafetyCarExists;// whether safety car even exists
boolmSafetyCarActive;// whether safety car is active
longmSafetyCarLaps;// number of laps
floatmSafetyCarThreshold;// the threshold at which a safety car is called out (compared to the sum of TrackRulesParticipantV01::mYellowSeverity for each vehicle)
doublemSafetyCarLapDist;// safety car lap distance
floatmSafetyCarLapDistAtStart;// where the safety car starts from
floatmPitLaneStartDist;// where the waypoint branch to the pits breaks off (this may not be perfectly accurate)
floatmTeleportLapDist;// the front of the teleport locations (a useful first guess as to where to throw the green flag)
// future input expansion
unsignedcharmInputExpansion[256];
// input/output
signedcharmYellowFlagState;// see ScoringInfoV01 for values
shortmYellowFlagLaps;// suggested number of laps to run under yellow (may be passed in with admin command)
longmSafetyCarInstruction;// 0=no change, 1=go active, 2=head for pits
floatmSafetyCarSpeed;// maximum speed at which to drive
floatmSafetyCarMinimumSpacing;// minimum spacing behind safety car (-1 to indicate no limit)
floatmSafetyCarMaximumSpacing;// maximum spacing behind safety car (-1 to indicate no limit)
floatmMinimumColumnSpacing;// minimum desired spacing between vehicles in a column (-1 to indicate indeterminate/unenforced)
floatmMaximumColumnSpacing;// maximum desired spacing between vehicles in a column (-1 to indicate indeterminate/unenforced)
floatmMinimumSpeed;// minimum speed that anybody should be driving (-1 to indicate no limit)
floatmMaximumSpeed;// maximum speed that anybody should be driving (-1 to indicate no limit)
charmMessage[96];// a message for everybody to explain what is going on (which will get run through translator on client machines)
TrackRulesParticipantV01*mParticipant;// array of partipants (vehicles)
// future input/output expansion
unsignedcharmInputOutputExpansion[256];
};
structPitMenuV01
{
longmCategoryIndex;// index of the current category
charmCategoryName[32];// name of the current category (untranslated)
longmChoiceIndex;// index of the current choice (within the current category)
charmChoiceString[32];// name of the current choice (may have some translated words)
longmNumChoices;// total number of choices (0 <= mChoiceIndex < mNumChoices)