The online racing simulator
Searching in All forums
(446 results)
[CODE] Set Race Duration in Kms or Mins
Krayy
S2 licensed
One of the things that has frustrated me as a race admin is the inability to set a race by either distance or time with any great accuracy. To that end, here is an lpr script that you can use to set the race duration by either distance, measured in Kms or time, measured in mins.


<?php 
# Syntax:
# !kms <kms>
#        This will set the race duration to the number of laps that is equal to
#        the specified distance divided by track length, rounded up.
#        
# !mins <mins> [<laps>]
#        This command will cause a race to set its last lap as the lap after
#        The specific <mins> has expired. The optional second parameter allows
#        you to set the number of extra laps at the end of the race
#        e.g. "!mins 10 3" will set a rcae to run for 10 mins then add 3 laps
#        to the lap counter
?>

Note: Some of the variables in the script are not referenced as this is a modified version of my actual script that needs to use a modified LFSLapper.exe, which I will forward to GL for him to update in the future.

Also, you will need to ensure that your trackList.cfg file in your main Lapper directory has more accurate track lengths like this:

<?php 
AS1
,Aston,Aston Cadet,1.870
AS2
,Aston,Aston Club,3.077
AS3
,Aston,Aston National,5.602
AS4
,Aston,Aston Historic,8.089
AS5
,Aston,Aston GP,8.802
AS6
,Aston,Aston Grand Touring,8.002
AS7
,Aston,Aston North,5.168
BL1
,Blackwood,Blackwood GP,3.307
BL2
,Blackwood,Blackwood Rallycross,1.839
BL3
,Blackwood,Blackwood Car Park,0
FE1
,Fern Bay,Fern Bay Club,1.584
FE2
,Fern Bay,Fern Bay Green,3.086
FE3
,Fern Bay,Fern Bay Gold,3.514
FE4
,Fern Bay,Fern Bay Black,6.559
FE5
,Fern Bay,Fern Bay Rallycross,2.018
FE6
,Fern Bay,Fern Bay RallyX Green,0.745
KY1
,Kyoto,Kyoto Oval,2.980
KY2
,Kyoto,Kyoto National,5.138
KY3
,Kyoto,Kyoto GP,7.377
SO1
,South City,South City Classic,2.033
SO2
,South City,South City Sprint1,2.048
SO3
,South City,South City Sprint3,1.334
SO4
,South City,South City Long,4.029
SO5
,South City,South City Town,3.146
SO6
,South City,South City Chicane,2.917
WE1
,Westhill,Westhill International,5.180
AU1
,Autocross,Autocross Autocross,0
AU1
,Autocross,Autocross Skid Pad,0
AU1
,Autocross,Autocross Drag Strip,0
AU1
,Autocross,Autocross 8 Lane Drag,0
?>


Good luck all.
Krayy
S2 licensed
Quote from jsrk :Hi,

Answer 1: Ip adress for each server:

Server 1: 81.207.36.235 (not online atm)
Server 2: 85.17.183.199
Server 3: 85.17.183.199
Server 4: 85.17.183.199

Answer 2 :

For Server 1:
DEF1|gr1|81.207.36.235|29999|./default|default_1.ini|autowork

For Server 2 :
DEF1|gr1|85.17.183.199|29999|./default|default_1.ini|autowork

For Server 3 :
DEF1|gr1|85.17.183.199|30000|./default|default_1.ini|autowork

For Server 4 :
DEF1|gr1|85.17.183.199|30001|./default|default_1.ini|autowork

Answer 3 :

I have only run 1 lapper for 1 server at the same time, but if its possible to run it to many servers from the same lapper i will do that If i get example

Answer 4 : An Attachments+LFSServers.cfg

The LFSServers.cfg:

# Configuration of LFSServer to be Managed with LFSLapper
# One line per server
# Remote port is the port used to manage LFSLapper remotely, future extension
# One remote port per LFSLapper on one machine, autoStart is optionnal
#Unique ID|GroupId|Ip|Port|WorkDir|IniFile|autowork
timeOutScript=2000;
remotePort=3001;
DEF1|gr1|85.17.183.199|29999|./default|default_1.ini|autowork

Hope that info is enough and that 1 screenshot

See you

-jsrk-

Okay,

Basically the issue is that you are trying to run Lapper clients connecting to multiple servers from the same directory etc. The way that Lapper works when setting up a new instance is that it will see if the directory exists and if not it makes a copy of the defaultfiles directory with the new name. Then you only need to change the server password in the .ini file.

Change the LFSServers.cfg to this:

<?php 
#    Configuration of LFSServer to be Managed with LFSLapper
# One line per server
# Remote port is the port used to manage LFSLapper remotely, future extension
# One remote port per LFSLapper on one machine, autoStart is optionnal
#Unique ID|GroupId|Ip|Port|WorkDir|IniFile|autowork
timeOutScript=2000;
remotePort=3001;
# Server 1:
SRV1|gr1|81.207.36.235|29999|./srv1|default_1.ini|autowork
# Server 2 :
 
SRV2|gr1|85.17.183.199|29999|./srv2|default_1.ini|autowork
 
# Server 3 :
 
SRV3|gr1|85.17.183.199|30000|./srv3|default_1.ini|autowork
# Server 4 :
SRV4|gr1|85.17.183.199|30001|./srv4|default_1.ini|autowork
?>


(Change names to be more descriptive if you want to)

Run Lapper once and it should create the directories srv1,srv2,srv3 & srv4. Most likely it won't connect to all the servers as the passwords will be wrong, so kill Lapper, then edit the password entries in the default_1.ini files in each driectory to match the server passwords. Start Lapper again and see if it connects to the servers.
Krayy
S2 licensed
Quote from sinanju :Having problem with the !who module.

...

I've rewritten the module to incorporate your user stats...
Krayy
S2 licensed
Quote from sinanju :You have all the GlobalVar $MemberTypes; in your CIF Membership module.

Should they be in the Utils.lpr file?

Good point. In theory the utils.lpr should have definitions for any globals that are used in more than 1 module. I suppose it doesn't matter if they are there, as if you don't use the module that uses them, then no harms done, just a few k of memory. I'll update it soon.
Krayy
S2 licensed
You know that it's not plagiarism if I've put it in the public domain, right?

But keep going, we'll build it up bit by bit.
Krayy
S2 licensed
Okay, can you please give us:

1. The ip address of each of your LFS servers.
2. Copy & paste the line that says somehting like "/insim=31993" from each of your LFS servers setup.cfg files

Are you running 2 instances of Lapper or only 1 that connects to both servers? If running 1 instance, paste your LFSServers.cfg file and a screenshot of an expanded explorer tree view of your Lapper directory so we can see that everything is in the right place.
Krayy
S2 licensed
Quote from sinanju :It does.

Thanks.

I've got 3 versions of lapper 6.011 on my computer, and trialling things on each one, including your CIF modules, and i'm getting myself lost remembering what i'm doing on what, which is why I thought it might have been something i'd changed.

The next update to CIF will require a new LFSLapper.exe file, so it may be a couple of weeks away while I get the new code to Gai for upload. I'll let you know when it's ready.
Krayy
S2 licensed
Quote from jsrk :I don't mean that. I mean the error. I get this to my LFSLapper.exe :

Lapper Instance abort, Go in StnadBy mode. Look at log file :./deafult/logs/85.17.183.199-ERR.log

-jsrk-

So whats in the log file?
Krayy
S2 licensed
Quote from sinanju :For some reason, the top line when I open the CIF will display host name and the module name of the tab I'm in (e.g. Top), but if I tab around (Handicap, Stats, Membership, etc), the top line doesn't change.

It did in your first version of CIF, but doesn't appear to work this way in later version.

Or is it just me?

Nope, it's me...I have moved the line that writes the title to just above the line that adds the Close button like this:


<?php 
    
# Add the title & Close Command Button
    
openPrivButton "cMain_TabbedGuiTitle"$CifTabOrigL$CifOrigT 8$CifTabWidth $CifWidth 781, -1ISB_LEFT 2$HostName "^0 - " $cifTitle );
    
CifCmdButton0"Close"CloseCifAll );
?>

That should fix it.
Krayy
S2 licensed
Quote from sinanju :Playing around, and using/plagiarising almost all of one of Krayy's existing modules, made this MyStats module, which gives various stats about you, the driver, e.g. position in overall server track ranking, drift points, pb on server, spb, etc.

You need to add the line

<?php 
include ("./cif/help_mystats.lpr"); # MyStats Help
?>

into your addonused.lpr file.

You can either drop the "Brought to you by....." or change it to read your own server name.

Nice...I'll take that thankyou *snatch*

As to the OnREO that the grip.lpr module requires, it also needs a modified LFSLapper.exe won't work, so don't use it until I either:

a) Post it
b) Pass on the code to Gai to include in an update
Krayy
S2 licensed
A touch of inspiration later, and I've done one as a tribute to the original LFS skins for the UF1...
Krayy
S2 licensed
Quote from E.Reiljans :In this very case, you can make FoV a bit bigger on 1920x1200, this way you'll have same horizontal range, but bigger vertical range.

Good point. I guess what I'm really trying to find out is how much peripheral vision you can get with a 16:9 vs what you would get with a 16:10. My current monitor runs at 1680x1050 and it's big enough, I just can't see enough out of the sides. If only I had enough space for a triple head setup.
Krayy
S2 licensed
Time we gave this baby a re-thread (bwahahahahaha)...

16:9 vs 16:10...is there a clear difference between them with regards to viewing window?

Specifically, if I can get screenshots of a 1920x1200 and a 1920x1080 at 90FOV, that would be greatly appreciated?
Krayy
S2 licensed
Quote from Krayy :I looked at doing that but with the number of modules in the works it might overrun the display. I suppose I could do it until I get enough modules up then we can move the help files off. Good idea, will repost shortly.

Here's the rewrite. Have sped up the redraws too so that it's a lot smoother when going from module to module.

Just overwrite your existing cif folder, or see top post for new installs.
Last edited by Krayy, .
Krayy
S2 licensed
Quote from sinanju :Took ages to find reason why, but your admin_membership.lpr file is overwriting my normal 'welcome' message.

That was actually by design believe it or not, as i wanted to leave the stock Lapper.lpr file and use the membership_admin.lpr as the welcome msg.

It's easy to change by just changing the Event OnConnect to CatchEvent OnConnect
Krayy
S2 licensed
Quote from sinanju :Rather than having individual on screen modules, would it be possible to have them amalgamated into one?

I looked at doing that but with the number of modules in the works it might overrun the display. I suppose I could do it until I get enough modules up then we can move the help files off. Good idea, will repost shortly.
Krayy
S2 licensed
Quote from sinanju :Don't have either the old tops.lpr file or it listed in the addonsused.lpr file.

Only happens when I type !top.

You'll need to search your lpr files for anything that says something like "!top" (in quotes) to see what lapper script is already tied to the !top command.

BTW, what is in your addonsused.lpr file?
Krayy
S2 licensed
Quote from sinanju :Just downloaded and tried out your updates.

Couple of things.

On the Tops tab, you've removed the handy car type choice from bottom of background button.

Or it's not showing on my pc.

Also. For some reason, and even though I only have your new tops.lpr file and none of the previous tops.lpr files, if you type !top, then lapper will load the normal top listing, then delete it and overlay with your tops listing. See slo-mo movie in attached zipped file.

For the car lists, make sure you have the latest utils.lpr from the community edition thread as the car array was changed (also check your Lapper error log in the logs directory).

As for the overlay, comment out the old tops.lpr from the addonsused.lpr file.
Krayy
S2 licensed
I just posted an update for th emain cif.lpr and the tops module...see post 1 along with attachments.

As to drift stats, I would think it can be. I'd need to see your .lpr file that displays the current drift scores.

I'm looking at putting in a Grid Reordering module which will require an updated Lapper.exe file which I will post here when I get it tested.
Last edited by Krayy, .
Krayy
S2 licensed
Quote from MadCatX :Well, if a car collides with another car or a trackside object, shouldn't that trigger a yellow flag? You could check acceleration limits only if there is no yellow flag warning. It will most likely no be 100%, but I think we're talking compromises all along and this one sounds like an idea worth exploring to me...

I was doing this in a Lapper module and it seemed to work quite well, although if the barrier is on the road (like on the S0* tracks) then the car never officially leaves the track, hence no Yellow. I think you would need a mix of factors like:
1) If the user is in a Yellow condition, then it is most likely a crash
2) Has the user passed anyone while going > maxspeed while not under yellow?
3) Maybe have a > maxaccel value (by testing cars on the drag strip)
4) Register users on the server as trusted, much like the Member Admin module I use on Lapper
Krayy
S2 licensed
Quote from m1chi119 :

<?php 
CatchEvent OnLapperStart
()
    
$LockState "unlocked";
EndCatchEvent

...
?>

It should spec everybody who joins after i did !lock, until i do !unlock to unlock the race again (it should also work in Training)
Why it doesnt work? Whats the mistake? :-S

The reason is because the LockState variable that you are setting has not been declared as a Global variable. If you do not explicity define a GlobalVar, then it will be destroyed when the function exits. Change your OnLapperStart event to this:


<?php 
CatchEvent OnLapperStart
()
    
GlobalVar $LockState;
    
$LockState "unlocked";
EndCatchEvent
?>


Krayy
S2 licensed
Can you post a copy of your LFSServers.cfg file as well as each servers /insim= and /port= lins from each servers setup.cfg file


That will let us see what the config is and if there is an issue;
Krayy
S2 licensed
...now with added screenies!!!

I also want to add a <<back arrow so that you can go to the main cif groupos (Info, Admin, Help, Etc) from any other acreen.
Krayy
S2 licensed
NEWS!!! This lapper addon has now been superseded by the Common Interface Framework (CIF): http://www.lfsforum.net/showthread.php?t=72589
[CODE] Common Interface Framework (CIF) & Modules
Krayy
S2 licensed
Holy heck, it's finally here!!

This is my new and improved common look & feel interface for LFSLapper and supersedes the previously released GUI. I was going to wait unitl I had a few more modules done, but I figure that you guys can help me out with the testing and debugging.

NOTE: This addon requires Lapper 6.011 or greater and the latest community utils.lpr that is in the utils.lpr thread : http://www.lfsforum.net/showthread.php?t=71245

Just download the zip file, extract it into your includes folder (it will create the ./cif directory) and add these lines near the top of your addonsused.lpr file:


<?php 
#####################################
# CIF includes
# You can reorder these lines to change the tab order on the sub-menus
#####################################
include ("./cif/cif.lpr");    # This MUST be first to define all of the CIF globals

# CIF Admin Modules #################
include ("./cif/admin_membership.lpr"); # Membership administration

# CIF User Modules #################
include ("./cif/info_who.lpr"); # Who, replaces the who,lpr module and !who command
include ("./cif/info_handicaps.lpr"); # Player Handicap Info
include ("./cif/info_tops.lpr"); # Top output with interactive buttons, replaces tops.lpr, !top, !near, !qual, !nearqual

# CIF Help Modules #################
include ("./cif/help_general.lpr"); # General Help and !help command
include ("./cif/help_admin.lpr"); # Admin Help
include ("./cif/help_stats.lpr"); # Stats Help
include ("./cif/help_custom.lpr"); # Custom server Help
#include ("./cif/help_cruise.lpr"); # Only needed if you're running T3Charmys Cruise system
?>

You will need to comment out the following modules from the addonsused.lpr file too:
  • tops.lpr
  • who.lpr
  • gui*.lpr (anything that starts with gui)
  • handicaps.lpr
  • member_admin.lpr
  • admin_* (older admin guis stuff)
Have a look at the code for now, and I'll put some actual docs on how to create new ones later on.

Updates:
24 Jan 2011
- Big rewrite of cif.lpr module to redraw screen more efficiently
- Rewrite of info_tops.lpr to improve car selections and layout
- utils.lpr updated (see community edition thread link above)
- Handicap module rolled into 1 for Admins and Users alike - stupid having it split into the 2 different ones

02 Feb 2011
- Even bigger rewrite of how the tabs are drawn and redrawn to speed it up
- Modified display so all modules on Tab Bar now
Last edited by Krayy, .
FGED GREDG RDFGDR GSFDG