The online racing simulator
Searching in All forums
(893 results)
Bass-Driver
S3 licensed
Whould be nice if it possible to indicate which Checkpoint or Checker you acrossed.
LFSLapper adding ISP_UCO packet
Bass-Driver
S3 licensed
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.
Last edited by Bass-Driver, .
Bass-Driver
S3 licensed
This should be a sticky topic.
Bass-Driver
S3 licensed
New packet: UCO
Last edited by Bass-Driver, .
Bass-Driver
S3 licensed
Congrats you did. Thank you
i'm soo stupid.

i totally missed the byte[] or i just didnt know what it means. Sounds very logical to me now. Each packet is 1 byte.

To be sure it works i have add a UCO packet.
As you can see i get data from it.
Bass-Driver
S3 licensed
Lapper sends ISI data to LFS with

byte[] inSimInit = myEncoder.ISI(adminPassword, 0, 0, nameApp, isLocal);
try
{
this.Send(inSimInit, inSimInit.Length);
}
/////////////////////////////////////////////////////////////////////////////////////
public byte[] ISI(string adminPass, int portNum, byte mciSeconds, string nameApp, bool local)
{
byte[] packet = new byte[44];
packet[0] = 44;
packet[1] = (byte)TypePack.ISP_ISI;
packet[2] = 1;
packet[3] = 0;
// Port
packet[4] = (byte)(portNum % 256); // LSB
packet[5] = (byte)(portNum / 256); // MSB

// Flags
if (local)
packet[6] = (byte)ISF.MCI | (byte)ISF.LOCAL | (byte)ISF.OBH | (byte)ISF.CON; // LSB
else
packet[6] = (byte)ISF.MCI | (byte)ISF.OBH | (byte)ISF.CON; // LSB

packet[7] = 7; //Insim Version

packet[8] = 0;

packet[9] = (byte)'!';

// Number of milli seconds between NLP or MCI packets (0=none)
packet[10] = 100; // LSB
packet[11] = 0; // MSB

System.Text.Encoding.ASCII.GetBytes(adminPass, 0, Math.Min(adminPass.Length, 16), packet, 12);
System.Text.Encoding.ASCII.GetBytes(nameApp, 0, Math.Min(nameApp.Length, 16), packet, 28);

return packet;
}

Also i have found a peace of code that isnt used:

//request version Not Need in insim 4, because ISI send This
// byte[] verreq = InSim.Encoder.VER();
// this.Send(verreq, verreq.Length);
//retr version info

I have tried to add/changed code, but nothing works.
Bass-Driver
S3 licensed
ooh sh*t, i forgot to delete some code. About Insim_version 7: this is not the
insimversion that lapper is using. its just a var that i can request from the LFSversion packet.
Last edited by Bass-Driver, .
Bass-Driver
S3 licensed
I added 2 emtpy files: LapperVars and Lapper Functions. Here are a few examples.

LapperVars:

Event OnObjectHit:

$DetectHitObject = ""; #To get objectstrings for detection look at docs/ObjectHit.txt

Event OnMaxCarResets

$MaxCarResets = 0;

Static vars that cannot be changed while lapper is running.

Lapper Functions :

privmsg("Your Text here"); # Send text to player
globalMsg("Text Here");#Send text to all players

Not sure if i'm taking over lapper, because sometimes its very hard to understand the lapper sourcecode. And as a non-programmer, it was/is a struggling to get the code working.

But it was/is very learnable and fun todo. I know a littlebit more about C#.

For example: To request InsimVersion 7.
To get data from the newest packets, lapper must request the latest insim version, version 7 in this case. I have changed the code many times. Also i have checked other library's how they request the insimversion. But lapper is completely differend.

i have sent Gai-Luron a PM, to take a look. but no response yet.
Bass-Driver
S3 licensed
Thx, have changed it.

Maybe a good idea, to make a doc with all the lapper vars and functions.
Bass-Driver
S3 licensed
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.
Last edited by Bass-Driver, .
Bass-Driver
S3 licensed
Well,what i think, is that LFSLapper cannot find a Username from one of the AI's it crashed. I have add this issue in my Bugfix/Test/ToDo list.

Edit: New testversion ver 7002B:

Add: TrackSide_Objects to objectlist.txt
Change: All_Markers is now renamed to All_TurnMarkers
Fix: LFSLapper crash when hitting a AI car.
Last edited by Bass-Driver, .
Bass-Driver
S3 licensed
'scenery object' can be added.

I will test if LFSLapper gets data when hitting a Non-moving object on the track.
Bass-Driver
S3 licensed
Hi ,
This tool is very helpfull.

Whould you update this tool with the latest InsimPackets and version?
Bass-Driver
S3 licensed
Update:

Adding the packet is going very well.Thanks to Yisc[NL] for helping me.

This is the event for now that i created in LFSLapper.LPR.

Event OnCarContact($PlayerA,$PlayerB,$PlayerA_Speed,$PlayerB_Speed,$PlayerA_X,$PlayerB_X,$PlayerA_Y,$PlayerB_Y) # Player event
EndEvent

LFSLapper adding ISP_CON (Car Contact) packet
Bass-Driver
S3 licensed
Hi everyone,

I'm currently trying to add the 'CarContact' packet in LFSLapper.
This packet should work in Lapper because the packet is added in InsimVersion 5.

For testing i need someone who i can hit. So that i can check, if i get any data from the packet.

To be sure that i get the right data during tests. I run the app InsimSniffer. Thank you DarkTimes for the helpfull app. I hope he update it to the new InsimVersion.
Last edited by Bass-Driver, .
Bass-Driver
S3 licensed
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
Last edited by Bass-Driver, .
Bass-Driver
S3 licensed
Update:

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


@ sinanju:
That is how $ObjectFlag works.
Last edited by Bass-Driver, .
Bass-Driver
S3 licensed
$objectflag // Flag of object

OBH_LAYOUT, //1 // an added object
OBH_CAN_MOVE, //2 // a movable object
OBH_WAS_MOVING, //4 // was moving before this hit
OBH_ON_SPOT //8 // object in original position

Is it nessesary to have that Var? otherwise i delete it.

Edit: I have fixed the value of the $Object_X and $Object_Y.
It displays now a correct value, instead of a high unknown value.
Last edited by Bass-Driver, .
FGED GREDG RDFGDR GSFDG