The online racing simulator
Searching in All forums
(104 results)
drew555
S2 licensed
Here's where I have my problems

I'm not a programmer, and have only been playing with lapper for a couple of days - so some of the terms are a little confusing.

Quote :drew_welc2 = "^7Your best drift score: {0} &Don't act the fool&Respect your fellow drifters";

So, where I want bestDriftScore displayed, I put in {0} - and it is replaced by bestDriftScore. I understand that.

Quote :openPrivButton( "pos",25,80,150,10,8,-1,32,langEngine("%{drew_welc2}%",$bestDrifScore ) );

Here's where I start to lose it.

In the "button text" section:

(langEngine("%{drew_welc2}%",$bestDriftScore ) )

It means: Look in the langEngine, Display drew_welc2 then bestDriftScore.

Correct?

Quote :{0} is replaced by the first arg in langengine
{1} is replaced by the second arg in langengine
and so on

I'm a newb - does that mean that in this case:

Lang "EN"

main_welc1 = "Welcome to my server";
main_welc2 = "It's the greatest server";
main_accept = "Continue";
main_deny = "Leave";
main_speedtrap = "^7SPEEDTRAP";

EndLang


That {0} at other places in the script is replaced by "Welcome to my server"?

and {2} is replaced by "Continue"?

So that:

openPrivButton( "cont_button",25,80,150,10,8,-1,32, {2} );

Would give me a button with 'Continue' written on it?

Quote :Dont forget to assign $bestDrifScore with the GetCurrentPlayerVar containing the best drift score.

How do I define bestDriftScore? And what is the significance of the $?

The bestDriftScore that I want to display is the one held in my driftPB.dbs file for the player name.

Thank you for your patience
drew555
S2 licensed
And here's another one...

I have this at the welcome screen:

openPrivButton( "pos",25,80,150,10,8,-1,32,langEngine("%{drew_welc2}%",$Posabs,$Posqual,$Groupqual ) );

(default, apart from the modified langEngine entry)
Pointing to this:

drew_welc2 = "^7Your best drift score:&Don't act the fool&Respect your fellow drifters&Your face.";

What I'm after is getting the players highest score held in the !drf database for this track to be displayed here...

drew_welc2 = "^7Your best drift score: <BestDriftScoreHere>&Don't act the fool&Respect your fellow drifters";

I've tried various ways - but I'm struggling.

Is this even possible?
drew555
S2 licensed
Yes, I understand.

A small lag is very acceptable - I believe that true GPS actually works that way as well.

Thank you.
drew555
S2 licensed
Thank you

Now it's time to get ahead of myself a bit.

There are a couple of things I want to try - one is a GPS speedometer - that shows a constant display of speed, updated in real time.

I know the cars all have speedometers - but I want a GPS one to see actual vehicle speed instead of rear wheel speed.

We do this with GPS units when we do it for real - and I wanted something similar for this.

If this works, I may use it for the angle meter too (having it attached to onDriftScore gives you the angle of the last drift - not in real time).

Is there a function for getting the vehicles true speed in real time?
drew555
S2 licensed
Fixed the pit message, turns out it was this...

Quote : "^1! ^7R E M E M B E R^1 !"
. "&^7First lap after pits ^1may not ^7count!" );

... that was wrong.

Not sure what was wrong with it, but I deleted it and re typed it and it's now fine

Now... how do I change the 0-100 kmh display to read in MPH?
drew555
S2 licensed
I understand now, thank you Gai.

It worked!

Now this one.... also worked in previous lapper:

Event OnNewPlayerJoin( $userName ) # Player event
openPrivButton( "drewpitleave",50,5,100,10,8,3,32, "^1! ^7R E M E M B E R^1 !"
. "&^7First lap after pits ^1may not ^7count!" );
EndEvent


This is the one that I want to make a new mwessage whenever someone leaves the pits.

See anything obvious?
drew555
S2 licensed
Thanks Gai.

I have more questions (all about Lapper 5.9.1.4).

For my previous lapper, I had this:

Event OnSplit1() # Player event
openPrivButton( "split01",50,5,100,10,8,3,32, . "^1Split 01:^7 " . GetCurrentPlayerVar("DriftScore") . " ^1pts" ); );
ENDIF
EndEvent


And it gave me the DriftScore at the split marker.

I've put it directly into Lapper 5.9 and it doesn't appear to work.

Is it something simple in the transfer to 5.9?
drew555
S2 licensed
I went for....

5.9.1.4

So now do I have to re-write the lot or will a lot of my old LFSLapper.lpr file just copy and paste over?
drew555
S2 licensed
That's just made me decide to upgrade to 5.9 - but maybe it's because I've been drinking... but I can't find the best one.

Help?

Which is the best one to download - and where do I click?

Thank you

:edit:

And I meant constant speed - more like as GPS speedometer than a speedtrap
drew555
S2 licensed
Oh, and what do i call upon for Instant speed?

I want a GPS speedo
drew555
S2 licensed
Is "AngleVelocity" the same as "angle", or is it some kind of mathematical thing to do with "Angle + Velocity" or "Angle * Velocity"?

I ask because I've seen it register 110 degrees while I was at nearer 40 degrees

I've tried calling upon "DriftAngle" but getting nothing:

openPrivButton( "drew08",3,155,35,10,10,-1,32, . "^1Angle:^7 " . GetCurrentPlayerVar("DriftAngle") . " °" );
Last edited by drew555, .
drew555
S2 licensed
Oh, and HOW has it helped!

You sir, are my new personal Jesus Christ

I've got the splits working showing the DriftScore at that point.

I've got the DriftScore and LastDriftScore showing up at the right time in the right place.

The message on leaving the pits works.

So, onwards

How do I get the welcome screen (where it says friendly rank -/-) to use drift scores to rank instead of laptimes?

Now that I have got !drf working, is there a way of getting the top scores that are saved by the users Nickname - NOT their username? So that 2 people sharing a controller can sort their high scores by their nicknames.

Thank you

/me goes off in search of a new "command actions" section...
drew555
S2 licensed
Quote from sinanju :
you would just have;

openPrivButton( "remember",2,46,44,8,6,6,32,"^1! ^0R E M E M B E R^1 !" );

And this is exactly what I shall do

Thank you.
drew555
S2 licensed
Thank you both for your amazing help.

Sinanju - am I being cheeky to ask if I can use/ modify some of your coding for my own Driftmeter? Since I've been ploughing some time into Lapper, I've come to want to kind of make my own - as I learn.

I've not got the Sinanju or Lappper driftmeter working - and Gai, I wish I'd have known it was that simple! - but in my investgations I have found that I am enjoying working out ths new, alien language as I create my own.

Many thanks to you all.
drew555
S2 licensed
Wow!

What an answer, thank you!

I'll answer these as I implement them

I'm now replacing my entire Drift Options section with yours, exactly as is, the entire Driftmeter 2-1.txt file will replace my Drifting options.

I'm also going to leave the LANG part on the end, exactly as it is in your Driftmeter 2-1.txt file.

We'll see if that helps.
drew555
S2 licensed
To get the Lapper to display this laps DriftScore instead of split time I assume that this is the bit that needs modifying:

Quote :Event OnSpbSplit1() # Player event
IF ( $enable_pitboard == "true" )
THEN
OnSpbSplit1_Pitboard();
ELSE
IF( GetCurrentPlayerVar("isBestSectorSplit1") == 1 )
THEN
$color = "^2";
ELSE
$color = "^1";
ENDIF
openPrivButton( "id_spb",50,55,100,10,10,5,0,$typ
. " ^7SP1"
. ": " . NumToMSH( GetCurrentPlayerVar("SectorSplit1")) . " "
. $color
. "(" . NumToMSH( GetCurrentPlayerVar("DiffSectorSplit1")) . ")"
. "&^7TPB:" . NumToMSH(GetCurrentPlayerVar("Tpb")) );
ENDIF
EndEvent

I was thinking if something like this:

Quote :Event OnSpbSplit1() # Player event
IF ( $enable_pitboard == "true" )
THEN
OnSpbSplit1_Pitboard();
ELSE
IF( GetCurrentPlayerVar("isBestSectorSplit1") == 1 )
THEN
$color = "^2";
ELSE
$color = "^1";
ENDIF
openPrivButton( "id_spb",50,55,100,10,10,5,0,$typ
. " ^7SP1"
. ": " . NumToMSH( GetCurrentPlayerVar("$DriftScore")) . " "
. $color
ENDIF
EndEvent

The part in italics I have no idea what it should be - something like TopDriftScore?

Am I even nearly right?
drew555
S2 licensed
The #s that are in my drift section are...

In front of comments like this (which I assume are OK):

$MinimumDriftScore = 5000; # Minimum drift score required

Event OnGoodDrift() # Player event

I left this one in:

#cmdLFS( "/spec " . GetCurrentPlayerVar("Nickname") };

To not spectate people who go wrong way (we're animals).

And I've now removed these ones:

#$MinimumDriftSpeed = 50; # Minimum speed in km/h to maintain. Driving below that speed will reset score
#$MinimumDriftAngle = 15; # Minimum angel to maintain. When angle is below value, score is reset
#$MaximumDriftAngle = 100; # Maximum angel to maintain. When angle is above value, score is reset


Did you see anything else obvious in there that I've mashed up?
drew555
S2 licensed
WOW!

That's one very, very busy Lapper!

But I now know that I MUST have the driftmeter working AND Krayy's help system.

:edit:

And I'm going to leave my PitExit function as it is... it seems to be the simplest way to remind people that their first lap drift scores may not count - and my VERY limited skills with Lapper suit simplicity very well
drew555
S2 licensed
Quote :Now cut & paste this into the Lang "EN" array, just below the old help strings:

[n00b]

I have no "Lang" section - I think I may need to make one, but I'm not sure about how to get it right

[/noob]
drew555
S2 licensed
So... the help section is the bit that starts (in command actions):

Quote :CASE "!help":
openPrivButton( "help",25,28,150,10,5,-1,0,"^2Commands list" );
openPrivButton( "help2",25,38,150,6,5,-1,96,"^2General commands"
. "&^3!top ^8[table offset] [3-letter car name] ['filter' pattern]"
. "&^3!drf ^8[table offset] [3-letter car name] ['filter' pattern]"

etc... etc...

Right?

So that means that when you type in !help, you get the actions afterwards - openPrivButton and put the text that follows on the button?

Is this the part that needs changing for Krayy's version?

And I still can't find the lang section
drew555
S2 licensed
Quote from sinanju :I'd recommend you get yourself a PubStat - I've had problems when I've forgot to add to my lapper file.

With this being only for a LAN party is that necessary? if so, I'll sort it. I only left it out because I had no intentions of taking this online.

Quote from sinanju :You're "halp" button - you need a sub-routine to go with this (i.e. what happens when you click the Help button?)
To show what a sub-routine does, look at the "clos" button, which has openPrivButton("clos",78,120,20,10,10,-1,32,"^7CONTINUE",OnConnectClose );
The sub-routine for this is OnConnectClose

That was an experiment, lol - but now you've told me how to work it, I might continue with it.

Quote from sinanju :I'd suggest you look at Krayy's very useful replacement !Help function, and maybe try use and amend this to suit yourself.

See http://www.lfsforum.net/showthread.php?t=60201

Looking and reading now

Quote from sinanju :
  • Looking in your Drifting section, you've left the # character in front of a lot of the coding lines you would need - this character tells lapper to ignore anything on the line after this (the /* and */ tells lapper to ignore everything in between - as per the lapper script, the first part gives an explanation on some of the coding, which lapper ignores until it gets to the General options section).

I'll have a look through it now and see if I can make a better job of it
drew555
S2 licensed
I ended up sticking with the code I created - wow, I created my own code for the first time ever!

I love this stuff

Now to get the little bits finished and I'll be done and ready for the LAN party

Issues now are:

1) Getting the driftmeter to work, because it looks amazing.

2) Get the welcome screen to announce either a) the players best drift score or b) the players current !drf position.

3) Get the split time display to display current drift score for the lap in stead of times.

I really appreciate everyone helping me out

Thanks.
drew555
S2 licensed
Quote from Gai-Luron :is PSPAD in UTF8? , menu "FORMAT" UTF8 checked, what's is you LFS version?
Your symbol here it work!

YAY!

Sorted it! I wasn't in UTF-8.

Thanks a million Gai, for persevering with me.

Trying your new code now Sinanju
drew555
S2 licensed
Re: the TM logo, it's just not happening.

I've got me pspad (which is lovely), and installed the .ini file for lapper highlighting (also great).

I've tried using the CTRL+A ascii table AND the symbol inserter - they both give me the logo in pspad but not in lapper

And Gai - like I said, I'm happy with it

Now just to get this damn symbol to work and I'll be a very happy bunny.
drew555
S2 licensed
The code you made didn't work

So I played with it, and got this....

Quote :Event OnNewPlayerJoin()

openPrivButton( "pitleave3",50,5,100,10,10,4,16,"^1! ^7R E M E M B E R^1 !"
. "&^7First lap after pits ^1doesn't ^7count!" );

EndEvent

Which does EXACTLY what I want, except one thing.

It pops up when the lapper is started - at the same time as the welcome screen.

Is there a way to supress this at start?

I can live with it, but I'd rather not have to
FGED GREDG RDFGDR GSFDG