The online racing simulator
Need help with UCO packet
(4 posts, started )
Need help with UCO packet
Hello guys!
I'm trying to understand how to check if InSim's Checkpoint is Finish line, 1st checkpoint, 2nd checkpoint, etc. So i tried using everything in InSimDotNet but can't figure it out... I need you help how to get the info. Already read insim manuals, which says:
// Identifying an InSim checkpoint from the ObjectInfo :

// Index is 252. Checkpoint index (seen in the autocross editor) is stored in Flags bits 0 and 1

// 00 = finish line
// 01 = 1st checkpoint
// 10 = 2nd checkpoint
// 11 = 3rd checkpoint

I hope you can help you.
Thanks! Smile
#2 - Racon
The UCO packet has the following format: Size/Type/ReqI/PLID/Sp0/UCOAction/Sp2/Sp3/Time/CarContOBJ/ObjectInfo

ObjectInfo is further broken down like this: X/Y/Zbyte/Flags/Index/Heading

The Index and Flags it refers to are in the ObjectInfo part.

Edit (to add a hint made in PM, for the benefit of others): The 'checkpoint index' stored in the flags byte for a checkpoint is stored in bits 0 an 1, so you need to separate those two bits from the others once you know you're dealing with a checkpoint. Something along the lines of "checkpointindex = UCO.ObjectInfo.Flags & 3", depending on your language and library.
public void UCO_UserControlObject(InSim insim, IS_UCO uco)
{
if (uco.UCOAction == UCOAction.UCO_CP_FWD || uco.UCOAction == UCOAction.UCO_CP_REV)
{}
}
Got it working! Thanks to Racon! Smile

Need help with UCO packet
(4 posts, started )
FGED GREDG RDFGDR GSFDG