Hm, bug or not, I don't know.. because as GeForz said, no PLP is sent when going from spectated to pit. I believe it's intentional, because "PLP" means a player keeps his position in race, but when spectated (or in "lobby screen"), there is no position to keep.
But a workaround: When the game goes to "lobby screen", the ISS_GAME bit in STA.Flags gets set to 0. (actually I thought the ISS_FRONT_END bit would get set, but it doesnt.. hm.. bug? Or what's the meaning of this bit?).
So you can detect the game going to "lobby screen" by looking at that bit, and then consider all drivers as pittet, because a NPL is sent when a player joins the game again. Would that work for you?
OK. I don't know excactly what your script does or how it works so I really cant say how to solve it... but I'm pretty sure it could be solved without a "lobby screen" PLP packet.
Im not sure thats really possible? A spectator doesnt send any packets, only recieve, so I dont think there would be any lag issues with spectators.
But I might be wrong.
Just in case you didn't know, there is a bug in the compcar struct when a player is in pit, so you shouldnt rely on the compcar.Info alone.. http://www.lfsforum.net/showthread.php?t=28061
Hey all, old thread, but I got the excact same problem..
If I send SCH 'h' to LFS, it turns on my right indicator.. but when I press 'h' in LFS, the history list is enabled/disabled, just as it's supposed to do. To turn on the right indicator, I have to press '8'... (and yes, I know the SCH 'h' is recieved as a 'h' in LFS, cause if I open the chat window before I send it I can see a 'h' being written)
The same for all other keys I try to send... they are recieved correctly in LFS, but are interpreted totally wrong. Is it just me, or is something very wrong?
Well, if it is supposed to be controlled by an admin (or two..), then why just don't use the /p_?? command to give a penalty, or /spectate to spectate him? Or ban or kick him as speedway said.
Just FYI: This algorithm didn't work for me at all, dunno why.
But I searched the net and found this algorithm.. (look at "Code Sample"). The "polygon" in my case is simply a rectangle (the car).
This seems to be spot on... tested with the UF1, and it's close to 90% perfect, the reason why it's not 100% is because it's hard to find the excact length and width of the car, and where the "centre" x,y of the car (reported by mci) is. I assumed it was in the middle of the car, but not sure if that's right
Anyways, for my app this is good enough. I was looking for a way to detect contact between UF1 at relative slow speeds, and that's what I got. So I'm happy.. for now
But does anyone know the excact length and width of all or some cars? And where the centre point of the cars are located? I've only figured out the UF1, and the length seems to be 2,84 meters and width 1,47 meters, but I doubt these are the excact figures.
But there is one big problems with using the "rectangle-overlap-detection" method only, and that is the rate of the MCI packets. With shortest delay (50 ms) and 32 cars on track (4 packets between each cars MCI), you get a 200 ms interval between one cars MCI... so when cars are moving fast, a lot of things can happen in 200 ms that this method wont detect.
Also there could in theory be up to 100 ms between two close cars' MCI packets, so even though you detect overlapping rectangles, it doesn'h have to mean contact, it's just one car chasing another at high speed.
(and, but not that important, car sizes are not constant, a crashed car for example could be shorter than a repaired one)
So in addition to this method I guess I have to look at change in velocity and direction (as sdether mentioned), and maybe use that when cars are moving fast, and rectangle-overlapping for slow moving cars?
But thanks for pointing me in the right direction, more ideas and thoughts are more than welcome
I'm working on an insim app where I have to find a way to detect a collision or contact between cars. I assume this can be done by looking at mci packets and calculating distance between cars (using X and Y), but that will (for several reasons) never be 100% accurate (or at least thats what I think...).
I hate to re-invent the wheel, so have any of you done something like this already, and would like to share this with me?
Or would anyone of you like to help me out with this? Any ideas are more than welcome.
Or maybe even Scawen would be so nice to add a insim packet that notifies you when there is contact between two cars?
When a player is in pit (PLP), his MCI CompCar struct is set to 0, including Info byte.
So, if his CompCar is CCI_FIRST or CCI_LAST, this info is missing.
(yes, this one caused some brain twisting... )
Edit: Not entire struct is set to 0, PLID is still intact.
Seriously dude... people here are able to think for themself and have an opinion on something without people writing them trying to tell them whats best. I just don't see the point. At all. Go cure world hunger or something instead of wasting your time on writing lame PM's.
I'm really glad you took time to read, and understand, my post before replying...
I'm against this. Usually qualifying only lasts an hour.
So just because it's a feature YOU don't need, you're against it? It wouldn't hurt, would it?
Edit: WOOOW! a bit of pre-weekend-grumpyness there, Nikka? Go home, have a beer and relax in the sun!
(but i wont edit my reply cause I still think your post was rather stupid)
Usualy when my team is practicing for some event, we like to do it in qual-mode, cause then it's easier to keep track of each others best lap.
BUT. Maximum qual time is 60 minutes, and that is sometimes not enough. So my wish would be to either:
show the best lap time of each driver when in practice mode (just like in qual)
or:
have "unlimited" (or at least much longer than an hour) qualification length.
The former makes most sense, the latter is easier for Mr. Roberts to implement i guess. But either work.
Today (May 31st) it's 2 years since some morons raced in S1 demo, and thought it might be fun to put the tag "[noobs]" in front of their names. Since then more morons have come and gone, but the hard core of true noobs still remains.. (and the rest is history, yada yada yada)
Sooo, big party tonight! Bring your car, a sixpack of (non-alcoholic) beer, and obviously a NICE birthday present.
Starting in the "[noobs] jump!"-server at 20:00 CEST / 18:00UTC, and you'll never know where it goes from there. But expect some banger racing, ai challenge, some semi-serious racing at the classic [noobs]-combos, and more.
- Can show up to 240 local and 240 host buttons
- Added an ISF_ flag to specify local or host program (replaces ClickID ranges)
Excelent, but you might consider removing this comment to prevent confusion:
// ClickID byte : buttons from the host and local buttons are kept separate.
// If you are writing a host program to show buttons on host or guests. use
// the range 0 to 159. If you are writing a strictly local InSim program you
// must use the values 160 to 239 so that your program can be used online.
// This allows local InSim buttons at the same time as host buttons.
// Local InSim programmers should try to avoid overlapping host buttons.