The online racing simulator
LFSLapper adding ISP_UCO packet
New Packet/Event , new thread.

New packet: UCO - report InSim checkpoint / InSim circle (autoX objects)

To get data from this packet, the new insimversion is required
Thanks to Yisc[NL] for fixing this problem.

##########################################################
#Actions to do on Insim Checker/Checkpoint (AutoX object)#
##########################################################
#When $Flags(bits) returns a value
#UCO_CIRCLE_ENTER, //0 (00) User entered a Checker
#UCO_CIRCLE_LEAVE, //1 (01) User left a Checker
#UCO_CP_FWD, //2 (10) User crossed Checkpoint in forward direction
#UCO_CP_REV, //3 (11) User crossed Checkpoint in reverse direction

Event OnCrossingChecker($userName,$Flags,$Time,$Object,$UserSpeed,$CircleIndex) # Player event
#privmsg(getplayervar($userName,"NickName"));
#privmsg("Action: ".$Flags);
#privmsg("Time: ".$Time);
#privmsg("Object: ".$Object);
#privmsg("CircleIndex: ".$CircleIndex);
#privmsg("Speed: ".$UserSpeed." ".getplayervar($userName,"UnitSpeed"));
EndEvent

Edit: Check for newest release in Release Thread.
Attached images
UCO Checker_Checkpoint.jpg
Great work - much appreciated.

There are about 2 of you that understand how to use the code you show straight out of the box, so to speak, and maybe a few others that can use lapper but never get involved on this part of forum. For a few of us, especially me, it takes some experimentation and testing to understand how it works.

For instance, your
privmsg("Time: ".$Time);

just outputs a large number, whereas if you want to use it properly, you have to use
privmsg("Time: ".NumToMSH($Time);

To help people like me to understand it bit better, my experimental test code, and on-screen results;
Spoiler - click to reveal##########################################################
#Actions to do on Insim Checker/Checkpoint (AutoX object)#
##########################################################
#When $Flags(bits) returns a value
#UCO_CIRCLE_ENTER, //0 (00) User entered a Checker
#UCO_CIRCLE_LEAVE, //1 (01) User left a Checker
#UCO_CP_FWD, //2 (10) User crossed Checkpoint in forward direction
#UCO_CP_REV, //3 (11) User crossed Checkpoint in reverse direction

Event OnCrossingChecker($userName,$Flags,$Time,$Object,$UserSpeed) # Player event

privmsg("Username: "getplayervar($userName,"NickName"));
privmsg("Flag No ".$Flags);
privmsg("Time: ".NumToMSH($Time)." after crossing S/F line");
privmsg("Object: ".$Object);
privmsg("Speed: ".$UserSpeed." ".getplayervar($userName,"UnitSpeed"));
GlobalMsg ("=============================");
$NickName = getplayervar($userName,"NickName");
$SpeedUnit = getplayervar($userName,"UnitSpeed");

IF ( $Flags == "0" )
THEN
privmsg("".$NickName."^3 entered ".object." circle at ".(NumToMSH($Time)));
privmsg("^3travelling at ".$UserSpeed." ".$SpeedUnit);
ELSE

IF ( $Flags == "1" )
THEN
privmsg("".$NickName."^3 left ".object." circle at ".(NumToMSH($Time)));
privmsg("^3travelling at ".$UserSpeed." ".$SpeedUnit);
ELSE

IF ( $Flags == "2" )
THEN
privmsg("".$NickName."^3 crossed ".object." line at ".(NumToMSH($Time)));
privmsg("^3travelling at ".$UserSpeed." ".$SpeedUnit);
privmsg("^3Going in correct direction");
ELSE

IF ( $Flags == "3" )
THEN
privmsg("".$NickName."^3 crossed ".object." line at ".(NumToMSH($Time)));
privmsg("^3travelling at ".$UserSpeed." ".$SpeedUnit);
privmsg("^1Spec'd for going in wrong direction");
cmdLFS( "/spec " . GetCurrentPlayerVar("UserName") );
ELSE
ENDIF
ENDIF
ENDIF
ENDIF

EndEvent




Grey text is just to output the variables, and coloured text is to output variables in more meaningful way / use.

Flags 0 and 1 used same Insim Circle (first flag for entering, next for exiting - Circle Index 1). Flag 2 used a Finish Line pointing correct way, and Flag 3 used Finish Line turned 180 deg to direction I was travelling.

As you can see, I've used the $flags as 'triggers' in IF statements to do things - mainly just show info, but in flag 3, because i've crossed insim checkpoint wrong way, I've used that to trigger /spec.

PS Don't forget to update info in /docs folder Smile
Attached images
Lapper Object Circles and Lines.png
Whould be nice if it possible to indicate which Checkpoint or Checker you acrossed.
Have edited post to add this info, although some of it in image.

Object 'Circle' = Insim Circle
Object 'Checkpoint' = Insim Checkpoint (1st, 2nd, 3rd checkpoint lines, and finish line available)
Final Release: CON (Carcontact) and UCO (InSim checkpoint / InSim circle) packets


Update: -Add Circleindex to OnCrossingChecker event.
-Version numbering is changed. Last number is now for small codechanges like bugfixes etc.

See first post

FGED GREDG RDFGDR GSFDG