The online racing simulator
IS_PIT help
(14 posts, started )
IS_PIT help
Hi guys. Im making a race control program and i need a little help in understanding something. If a player has a penalty in LFS like a STOP-GO LFS doesnt seem to send the insim packet IS_PIT when you pull into a bay. Is this normal or is there something im missing?

PSF doesnt seem to fire when its over neither...
Isn't that because no work is done? When you pull in it just says [No Work]. So maybe that's why there is none...IDK, just an idea, I've never used them...
Could be that but the packet discription says its when they pit in the bay..so...?
-
(JasonJ) DELETED by JasonJ
I maybe talking out my arse here, but it could be because they are in the pits serving a penalty, which does not count as a pit stop.

Isn't there a packet of info that says they entered the pits to serve a penalty?
Quote from mcgas001 :Hi guys. Im making a race control program and i need a little help in understanding something. If a player has a penalty in LFS like a STOP-GO LFS doesnt seem to send the insim packet IS_PIT when you pull into a bay. Is this normal or is there something im missing?

PSF doesnt seem to fire when its over neither...

If I correctly have understood you, all correctly works
use
struct IS_PLA // Pit LAne
{
byte Size; // 8
byte Type; // ISP_PLA
byte ReqI; // 0
byte PLID; // player's unique id

byte Fact; // pit lane fact (see below)
byte Sp1;
byte Sp2;
byte Sp3;
};


PITLANE_EXIT, // 0 - left pit lane
PITLANE_ENTER, // 1 - entered pit lane
PITLANE_NO_PURPOSE, // 2 - entered for no purpose
PITLANE_DT, // 3 - entered for drive-through
PITLANE_SG, // 4 - entered for stop-go
PITLANE_NUM
But PLA is sent when the player drives into the pitlane, he wants to know about the PIT which is sent when you enter a pitbox...
AFAIK, LFS will send the ISP_PEN packet when a driver receives a penalty. Maybe set up a boolean in the player list that will turn to true when a driver receives a DT or SG penalty.

struct IS_PEN // PENalty (given or cleared)
{
byte Size; // 8
byte Type; // ISP_PEN
byte ReqI; // 0
byte PLID; // player's unique id

byte OldPen; // old penalty value (see below)
byte NewPen; // new penalty value (see below)
byte Reason; // penalty reason (see below)
byte Sp3;
};
// Penalty values (VALID means the penalty can now be cleared)

enum
{
PENALTY_NONE, // 0
PENALTY_DT, // 1
PENALTY_DT_VALID, // 2
PENALTY_SG, // 3
PENALTY_SG_VALID, // 4
PENALTY_30, // 5
PENALTY_45, // 6
PENALTY_NUM
};

// Penalty reasons

enum
{
PENR_UNKNOWN, // 0 - unknown or cleared penalty
PENR_ADMIN, // 1 - penalty given by admin
PENR_WRONG_WAY, // 2 - wrong way driving
PENR_FALSE_START, // 3 - starting before green light
PENR_SPEEDING, // 4 - speeding in pit lane
PENR_STOP_SHORT, // 5 - stop-go pit stop too short
PENR_STOP_LATE, // 6 - compulsory stop is too late
PENR_NUM
};


As for exiting the pits, maybe setup a routine that will detect when the penalty clears.
No you guys have no clue lol. Basically i need to find out when someone stops in a bitbox not the pitlane. It works if they have no penalty. With a penalty it fails to send. =S
You gotta detect the penalty someway or another..... I'm getting to that point in my app as well... so if i figure something out i will let you know
May be use mci.x, mci.y i don't know another way.

or something like this
if ((racer enter pitlane) and (he speed < 10) and (penalty not stop'n'go)) {remember racer penalty; clear.penalty;}
elseif (racer have the remembered penalty) {To renew the penalty}
here is my problem... first pic. No penalty IS_PIT comes in fine. Second pic i have penalty. No IS_PIT
Attached images
PIT.JPG
No_PIT.JPG
ISP_PIT contains data such as pit work done and pit time doesn't it? Well then it wouldn't be sent if the driver has a penalty...there wouldn't be any need for it...
uhhh maybe you need to look in insim.txt a bit more.


struct IS_PIT // PIT stop (stop at pit garage)
{
byte Size; // 24
byte Type; // ISP_PIT
byte ReqI; // 0
byte PLID; // player's unique id
word LapsDone; // laps completed
word Flags; // player flags
byte Sp0;
[B]byte Penalty; // current penalty value (see below)[/B]
byte NumStops; // number of pit stops
byte Sp3;
byte Tyres[4]; // tyres changed
unsigned Work; // pit work
unsigned Spare;
};

lol fair enough, I haven't used ISP_PIT before...

IS_PIT help
(14 posts, started )
FGED GREDG RDFGDR GSFDG