The online racing simulator
I've created a button in the NCN packet, and then I discovered that when I have both lapper and external running, some of the lappers functions stop working. Because when I have the external running, f.ex !drf doesn't work any more. Anyone else experienced the same error? Is there any way I can get around that?
Quote from LeifOlav :I've created a button in the NCN packet, and then I discovered that when I have both lapper and external running, some of the lappers functions stop working. Because when I have the external running, f.ex !drf doesn't work any more. Anyone else experienced the same error? Is there any way I can get around that?

Anyone?

Someone know how I can remove characters from a string? When I get the output from heading and direction to get the angle of the car, i get outputs with both + and -, so I have to remove the - when the output has a - in it. Anyone?
Quote from LeifOlav :I've created a button in the NCN packet, and then I discovered that when I have both lapper and external running, some of the lappers functions stop working. Because when I have the external running, f.ex !drf doesn't work any more. Anyone else experienced the same error? Is there any way I can get around that?

Yup, the !top nor !stats don't work anymore, I didn't try it yet, but I think the solution is simple: Let your app run on another InSim port...
Quote from Silox :Yup, the !top nor !stats don't work anymore, I didn't try it yet, but I think the solution is simple: Let your app run on another InSim port...

But it's not working to run 2 apps on the same server
My program is running with the lapper on the same InSim, only the !commands don't work...

You tested it with different ports?
Quote from Silox :My program is running with the lapper on the same InSim, only the !commands don't work...

You tested it with different ports?

Yea, I tested with insim port 28888 for the lapper, and 29999 for the external, but then the lapper stopped working.
Hi to all...

I' created a cruise mod based in buttons. But, when player click in one action (ex.:buy new car), the actions are directed to Host.

No matter the player that clicked... The command is given by the host

Button Code (Buy Uf1):

//Buying UF1
case 181:
InSim.Send_MST_Message("!comprar uf1");
InSim.Send_BFN_DeleteButton(Enums.BtnFunc.BFN_CLEAR, 0, BTC.UCID);
break;
Hi all

still with my NPL problem.
It sounds that my problem comes from the InSim.Request_NPL_AllPlayers(255) method for populating the players class.
When i have a race with already 16 ia players added my program display only fifteen.
If i start the race from 0 ia player and add one by one as many as i want, i have no problem.
So NPL event is not the problem but the InSim.Request_NPL_AllPlayers(255) is not correct for me with a field already filled with 16 ia players.

If someone can confirm ?

Thx
Duncan
Is it just me and Silox who has this problem with insim and external?
Quote from Silox :My program is running with the lapper on the same InSim, only the !commands don't work...

You tested it with different ports?

Running 2 different InSim apps side-by-side might cause problems with the way both of them receive MSO, and they way in which one might "hide" messages beginning with '!' from another. I'm not sure on that, but it sounds like that could be the problem...


Quote from LeifOlav :Yea, I tested with insim port 28888 for the lapper, and 29999 for the external, but then the lapper stopped working.

LFS can only have one port open at once, so when you opened 29999, it closed 28888, and killed lapper. You need to run them on the same port as each other...


Quote from SkinCast :
//Buying UF1
case 181:
InSim.Send_MST_Message("!comprar uf1");
InSim.Send_BFN_DeleteButton(Enums.BtnFunc.BFN_CLEAR, 0, BTC.UCID);
break;

When you send a message, it is as if the host has typed it. Send a message like this:

InSim.Send_MST_Message("This is a message!");

And you'll see it in-game as "Host: This is a message!". When you send a ! message, it is the host typing it

To work around this, you could have the contents of the !buy UF1 copied into the case 181, so that it does the same thing as actually typing it.


Quote from duncan007 :Hi all

still with my NPL problem.
It sounds that my problem comes from the InSim.Request_NPL_AllPlayers(255) method for populating the players class.
When i have a race with already 16 ia players added my program display only fifteen.
If i start the race from 0 ia player and add one by one as many as i want, i have no problem.
So NPL event is not the problem but the InSim.Request_NPL_AllPlayers(255) is not correct for me with a field already filled with 16 ia players.

If someone can confirm ?

Thx
Duncan

That sounds odd...Are you sure you're counting player 0, as LFS starts from 0?
Works nice!... Thanks dougie-lampkin
Quote from dougie-lampkin :Running 2 different InSim apps side-by-side might cause problems with the way both of them receive MSO, and they way in which one might "hide" messages beginning with '!' from another. I'm not sure on that, but it sounds like that could be the problem...

Okay, thanks for answering

Is there a way I can deactivate the external from receive MSO, so it doesn't make problems with the insim? Beacause I don't need the MSO in the external insim.
Yes. In the init line, with the password, IP address and InSim port, replace '!' with ' '. This will stop it from displaying messages beginning with a space, which is impossible in LFS, rather than a !. Lapper should be able to receive ! messages then
Quote from dougie-lampkin :Yes. In the init line, with the password, IP address and InSim port, replace '!' with ' '. This will stop it from displaying messages beginning with a space, which is impossible in LFS, rather than a !. Lapper should be able to receive ! messages then

Thanks alot! Your my hero!
I want my hero !
Quote from duncan007 :I want my hero !

Your hero has arrived.

I updated LFS External to version 1.1.1.4. Your issue should be fixed now.
Thanks for the help on debugging.
Unbelievable !
I have my Hero !!
I test this new version asap.


I confirm : He's my HERO !
I'm back from holiday and trying to script my own ranking ladder server system... Or how you wish to call it

My first problem:
How do you gather all the race finish results from all players? How to display and how to store it? I would like to store the positions of all the finished racers with the
Private Sub RES_RaceOrQualifyingResult(ByVal RES As Packets.IS_RES)

function.

For example:
Racers finished like this: racer2, racer4, racer1 and racer3 as last. The results should be storred in an array like this: {racer2,racer4,racer1,racer3}.
With this code I can build further on the whole script...

Big question, but after a full day of searching I haven't found an answer...

What I have found is this:
InSim.Request_RES_AllResults()
But I can't find any way to handle or use it.

Thanks in regards, I'll update this post when I've found an answer!

UPDATE
Found more stuff in Private Sub FIN_PlayerFinishedRaces(ByVal FIN As Packets.IS_FIN)
But no way to work with it...

UPDATE 2
Found maybe a way, scripting it now...
Once a players crosses the line, just add him to the array. When the race is finished, divide points

UPDATE 3
Seems to work at the last way

Funny... Every time I post a problem here, I come up with a solution after 5 minutes ^^

UPDATE 4
Array and stuff is working...

1 more problem:
How can you see that everybody has finished?
* sigh * coding the whole day about a simple timer issue, I've let 5 professional programmers have a look at it... Noone came up with a solution...

To test where the error was, I tested to following things:
1.
I enabled a timer from the MSO sub. When I type !blaat, a timer gets activated and once it ticks, it says "Blaat". This works.
2.
I replaced the code which is in timer tick function to the code it should be (underneath an example). The code fails with no error.
3.
I placed the code which doesn't works in the timer tick at step 2 to the !request. This works. But the other timer enabled in the that piece of code doesn't.

Here's the piece of code:

Private Sub Timer3_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer3.Tick

Dim i As Integer

everyfinish = True
InSim.Send_MST_Message("/msg ^7Race ^1ended! ^7Restart in^1 0.5 minutes!")

For i = 0 To UBound(finished)
InSim.Send_MST_Message("/msg " & i + 1 & ". " & finished(i))
Next i
Timer3.Enabled = False
Timer2.Enabled = True
end sub

I'm really tired now, I've worked the whole day and I can't understand why I fail at a simple timer... I hope you guys can come up with a solution.
Outgauge Flags
Hello
I'm new to VB and I've just started a little OutGauge project with LFS External.
But now I've a problem with the "Flags" packet.

Example:

Select Case CInt(og.Flags)
Case Is = 49152
LBL_OG_Local.Text = "Local = Metric"
LBL_OG_Handbrake.Text = "Handbrake = Off"
LBL_OG_Shiftlight.Text = "Shiftlight = Off"
Case Is = 49156
LBL_OG_Local.Text = "Local = Metric"
LBL_OG_Handbrake.Text = "Handbrake = On"
LBL_OG_Shiftlight.Text = "Shiftlight = Off"
Case Is = 49157
LBL_OG_Local.Text = "Local = Metric"
LBL_OG_Handbrake.Text = "Handbrake = On"
LBL_OG_Shiftlight.Text = "Shiftlight = On"
Case Is = 49153
LBL_OG_Local.Text = "Local = Metric"
LBL_OG_Handbrake.Text = "Handbrake = Off"
LBL_OG_Shiftlight.Text = "Shiftlight = On"
Case Is = 0
LBL_OG_Local.Text = "Local = Imperial"
LBL_OG_Handbrake.Text = "Handbrake = Off"
LBL_OG_Shiftlight.Text = "Shiftlight = Off"
Case Is = 4
LBL_OG_Local.Text = "Local = Imperial"
LBL_OG_Handbrake.Text = "Handbrake = On"
LBL_OG_Shiftlight.Text = "Shiftlight = Off"
Case Is = 5
LBL_OG_Local.Text = "Local = Imperial"
LBL_OG_Handbrake.Text = "Handbrake = On"
LBL_OG_Shiftlight.Text = "Shiftlight = On"
Case Is = 1
LBL_OG_Local.Text = "Local = Imperial"
LBL_OG_Handbrake.Text = "Handbrake = Off"
LBL_OG_Shiftlight.Text = "Shiftlight = On"
End Select

This works but if I do this for ALL Flags it becomes very very long, so I think there must be something shorter, am i right?
Please help me

EDIT: Nobody can help me? Please I just don't get it^^

MfG Reese
Ranking System finally finished, and the last (I hope) problem pops up...

In the FIN_PlayerFinishedRaces class, I want to save the playername (pnames) from the player AND the username (unames) from the player to a different array...


Dim pnames(0 to 0), unames (0 to 0) as string

redim preserve pnames(ubound(pnames) + 1)
redim preserve unames(ubound(unames) + 1)

pnames(ubound(pnames)) = Players(GetPlyIdx(FIN.UCID)).Username

' Here's my problem
unames(ubound(unames)) = Players(GetPlyIdx(FIN.UCID)). ???

So... With what do I have to replace the ??? ? Username is not in the list, and when I try it with: Connections(GetConIdx(FIN.UCID)).Username, it returns "" instead of my username. I tried alot of combinations (UCID, PLID, Username, Playername, Players, Connections ... But none of them returned my Username.

Thanks in regards,
Silox aka Tom.

UPDATE:
Got it with some searching around here... Found this:
Connections(GetConnIdx(Players(GetPlyIdx(FIN.PLID)).UniqueID)).Username

It's weird, because I earlier tried this and it didn't work... Oh well, thanks!
TOC bug?
Hi, I'm using LFS External 1.1.1.4 with VB.NET, LFS Z, all was working fine until I had to write some code in TOC_PlayerCarTakeOver subrutine, when someone take over a car in LFS the event is triggered 3 times with the same data, I'm not sure if this is a problem with Insim or LFS External.

Example:

Dim testTOC As Integer = 0

Private Sub TOC_PlayerCarTakeOver(ByVal TOC As Packets.IS_TOC)
Players(GetPlyIdx(TOC.OldUCID)).UniqueID = TOC.NewUCID ' Update Players[] list
Players(GetPlyIdx(TOC.OldUCID)).PlayerID = TOC.PLID ' Update Players[] list

testTOC += 1
InSim.Send_MST_Message("TOC#: " & testTOC.ToString & " NewUCID: " & TOC.NewUCID.ToString & " OldUCID: " & TOC.OldUCID.ToString & " PLID: " & TOC.PLID.ToString)
End Sub

LFS Message:

Host: TOC#: 1 NewUCID: 5 OldUCID: 0 PLID: 1
Host: TOC#: 2 NewUCID: 5 OldUCID: 0 PLID: 1
Host: TOC#: 3 NewUCID: 5 OldUCID: 0 PLID: 1

Could anyone confirm please if this is the way it should work or if there is a problem with LFS External or Insim?

Thank you and sorry for my english.
I can't reproduce that, though I tested with the new upcoming version of LFS External. But I doubt its an error in the current version tbh.

Note that the new version (which is absolutely great :nod is coming out soon.
I think this is the same problem I had a while ago. Basically, if you look at the code. You are looking through the players list for a PLID, but you are parsing a UCID to the code.

Replace the 2 lines of code that are ment to update the players list with the following and it should be fixed.

Players(GetPlyIdx(TOC.PLID)).UniqueID = TOC.NewUCID
Players(GetPlyIdx(TOC.PLID)).PlayerName = Connections(GetConnIdx(TOC.NewUCID)).PlayerName

HTH
Thanks T-RonX, great news , I'll wait for the new version.

@ mcgas001, thx for your help, the problem is not the Players list update but some extra code that I wrote, it's running 3 times instead of 1 because I'm getting 3 TOCs , I'm still wondering what could be wrong

Happy new year!

FGED GREDG RDFGDR GSFDG