View Full Version : Simple quick questions..
drew555
19th December 2009, 10:17
I have lots of little questions... I'll keep them all in here :-)
Is there an escape code for the TM superscript logo?
I want to have a trademark logo show up in the Lapper welcome screen - but I can't figure out what the code is :(
My nickname comes up as ^1Drew ^0[^1?^0Pirate] but it doesn't work on the Lapper screen.
drew555
19th December 2009, 10:38
While we're at it...
I'd like to have a message pop up on screen when anyone leaves the pit box - I assume this is possible using something like 'OnLeavePits' but I can't find anything like that in the lfslapper.lpr file :(
And is there a resource online that covers all of the avaliable commands so I can leave Gai alone for a little while?
drew555
19th December 2009, 11:16
And to make it a round 3 posts :D ....
The driftscore personal bests don't appear when using !drf - the table is blank although I have done several runs. << Fixed, I was a noob, hadn't set the default car to XRT :p
And... I want the welcome screen (where it says friendly rank -/-) to use drift scores to rank instead of laptimes.
All help gratefully recieved - I suck :D
Degats
19th December 2009, 13:31
1. You could try pasting ™ in the code - there isn't an escape character when lfs saves a .ply file.
2. The IS_NPL packet is sent when a player joins the race/leaves the pits. I don't know how you'd find out when one is received using LFSLapper though, because I've never played with the code.
3. :shrug:
drew555
19th December 2009, 13:34
lol, thanks Elmo.
I've tried copying and pasting and unicode and allsorts - Marius is stumped also.
Degats
19th December 2009, 13:51
Ascii 153
drew555
19th December 2009, 14:10
I came up with this... ™ as being the ascii code.
This is the line of code I ended up with...
openPrivButton( "welc",25,50,150,15,12,-1,16,"^1Welcome " . $NickName . " ^1to [™Pirate] server!&^0Type ^7!help ^0after leaving garage to see commands." );
And it didn't work - it actually displayed:
[#153;Pirate]
And I want...
[™Pirate]
:edit: ffs - I can't get the forum to show the ascii code, buy you get what I mean. Instead of the TM logo, I'm actually getting the ascii code minus an 'and' symbol.
drew555
19th December 2009, 14:45
Wanted a tidy up - I'm a messy begger lol.
1). Is there an escape code for the TM superscript logo?
I want to have a trademark logo show up in the Lapper welcome screen - but I can't figure out what the code is :(
My nickname comes up as Drew [™Pirate] but it doesn't work on the Lapper screen.
2). I'd like to have a message pop up on screen when anyone leaves the pit box - I assume this is possible using something like 'OnLeavePits' but I can't find anything like that in the lfslapper.lpr file :(
3). And... how do I get the welcome screen (where it says friendly rank -/-) to use drift scores to rank instead of laptimes?
4). Last one for now :) 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?
Thank you.
Degats
19th December 2009, 15:05
You have to actually tell it to add a character of ascii value whatever to the string, rather than putting ™ in the code.
Can't really help you on how to do that, because my experience in C# is practically nill, but I'll have a quick search.
edit:
this may work...
openPrivButton( "welc",25,50,150,15,12,-1,16,"^1Welcome " . $NickName . " ^1to [" . new string((Char)153,1) . "Pirate] server!&^0Type ^7!help ^0after leaving garage to see commands." );
drew555
19th December 2009, 15:09
I <3 you Elmo mwah x
drew555
19th December 2009, 15:25
WOW!
It seriously didn't like that.
Copied it directly over the one I had there... and as soon as I reloaded it, it fell over and nothing happened :o
That's not good...
sinanju
19th December 2009, 23:02
Haven't seen anything that will give you your TM code - maybe you'll just have to make it ordinary text? Maybe in different colour too.
2). I'd like to have a message pop up on screen when anyone leaves the pit box - I assume this is possible using something like 'OnLeavePits' but I can't find anything like that in the lfslapper.lpr fileLook for the OnEndPit event.
For instance;
Event OnEndPit( $userName )
openPrivButton( "pitleave1",50,40,100,34,1,4,32," " );
openPrivButton( "pitleave2",50,40,100,34,1,4,16," " );
openPrivButton( "pitleave3",50,40,100,20,14,4,16,"^1! ^0R E M E M B E R^1 !"
. "&^7Watch for other cars when leaving pit box!" );
EndEvent
3). And... how do I get the welcome screen (where it says friendly rank -/-) to use drift scores to rank instead of laptimes?The friendly rank uses $Posabs (absolute Position?) to show which driver has fastest lap on your chosen track. Nothing like that for drift leader, although quite a good idea.
Maybe you could try playing about with drf( $argv ); code?
Degats
20th December 2009, 02:32
Regarding the TM - this isn't very elegant, but may be the only way of doing it.
Create a char variable, set it to 153, then use the variable as part of the string in the same way $NickName is used.
If that still doesn't work, then maybe someone who knows anything about C# (ie not me) will step in ;)
Gai-Luron
20th December 2009, 10:02
1 - Do not use notepad, use an utf8 editor (it's an obligation) like psppad as recommended in quickstart http://www.lfs-lapper.org/help/en/quick_start.htm
2 - insert the car 153 like said above or in pspad use ascii table ALT+A to insert this car.
That's all.
Gai-Luron
drew555
20th December 2009, 11:16
Event OnEndPit( $userName )
openPrivButton( "pitleave1",50,40,100,34,1,4,32," " );
openPrivButton( "pitleave2",50,40,100,34,1,4,16," " );
openPrivButton( "pitleave3",50,40,100,20,14,4,16,"^1! ^0R E M E M B E R^1 !"
. "&^7Watch for other cars when leaving pit box!" );
EndEvent
Thank you, I'll give it a bash :thumb:
Thanks Elmo - I'll start googling, lol.
And Gai - I'll download psppad now ;)
sinanju
20th December 2009, 11:39
If using PSPad, I'd recommend you use Tim's .ini file too - see http://www.lfsforum.net/showthread.php?t=59967
drew555
20th December 2009, 11:39
The code you made didn't work :(
So I played with it, and got this....
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 :)
Gai-Luron
20th December 2009, 11:44
When LFSLapper start for an instance of LFS it request player connected and player joined the race to have all internal value set.
No way to suppress that, but there is no reason to start an stop instance when all your config is done. Except when you dev, but in this case, it's not a problem
Gai-Luron
drew555
20th December 2009, 11:53
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.
sinanju
20th December 2009, 12:05
The code you made didn't work :(...
Sorry, you're using older version of lapper, so maybe try this:
Event OnEndPit
openPrivButton( "pitleave1",50,40,100,34,1,4,32," " );
openPrivButton( "pitleave2",50,40,100,34,1,4,16," " );
openPrivButton( "pitleave3",50,40,100,20,14,4,16,"^1! ^0R E M E M B E R^1 !"
. "&^7Watch for other cars when leaving pit box!" );
EndEvent
Basically, I've just removed the ( $userName ) from the first line.
Gai-Luron
20th December 2009, 12:11
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.
is PSPAD in UTF8? , menu "FORMAT" UTF8 checked, what's is you LFS version?
Your symbol here it work!
drew555
20th December 2009, 12:26
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
20th December 2009, 12:38
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.
sinanju
20th December 2009, 12:54
Trying your new code now Sinanju :)
Message when leaving pits - There may be another way if your version of lapper supports RegisterZoneAction (my version is 5.844).
But for this one, you would have to get the zone for every track and configuration - including reverse (leave the pits, and wherever you want message to appear, type !zone and record co-ordinates - and remember that some co-ordinates are a minus).
I use the following:
In the Event OnLapperStart() section
RegisterZoneAction( "AS1" , -313,-136, 3 , SE_leavepits );
Then a bit later, I put in my sub-routine
Sub SE_leavepits() # SE is a Sinanju Event, meaning one I made up myself
$NickName = GetCurrentPlayerVar("NickName");
openPrivButton( "blank_back",1,45,46,25,3,8,32," ");
openPrivButton( "remember",2,46,44,8,6,8,32,langEngine( "%{main_remember}%", $NickName ));
openPrivButton( "leavepits",2,60,44,5,4,8,16,langEngine( "%{main_leavepits}%" ));
EndSub
Then in the LANG "EN" section, add the following;
main_remember = "^1! ^0R E M E M B E R^1 !"
. "&{0}";
main_leavepits = "^1Watch for traffic&^1when exiting pitlane";
PS If you go to my Sin'rs too server, you'll see something like this (and my driftmeter, and Yisc's pitboard, and when in spectator mode, Krayy's help and Tim's [which I plagiarized] MyStats) in action
drew555
20th December 2009, 13:04
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
20th December 2009, 13:24
To get the Lapper to display this laps DriftScore instead of split time I assume that this is the bit that needs modifying:
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:
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?
sinanju
20th December 2009, 14:14
First, you have to understand the difference between DriftScore and LastDriftScore.
As you drive around picking up points for drifting, points collect for each individual drift as your LastDriftScore.
The score you have at end of lap/circuit is the DriftScore.
On your first drift, you will have collected points under LastDriftScore,and these points will also show under DriftScore. If you were to finish the lap (or circuit), it's this DriftScore which is saved as your high score.
If you do combo drifts (meaning you do a drift, slight gap between this drift and next but still keeping above minimum drift speed) then do another drift, then your LastDriftScore will change (based on your current drift) to whatever your new score is (might be higher or lower than your previous drift), but your DriftScore will show the total of both scores (LastDriftScore + LastDriftScore = DriftScore). Assuming you can keep above minimum speed till you finish lap, this DriftScore is saved as your high score.
Of course, if between one drift and another you happened to drop speed below minimum (or crash), your DriftScore would reset to zero.
I know this all looks complicated, but if you had the drift meter working, the above would make sense! :schwitz:
Or to put it another way, it's the LastDriftScore that would have to show under your splits, and DriftScore as final split/lap end.
Hope that helps! :shrug:
drew555
20th December 2009, 16:41
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
20th December 2009, 16:52
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") . " °" );
drew555
20th December 2009, 17:24
Oh, and what do i call upon for Instant speed?
I want a GPS speedo :)
sinanju
20th December 2009, 19:32
Oh, and what do i call upon for Instant speed?
Look for the following piece of coding in your lapper file;
Sub DisplaySpeed( )
# PrivMsg("SpeedTrap = " . ToPlayerUnit( GetCurrentPlayerVar( "InstantSpeed" ) . " " . GetCurrentPlayerVar("UnitSpeed"));
cmdLfs( "/msg SpeedTrap = " . GetCurrentPlayerVar( "InstantSpeed") . " kph or " . ToMph( GetCurrentPlayerVar( "InstantSpeed") ) . " Mph" );
EndSub
Then under Event OnLapperStart() section, you will see something like;
RegisterNodeAction( "BL1" , 140 , DisplaySpeed );
or
RegisterZoneAction( "BL1" , -78,200, 5 , DisplaySpeed );
That means when the driver reaches a specific node or zone, then the speed will display.
BL1 is Blackwood
140 is the specific node on Blackwood
-78,200 is the specific zone on Blackwood, with 5 as how long message lasts
You need to go to racetrack and location where you want speed to display, and record the !zone or !node of your location.
I mainly use !node for speed on track, and !zone for messages about entering or leaving pits.
Once you have the !zone or !node co-ordinates, add an entry to your lapper config file.
Say you wanted speed to show on start/finish on Kyoto Oval (KY1), you would add ;
RegisterNodeAction( "KY1" , 4 , DisplaySpeed );
Thing is, you have to do this for every track configuration, and you may want to do more than 1 speedtrap if it's a big track.
On the plus side, if you change coding slightly, instead of speedtrap, you can put text, such as corner name, street name, warnings about specific corners, warnings about watching out for people leaving pits, your server name, etc, etc, etc.
For instance;
First register your node location on whichever track, along with sub-routine:
RegisterNodeAction( "KY1R" , 190 , SE_KY1Rstartfinish );
Then bit more detail on your sub-routine (basically a private message to the driver that reaches the node trigger point.
Sub SE_KY1Rstartfinish() # A Sinanju Event
privRcm( langEngine( "%{main_KY1Rstartfinish}%" ) );
EndSub
Then the message at the trigger point
main_KY1Rstartfinish = "Start / Finish line coming up";
sinanju
20th December 2009, 19:46
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") . " °" );
I think AngleVelocity just means that your car is moving (velocity) at an angle when car should be moving in a straight line. This also happens in a corner, where the back end is not following the front.
Instead of using "DriftAngle", try "AngleVelocity".
You may want to think about differentiating between car drifting one way or another (facing left or right). Especially if you don't want a negative angle showing up on your drift score meter.
PS You've got a full stop after the comma that follows the 32 (32=background colour of button), which is then followed by text field - don't think this will work.
Gai-Luron
20th December 2009, 21:13
To have all player var available take a look at file playerVars.txt in doc folder. i don't know if this file exist in your release. But in 5.9 you can refer to it to know all player var
Gai-Luron
drew555
20th December 2009, 22:06
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 :D
drew555
20th December 2009, 22:24
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?
Gai-Luron
21st December 2009, 10:02
Hello,
You can copy and paste that is inside events, not the line Event yourEvent ( ), because in 5.9 Player Event have a new parameter $userName ( you don't have to use it if you want ).
Also take a look at your code because var are case sensitive now
GetCurrentPlayerVar( "username" ) not same as GetCurrentPlayerVar( "UserName" )
Take a look at varslapper.txt in doc folder for complete list of builtin var for player
5.9 it's very similar to 5.8, the big difference is that player event receive the username of the player who triggered this event, that's all. the rest catchevent and catchsub are a new feature, not obligation to use it, but recommended to have clean script.
5.8 no more developped, no maintained, no upgrade
Gai-Luron
drew555
21st December 2009, 10:39
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?
Gai-Luron
21st December 2009, 11:36
Event OnSplit1() # Player event
it is that i say previously
now
Event OnSplit1( $userName ) # Player event
Don't change line containing word Event in LFSLapper.lpr 5.9.1.4 file, paste your code inside Event... EndEvent
This line is wrong, forgot IF and double ); ); at end
openPrivButton( "split01",50,5,100,10,8,3,32, . "^1Split 01:^7 " . GetCurrentPlayerVar("DriftScore") . " ^1pts" ); );
ENDIF
maybe a bad copy paste from your LFSLapper file to your post
drew555
21st December 2009, 12:10
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?
Gai-Luron
21st December 2009, 12:22
Take a look in err file.
drew555
21st December 2009, 13:53
Fixed the pit message, turns out it was this...
"^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?
Gai-Luron
21st December 2009, 14:23
Automatic done relative to choice in !myconfig for each player
Script present in LFSLapper.lpr file is also relative to that choice
drew555
21st December 2009, 14:46
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?
Gai-Luron
21st December 2009, 15:21
Hello,
I see your previous post about this feature. I try to put in LFSLapper but there is a problem to do that. In fact LFS send packet every 1/10 of second, but the distance that vehicle have done is wrong for this unit of time and by extension the speed is wrong. But near to true for 5 time unit (average speed).
In fact this is due to packet latency or lag
If i use this 1/10 of second unit, speed can climb up to 200km/h in one packet and 20km/h in next. The real speed is near 110 when i use more then 4 packet.
The GPS value can be correct every second, no under this value
there is a possibility if i make average of the 5 previous dist making a glissando for one step unit.
Example
avg of packets ( 1 2 3 4 5 )
then avg of packets ( 2 3 4 5 6 )
then avg of packets ( 3 4 5 6 7 )
i try if i can do that ;), if this can be done, the GPS speed is late about 500 millisecond relative to real speed
i hope you understand what i say
Gai-Luron
drew555
21st December 2009, 15:48
Yes, I understand.
A small lag is very acceptable - I believe that true GPS actually works that way as well.
Thank you.
drew555
21st December 2009, 16:36
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?
Gai-Luron
21st December 2009, 17:11
drew_welc2 = "^7Your best drift score: {0} &Don't act the fool&Respect your fellow drifters";
openPrivButton( "pos",25,80,150,10,8,-1,32,langEngine("%{drew_welc2}%",$bestDrifScore ) );
{0} is replaced by the first arg in langengine
{1} is replaced by the second arg in langengine
and so on
Dont forget to assign $bestDrifScore with the GetCurrentPlayerVar containing the best drift score.that's all
look at other langengine in default file to better understand how it work
drew555
21st December 2009, 17:41
Here's where I have my problems :D
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.
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.
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?
{0} is replaced by the first arg in langengine
{1} is replaced by the second arg in langengine
and so onI'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?
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 :)
Fire_optikz001
21st December 2009, 18:52
Hello,
I see your previous post about this feature. I try to put in LFSLapper but there is a problem to do that. In fact LFS send packet every 1/10 of second, but the distance that vehicle have done is wrong for this unit of time and by extension the speed is wrong. But near to true for 5 time unit (average speed).
In fact this is due to packet latency or lag
If i use this 1/10 of second unit, speed can climb up to 200km/h in one packet and 20km/h in next. The real speed is near 110 when i use more then 4 packet.
The GPS value can be correct every second, no under this value
there is a possibility if i make average of the 5 previous dist making a glissando for one step unit.
Example
avg of packets ( 1 2 3 4 5 )
then avg of packets ( 2 3 4 5 6 )
then avg of packets ( 3 4 5 6 7 )
i try if i can do that ;), if this can be done, the GPS speed is late about 500 millisecond relative to real speed
i hope you understand what i say
Gai-Luron
that will be cool for drift points and such... would also help me with my cruise addon
Gai-Luron
21st December 2009, 19:01
drew_welc2 = "^7Your best drift score: {0} &Don't act the fool&Respect your fellow drifters";
langEngine("%{drew_welc2}%",$bestDriftScore )
replace {0} with content of$bestDriftScore
Another example with 2 argument to langEngine
drew_welc3 = = "^7Hello {0} Welcome on {1}";
langEngine("%{drew_welc3 }%",$uname,"My Server Name" )
replace {0} with content of $uname
replace {1} with "My Server Name" ( without quote )
All identifier precede wth $ is variable
$uname is a variable that can contains text or numeric value
To set it use this syntax
$uname = "My var contain this text";
in this case $uname contains "My var contain this text";
$uname = GetCurrentPlayerVar( "UserName");
in this case $uname contains the player userName, "Gai-Luron" if it's me who connect to your server and trigger the event onConnect.
Gai-Luron
PS : For now you haven't access to the driftPb, i put it in next release
drew555
23rd December 2009, 12:06
Thanks Gai, I'll have an experiment with that and get back to you ;)
drew555
24th December 2009, 11:33
Another one :D
I have had a look through the documentation I have - and can't find what I'm looking for.
This part:
$DriftDatabase = "./DriftPB";
$MinimumDriftSpeed = 30; # Minimum speed in km/h to maintain. Driving below that speed will reset score
$MinimumDriftAngle = 15; # Minimum angle to maintain. When angle is below value, score is reset
$MaximumDriftAngle = 210; # Maximum angle to maintain. When angle is above value, score is reset
Is there somrthing in Lapper that allows me to perform an action on drift score reset - perhaps something like OnDriftScoreReset:
Event OnDriftScoreRest( $userName ) # Player event
openPrivButton( "resetscore",50,5,100,7,10,10,0,"SCORE RESET");
EndEvent
In fact, I'll try that and see what happens :D
drew555
24th December 2009, 11:42
Didn't work - in fact, it stopped my LangEngines working, lol.
sinanju
24th December 2009, 18:34
Maybe you should thing of trying a IF - THEN - ELSE - ENDIF function.
e.g.
IF $MinimumDriftSpeed < 30
THEN
$DriftScore = 0
openPrivButton( "resetscore",50,5,100,7,10,10,0,"SCORE RESET");
ELSE
ENDIF
or
IF $MaximumDriftAngle > 210
THEN
$DriftScore = 0
openPrivButton( "resetscore",50,5,100,7,10,10,0,"SCORE RESET");
ELSE
ENDIF
Fire_optikz001
25th December 2009, 22:50
Event OnDriftScoreReset( $userName ) # Player event
openPrivButton( "resetscore",50,5,100,7,10,10,0,"SCORE RESET");
EndEvent
u missed an e in reset but istill dk if it would work :/
vBulletin® v3.8.6, Copyright ©2000-2012, Jelsoft Enterprises Ltd.