The online racing simulator
Update:

Fixed: Values of $Object_X and $Object_Y
Update: $TypeOfObject changed to $ObjectType


@ sinanju:
That is how $ObjectFlag works.
After all your hard work on this (much appreciated), I've sort of decided how i'm most likely to use this additional Event....



Image is of text above windscreen mirror.
Quote :#############################
#Actions to do on Hit Object#
#############################
$DetectHitObject = "All_Objects"; # To get objectstrings for detection look at docs/ObjectHit.txt

Event OnObjectCollision($userName,$ObjectFlag,$ObjectHitTime,$Object_X,$Object_Y,$Object_Z,$ObjectType) # Player event

$OCS = GetCurrentPlayerVar("ObjectContactSpeed"); # Speed of player when hitting a object
$OCS_kph = round(($OCS),0); # kph rounded to nearest integer
$OCS_mph = round(($OCS*0.621371),0); # converted to mph and rounded to nearest integer

openGlobalButton( "hud_message",70,1,65,5,4,8,0,"^1WARNING: ".getplayervar($userName,"NickName")."^0 just hit ^2".$ObjectType." ^0at ^4".$OCS_mph." ^0mph /^4 ".$OCS_kph."^0 Kph");

EndEvent

Attached images
Object Flags 3.png
Is it possible to list specific concrete objects in the '$DetectHitObject' string?

I've been using Skytracks (layouts in the sky) on my servers, but in testing, I keep getting messages about 'hitting' slabs and ramps, when in fact, all I'm doing is driving on the layout.

I use ramps to make undulations, so you might go up a ramp or two, level out on a slab or two, then back down ramp(s) to level off again.

Each time I change, I get message.

In fact, when you spawn into the Start position, you land on a slab so you get a message.

Haven't tested with concrete wedges.
its possible. ill add all specific concrete objects to the list

Edit: New version
[Add] 8 new objectstrings(concrete) for '$DetectHitObject'. See doc/ObjectHit.txt for info


Note: previous versions are deleted
Testing something else in lapper today and noticed that unless you use "All_Objects", you don't get message when hitting a 'scenery object'.

Because I don't want message when driving on concrete slabs and ramps on my skytrack layouts, I basically have long list that includes everything else but slabs and ramps, but if you use same list on a proper track, with no added Autocross objects, the only things that records a 'hit' are marker boards. This is in my list, but so are cones and tyres, and these don't get hit message when they're part of proper track scenery.

Can a 'scenery object' be added as a choice?

Of no real interest, but my list:
Spoiler - click to reveal
$DetectHitObject = "All_Tires+All_Cones+All_Markers+All_DistMarkers+All_Post+All_Railings+All_Barriers+Bale+Banners+SpeedBumps+KeepSigns+SpeedSigns+Concrete_Walls+Concrete_Pillars+Concrete_SlabWalls+Concrete_RampWalls+Concrete_ShortSlabWalls+Concrete_Wedges";


Also.

If you drive on a normal track with "All_Objects" enabled, you will only get message when you hit an object that can move (cones, tyres, marker boards), but not if you hit fence, wall, rubber covered barrier, and other non-moving objects.

Can a non-moving object be added?

As it's mainly needed for walls and barriers, maybe "wall barrier", "barrier wall", "wall/barrier" or "barrier/wall"? Or something else you can think of that explains better.
'scenery object' can be added.

I will test if LFSLapper gets data when hitting a Non-moving object on the track.
Attached files
OBH Packet.txt - 23.4 KB - 382 views
Thanks.

Can almost follow the list and how you group objects Smile

Can 'Scenery Object' be called 'Trackside Object'? Or something more relevant? Scenery sounds like you hit a tree.

Can the turn markers be grouped too?

if (newCfg.varsLapper.DetectHitObject.Contains("All_TurnMarkers") && (obh.Index > 63 && obh.Index < 78))
Those Turn markers are already grouped: 'All_Markers'. Maybe i should rename it to 'All_TurnMarkers'


Edit:

After some testing with the "Scenery objects" ( $DetectHitObject = "All_Objects").I have noticed that some objects are defined as Scenery Objects or as a normal AutoX objects, like cones for example.

You should get a message from all "AutoX objects" on the track.
Next time you update lapper, can you change few things?

The objecthit.txt file needs edited.

'All_Markers' should be 'All_TurnMarkers'.

Request; can 'railings' in your code be changed to 'Armco'?

You have
All_Railings // (Short/Medium/Long Railing)

Think would be better if
All_Armco // (Short/Medium/Long Armco)

Keeps these separate from the small pedestrian railing.

Plus, in $DetectHitObject, I can't get 'scenery' to work (as described in objecthit.txt file), nor 'Trackside_Object', 'Trackside_Objects' or even 'TrackSide_Objects'.
Sorry for the incomplete 'ObjectsList'

Should be: TrackSide_Objects
if (newCfg.varsLapper.DetectHitObject.Contains("TrackSide_Objects") && (obh.Index == 0)) //(Scenery Objects)

Changed: 'All_Railings' to 'All_Armco'
Add: 'Railing' as object

Shall i rename the objects too?
Thanks for that.

I thought I'd tried 'TrackSide_Objects' and it hadn't worked, but I've just tried again, and now it does work Tilt My bad.

Railing - That was already in. I just wanted to differentiate between that and the Armco.

Rest of objects are fine.
2

FGED GREDG RDFGDR GSFDG