The online racing simulator
Object Speed Trap
Hey there guys!

I would like to request a program or at least some help on how to make it. I'm in desperate need of a speedtrap that is dependent on layouts. I would like to set up a speed trap between two "Pole white' objects, so when the a car goes through that zone, the program returns the current, only the current velocity of the car in Km/h. I hope there is a solution for that problem of mine. Thanks for your answers in advance.
Well, speaking from what I know about insim.

Each track is divided into a variety of nodes. The easiest way would be to listen to IS_MCI packets. After that, you'd have 2 options.

1) Cache the last_node of each PLID. When the node changes from the "prior" node to the "detection" node, get the speed and do whatever you want with it.

2) Check the X/Y/Z (probably just X/Y, except if you place a detection at the KY3 bridge or FE3/4 bridge) and if it falls into your desired range, check speed and do whatever you want.

I think you could read the layout as well for the cone objects that are currently on the track, but hard coded node/zone would work as well.

I see the node one being more reliable in case of dropped MCI packets, but the x/y one would be more "I wanna place a zone in an unusual spot".
Thanks for the help dood. By the way, is there a way to get the X/Y of layout objects, so that can be changed dynamically or I have to hardcode stuff for every single layout I intend to use, as it would be like 6-8 different layouts that I'd use the speedtrap for.
LFSLapper ('lapper') has an optional extra called "Radar Trap", which if you enable, you can add your own track 'nodes' (as described above) or 'zones', which are specific areas of the track.

Lapper has simple command to find the node or zone you are in - just type !node or !zone as applicable, and add these details to the small radartrap file.

To see it in use, I have various zones set up within my server layout (at Sin'rs), which apart from showing current speed, also shows if you are faster or slower than previous fastest recorded speed within the trap.
Attached images
Speedtrap.png
Quote from sinanju :LFSLapper ('lapper') has an optional extra called "Radar Trap", which if you enable, you can add your own track 'nodes' (as described above) or 'zones', which are specific areas of the track.

Lapper has simple command to find the node or zone you are in - just type !node or !zone as applicable, and add these details to the small radartrap file.

To see it in use, I have various zones set up within my server layout (at Sin'rs), which apart from showing current speed, also shows if you are faster or slower than previous fastest recorded speed within the trap.

Wow, that's exactly what I'm in desperate need of. Is that an open source application or is there a way to get that single function out of the Lapper?
You can download copy of version 6.013b here.

Look for file called addonsused.lpr

Open in text editor (Notepad, etc), and add the line

include( "./radartrap.lpr");

Save and close. Line can be added on any blank line.

Download and unzip attached radartrap file, and save into same directory where you found the addonused.lpr file (in later version of lapper, the file is already there, but I couldn't find it online). Should be in the /includes directory.

If you open the radartrap file up, you will see a selection of tracks that already have some details input.

For instance
RegisterNodeAction( "BL1" , 86 , RadarTrap2,"" );

This tells lapper to show the speed when car reaches Node 86 at Blackwood (BL1).

If you want to add your own for Blackwood, you would drive to the point on the track you want the speed trap to be, type !node, then add a line, such as
RegisterNodeAction( "BL1" , 125 , RadarTrap3,"" );

As there are already 2 nodes recorded, the 3rd becomes RadarTrap3. If you want more speed traps, increment the number (you should easily get a dozen).

If you want to use zones rather than nodes (for instance, on an AutoX are, where there are no nodes), you would drive to point you want speed trap to be, type !zone, then add the following line

RegisterZoneAction( "BL1" , -43,328, 1 , RadarTrap3,"" );

So this would be a 1m circular zone (you could change to 2 or 3 meters if you wanted - just change number to suit) located at -43,328 (x,y coordinates) at BL1.

If you get an error while inputting !node or !zone about not being admin, then look for files called admin.txt and superusers.txt, open them and add your username before saving and closing.

If there's anything in lapper you don't want to use - you can easily customise and make it a lite version - see HERE.

It's all customisable, so if you want to move things about or change colours, its very straightforward.

Good luck.
Attached files
radartrap.zip - 1.7 KB - 710 views
Thanks for the help, I really appeciate it
Quote from Kristi :Thanks for the help, I really appeciate it

People say that the forum isn't helpful.
i cant put it to work on WE1X
Can Anyone help me?
You will not be able to use Nodes in X and Y track configurations, so you will have to either set up Zones or use an InSim Circle.

A Zone is an invisible InSim Circle, which consists of X, Y placement and size (diameter in metres).

If you want to use an InSim Circle, go into SHIFT U mode, edit, Marshall, InSim Circle, then place circle on track using letter O key. Use E and W to widen or shrink as appropriate, and take a note of the circle index number. This will be needed to tell your InSim what should happen when car is driven into the circle.

Another difference between a Zone and an InSim circle, is the Zone is placed on the ground, but the InSim circle can be lowered or raised in the Z dimension.

FGED GREDG RDFGDR GSFDG